问题
Essentially, i want to find the equation of the ring that circles a point in space, this ring is perpendicular to a normal away from this point.
I have a line, in the form of 2 points, L1, L2;
I have the normal from L1->L2, N;
I have the plane that is normal to L1->L2, which L1 lies on. ax + by + cz = d;
I have the radius away from L1, R;
-> I want to make a point V, orbit this line around point L1;
I think I have to make a circular equation in this plane with L1 as the origin. I have no idea how to plot a 2d equation onto a 3d plane.
Or maybe someone knows how to do do this another way, cross products or something?
回答1:
This problem actually requires a nontrivial solution. Suppose you have U = normalize(L2 - L1) and two unit vectors V and W such that U, V, W are pairwise orthogonal.
Then f(a) = L1 + R * (V * cos(a) + W * sin(a)) for angles a is the equation for the circle you want.
How can you find W given U and V? W can just be their cross product.
How can you find V given U? This is where it's not straightforward. There are a whole circle of such V that could be chosen, so we can't just solve for "the" solution.
Here's a procedure for finding such a V. Let U = (Ux, Uy, Yz).
If Ux != 0 or Uy != 0, then V = normalize(cross(U, (0,0,1)))
Else if Ux != 0 or Uz != 0, then V = normalize(cross(U, (0,1,0)))
Else U = 0, error
Note: You can negate W if you want your point to cycle in the opposite direction.
回答2:
You may use Rodrigues' Rotation Formula (try to find better description)
来源:https://stackoverflow.com/questions/22926361/how-to-make-a-point-orbit-a-line-3d