
A Point on a shpere surface
I was wondering,
if in the unit circle you get the coordinate on the circle unsing theta by doing p=(cos(tetah), sin(tetah)),
how do you get the xyz in the unit sphere (using tetah and phi)?
I would like to understans why it''s like that because I don''t like writing stuff to my project without understanding them first..

Assuming that theta is the same as in the 2d case (i.e. it rotates between the x and y axis) and phi is measured up [and down] from the ''equator'' that is in the same plane as the x and y axis, then the coordinates are:
x = cos (theta) * cos (phi)
y = sin (theta) * cos (phi)
z = sin (phi)
To help understand this you can work out x^2 + y^z + z^2. If you do out correctly using algebra and trig identities you should get x^2 + y^z + z^2 = 1, confirming that the point (x, y, z) lies on the surface of a sphere. Or try using the above exprssions to plot points in 3D with theta = 0, 10, ... 360 and phi = 0, 10, .. 180 degrees.
x = cos (theta) * cos (phi)
y = sin (theta) * cos (phi)
z = sin (phi)
To help understand this you can work out x^2 + y^z + z^2. If you do out correctly using algebra and trig identities you should get x^2 + y^z + z^2 = 1, confirming that the point (x, y, z) lies on the surface of a sphere. Or try using the above exprssions to plot points in 3D with theta = 0, 10, ... 360 and phi = 0, 10, .. 180 degrees.
John BlackburneProgrammer, The Pitbull Syndicate
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement