#### Archived

This topic is now archived and is closed to further replies.

# math

This topic is 6290 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What is the formula for a point on a sphere? i know there are two formuli (or is it formulas) for a circle: x=r*sin(a)+x1 y=r*con(a)+y1 (i think) but is there a simalar formula for a sphere? I am using this for positoining the camera and target in my game (the target should allways be on the surface of an immaginary sphere arround the camera) Is this meathod the best or is there another meathod that is faster? thanks

##### Share on other sites
Well if you''re using coordinates and angles, you''re going to need 2 angles in order to represent 3 dimensions. a is the angle in the x/y plane, you need an angle in the x/z or y/z plane.

Of course, I am almost certain that there is a better way to do it using vector maths, but I don''t know it

This much is true though, if you want to check if your point lies on the surface of that sphere:

(x1 - x)² + (y1 - y)² + (z1 - z)² = r²

Harry.

##### Share on other sites
may be this helps

x = p*cos(a)*sin(b)
y = p*sin(a)*sin(b)
z = p*cos(b)

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 30
• 22
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001800
×