Equations

Started by
4 comments, last by Acer 22 years, 6 months ago
where can I go to get a large amount of different equations of shapes. Also if anyone knows the Equation (formula) of a Sphere, please post it. I am trying to make one in OpenGL in VB.
Tight
Advertisement
I just cheat and do it with polar coordinates: set the radius to a fixed number and rotate around the x and y axis. Then I convert the whole array of polar coordinates to an array of cartesian coordinates. But then again, I''m a newbie...
If I know what you mean:
Sphere: r*r = (x*x) + (y*y) + (z*z)
Ellipsoid: 1 = (x/rx)2 + (y/ry)2 + (z/rz)2
Torus: 1 = (r - sqrt((x/rx)2 + (y/ry)2))2 + (z/rz)2

Those are all I have on hand, I can probably dig up some more from a book I have. Say if that''s what you were looking for.

[Resist Windows XP''s Invasive Production Activation Technology!]
For the sphere you can use the cartesian equation as given by 'Null and Void':

r2 = x2 + y2 + z2

or the parametric equations

x = r*cos(theta)*sin(phi)
y = r*sin(theta)*sin(phi)
z = r*cos(phi)

where theta is the angle in the x-y plane measured from the positive x axis and phi is the declination (angle down) from the z axis to the point on the surface of the sphere.

A cone is given by:

z2 = c2(x2/a2 + y2/b2)

A Cylinder by the parametric equations

x = r*cos(theta)
y = r*sin(theta)
z = a

where theta is again the angle in the x-y plane and a is the distance of the point (on the surface of the cylinder) from the x-y plane.

A parabolic bowl can be given by

z = c2(x2/a2 + y2/b2)

Have fun!

Timkin


Edited by - Timkin on October 18, 2001 12:42:32 AM
I have an OpenGL project in VB that makes a cube.
here is some of it.

TmpX=cos(100)
TmpY=-Sin(100)
TmpZ=Cos(100)
glVertex3d TmpX,TmpY,TmpZ

That makes a Cube.
I want the TmpX, TmpY, and TmpZ equations to make a Sphere or any other shape I want.
Tight
Sorry for my brutal honesty, but the best way to find a list of equations all in one place is by going to www.google.com and searching for "conic equations" or "polygon equations" or something.

Free Speech, Free Sklyarov
Fight the unconstitutional DMCA.

Commander M

This topic is closed to new replies.

Advertisement