Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 86c3d80c4d6e905f610c100030811165 > files > 61

mathomatic-14.5.5-1mdv2010.0.i586.rpm

; Here is a simple equation for a torus (donut) in 3D Cartesian space.
; "c" is the distance from the center of the hole
; to the center of the tube (major radius).
; "a" is the radius of the tube (minor radius).
; (x, y, z) are the Cartesian coordinates of each point on the torus.
; These equations have not been verified, but it does plot as a torus.

(c-(x^2+y^2)^.5)^2+z^2 = a^2

; The formula to compute the surface area of the above torus:
surface_area = 2pi*(c+a)*(c-a)

; Volume of the above torus:
volume = 1/4*pi^2*(a+c)*(c-a)^2