Make a point orbit another point, given time and a normal.

156 Views Asked by At

I am working in 3D space. I am trying to make a solar system model.

known variables:

center of orbit, C (x,y,z)

normal, perpendicular to the orbit, N (x,y,z)

radius of orbit, R

time, position around orbit, T

How would I find the 3d point, P given these variables.

I'm thinking I need to use the equation of the plane from the Normal, (ax + by + cz = d). Then somehow apply the equation of a 2d circle onto this plane. I could be way off though.

1

There are 1 best solutions below

1
On BEST ANSWER

Best to start with N, find two unit vectors perpendicular to it, then use those to create a vector to P relative to C.

If you already know that $\hat N$ is roughly along the $Z$ axis, you can pick the unit $\hat{X}$ as a roughly perpendicular vector. It probably isn't, but take the cross product $\hat N \times \hat X$, call it $\hat U$, and you'll for sure have a vector perpendicular to $\hat N$. Now figure $-\hat N\times \hat U$ and you'll have a unit vector perpendicular to $\hat N$ and $\hat U$, roughly where X was but in the plane of the orbit.

If $\hat N$ could be pointing wildly in any direction, then you have to be more careful picking an initial direction to make $\hat U$. Good luck!

Now, we need to make a particle move in a circle in the U-V plane. If you're attempting this 3D geometry problem, chance are you already know how to compute the the position of a point on a circle in x,y coordinates and a given angle.

Compute a relative position vector, call it, i dunno, $\vec A$, by combining $\hat U$ and $\hat V$ in proportion to sin and cosine function of time:

$ \vec A = \vec U \sin(2\pi t/T) + \vec V \cos(2\pi t/T) $

Add an phase constant, or some subtract some time offset $t_0$ from t, if you wish.

The final full coordinates of the planet in absolute coordinates is then

$\vec P = \vec A + \vec C$