So coming from a flash background I have an OK understanding of some simple 2D trig. In 2d with I circle, I know the math to place an item on the edge given an angle and a radius using.
x = cos(a) * r; y = sin(a) * r;
Now if i have a point in 3d space, i know the radius of my sphere, i know the angle i want to position it around the z axis and the angle i want to position it around, say, the y axis. What is the math to find the x, y and z coordinates in my 3d space (assume that my origin is 0,0,0)? I would think i could borrow the Math from the circle trig but i can't seem to find a solution.
The general equation of a sphere is: (x - a)² + (y - b)² + (z - c)² = r², where (a, b, c) represents the center of the sphere, r represents the radius, and x, y, and z are the coordinates of the points on the surface of the sphere.
A sphere is uniquely determined by four points that are not coplanar. More generally, a sphere is uniquely determined by four conditions such as passing through a point, being tangent to a plane, etc. This property is analogous to the property that three non-collinear points determine a unique circle in a plane.
Your position in 3d is given by two angles (+ radius, which in your case is constant)
x = r * cos(s) * sin(t) y = r * sin(s) * sin(t) z = r * cos(t)
here, s is the angle around the z-axis, and t is the height angle, measured 'down' from the z-axis.
The picture below shows what the angles represent, s=theta in the range 0 to 2*PI in the xy-plane, and t=phi in the range 0 to PI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With