I think radii of the circle are an easier quantity to work with than distances from the endpoints.

That ω thing - angular velocity - is just how many radians the point moves along the circle per unit time. It can be any arbitrary angle over any arbitrary timeslice. Or, you could just give it a static value.

The direction of rotation is given by the sign of ω. Positive means it's rotating counter-clockwise WRT its axis of rotation, and negative the opposite. I don't think you have to worry about it too much; the math should just take care of it for you.

So, the point moves along an arc of length ω. What is the linear distance between the starting and ending points? Well, this motion divides the circle into a number n of--wait, I think I need to tweak this part. The formula I gave you was for a circle divided into n equal parts, but we don't necessarily have that here.

The two radii from the start and end points of motion form a triangle with angle ω at the top. Bisect the angle to get two right triangles with top angles of ω/2. You can then use trig to find the length of the distance the point traveled:

2r sin (ω/2) = L

Now we have that length. This line is a vector, meaning a quantity with both magnitude (length) and direction (angle). We can use this fact to find the offset that we must add to the coordinates of thepoint in order to rotate it one step.

Every vector has components. A component is just a vector that is directed along one of the axes. Take three of these and add them (using vector arithmetic), and you produce a 3d vector. But you don't need to add them, you just need to find them. My second post described that process.

Once you have Lx, Ly, and Lz (remembering the axes I've defined; yours may be different--you may have to swap y and z, for example), you can just add them to the x, y, and z coordinates of your first point, and you've rotated it. The signs of the numbers should have been properly preserved and produce the correct motion regardless of where your object is. I think.

I don't know if this is a very computationally efficient way to do it (matrices are probably better, but I know almost nothing about them ).

]]>Btw, one thing I did note that if a point is rotating about an axis, the point will always remain the distances from two points on the axis, even if those distances are not equal to eachother, the won't change.

Suppose we want to rotate a point (who's coordinates are x,y, and z) about the axis defined by the line connecting point1 and point2 (who's coordinates will be x1, y1, z1, x2, y2, z2 respectively)

We know the 3d distance from point1 and the point will not change, and that the 3d distance from point2 and the point will not change.

So distance1 = sqrt ((x1 - x)^2 + (y1 - y)^2 + (z1 - z)^2)

and distance2 = sqrt ((x2 - x)^2 + (y2-y)^2 + (z2 - z)^2)

Where distance1 and distance2 are the 3d distances from the point, to point1 and point2 respectively, before the rotation is made and the points coordinates are known.

That gives us two equations about the points. So I suppose if we know at least one of the coordinates of the point we should be able to calculate the remaining two coordinates to define its new location. I suppose this one coordinate must somehow be determined by the desired angle of rotation.

]]>You can calculate the angle that your line makes with the horizontal from the slope. Say D is the distance between point1 and point2. Dy = rise of slope, Dx = run of slope. So,

∠β = arcsin (Dy / D).

The plane of rotation is perpendicular to this angle. So, to get the angle that the plane of rotation makes with the x/y plane, you just add π/2: ∠Z = β + π/2

This lets you find the z component: Lz = L sin ∠Z

For Lx and Ly, we need to drop a perpendicular from the high end of L. The top angle here is (π/2 - ∠Z) = ∠θ. This forms a triangle on the "ground", with hypotenuse given by H = sqrt( L² - Lz² ).

Now, Lx = H sin θ

and Ly = H cos θ

We're done! In summary,

r = 3d distance formula

ω = angular velocity of point (rate of rotation, radians/sec)

n = 2π / ω

L = 2πr sin (π/n)

And the rest, from this post. (Man, I'm lazy. Too lazy to summarize.)

]]>You want the point to travel in a circle, so my intuition tells me to use the circular functions.

Define the rate of rotation as radians per unit time. Let ω = rate of rotation.

Let n = number of ω's per circle = 2pi/ω

r = radius of circle = found by distance formula (sorry I'm too lazy to do this for you )

R1 = radius from center to original point

R2 = radius to translated point

Length L that point travels per unit time: L = 2*r*pi * sin (pi/n)

R1, L, and R2 form a triangle.

L is a vector quantity, so you can find its components using vector arithmetic. To do this, I'll first define my axes. I'll put x and y on the horizontal plane, and z on the vertical (altitude). I'll also call the components of the vector Lx, Ly, and Lz.

Imagine viewing the system from directly overhead, so the z component is entirely suppressed. Now, vectors can be freely repositioned as long as their magnitude and direction are not altered. So, we'll put the corner of R1 and L at the origin.

Drop a perpendicular to the x-axis, and you have a right triangle, the legs of which are Lx and Ly. We know all of the angles of the triangle (R1 L R2) -- one is ω, and the other two are (π/2 - ω). All we need is the angle that L makes with the x (or y) axis, and the problem is solved.

But, I can't think of a way to find it right now, and I need to go to bed. Later maybe, or someone else can find it. Or you

]]>I really need to get some books on 3d linear algebra. :-/

]]>