What is the calculus-theoretic formula to calculate the homotopy class/degree of a map $T^2\to S^2$? I know by Hopf classification theorem that $[T^2;S^2]$(torus to sphere) are classified by the integral cohomology group $H^2(T^2;\mathbb{Z})\approx\mathbb{Z}$. Also I understand that in general, given any continuous map $\phi:T^2\to S^2$, we can first obtain a cellular approximation $\tilde{\phi}$ of $\phi$, then the problem reduces to simple cellular decompositions and calculations of degrees of maps on cells. 
The problem is that the above procedure seems very hard to be programmed into a computer. I'm wondering, if I only care about smooth maps, is there a calculus-theoretic formula of doing it? Let's, say  use the following notations, 
$$\phi:(z_1, z_2)\mapsto(u(z_1,z_2),v(z_1,z_2),w(z_1,z_2)),$$
where $(z_1, z_2)=(\exp(ix_1), \exp(ix_2)), x_1,x_2\in[0,2\pi)$ and $u^2+v^2+w^2=1$; or any other notation you find more convenient.
 A: You're looking for calculus, so it's very simple. You want to take a $2$-form that generates $H^2(S^2)$, pull it back by your mapping, and integrate over the torus. So, if you had the mapping in spherical coordinates, most conveniently, say 
$$f(e^{2\pi i s},e^{2\pi i t}) = (\phi(s,t),\theta(s,t)),$$
then you would pull back $\frac1{4\pi}\sin\phi d\phi d\theta$, which is the area $2$-form, integrate $ds\,dt$ over $[0,1]\times [0,1]$, and that would be your degree. 
(If your mapping is, as you indicated, given in cartesian coordinates, then just pull back $\frac1{4\pi}(x dy\wedge dz + y dz\wedge dx + z dx\wedge dy)$ and integrate.)
If you need further clarification, let me know.
A: This is closely related to the Gauss linking number, one of the first examples of a topological invariant given by an integral. You'll find an extensive historical discussion in "Orbits of Asteroids, a Braid, and the First Link Invariant", by Moritz Epple, Mathematical Intelligencer v.20 no. 1 (1998) p.45-52, and in "Gauss' Linking Number Revisited", by Renzo Ricca and Bernardo Nipoti, Journal of Knot Theory and Its Ramifications, v.20 no.10 (2011) p.1325-1343, including Gauss's original integral formula for what you seek.
The Wikipedia article on Linking Number gives the Gauss formula in slightly more modern form: Linking Number: Gauss's integral definition.
To relate this to your question, you have two parameters $z_1$ and $z_2$ each ranging over a unit circle. Let $\gamma_1(z_1)$ and $\gamma_2(z_2)$ be embeddings of these circles into $\mathbb{R}^3$. Assume that the embeddings are disjoint. So we have a pair of loops. Then $\phi(z_1,z_2)=\gamma_1(z_1)-\gamma_2(z_2)$ is a mapping of the torus into $\mathbb{R}^3\smallsetminus\{0\}$, which immediately gives us a mapping into $\mathbb{S}^2$, and its index is the Gauss linking number of the two loops.
Your case is a little more general, since your $\phi$ is any smooth map from $\mathbb{T}^2$ to $\mathbb{S}^2$. The formula given in the other posted answer shows how Gauss's formula generalizes to this case.
Here's a link to one of the historical articles: Gauss' Linking Number Revisited
