Answer the question
In order to leave comments, you need to log in
How to implement this rotation?
Good afternoon.
Tell me, the implementation of this movement (see figure):
1) Rotation of point A counterclockwise. Coordinates start (0, 0)
2) Rotation of point B counterclockwise. Point A is the origin.
I tried to implement this rotation using matrices. All is well only as long as the point is at rest. I did it according to the formula T ^-1 R T. (shift to 0, rotate, return). When point A starts rotating, in this implementation, it is clearly not what it should be. Although I'm not sure. Because I can’t mathematically substantiate what kind of movement will be as a result of these transformations.
The question is the following. Did I start right? (with displacement, rotation, return)
Or is it a more complex problem from the field of mechanics?
Is there an implementation in js?
Answer the question
In order to leave comments, you need to log in
Use oCanvas . The example from the main page is very similar to your task.
Yes, it seems simple - rotation around the center, whose coordinates move in a circular orbit.
If you do matrices, then it seems like you need to multiply in the order of displacement-rotation.
And if implemented with improvised means, then I prefer to move the coordinate system jsfiddle.net/4e4xtLng/1
Let R a and R b be the rotation matrices of point A with respect to O and B with respect to A. C is an arbitrary point of the object whose movement is specified by points A and B. Then the rotation of point C will look like this:
С' = R a ×A + R b ×(C-A)
Accordingly, movement of point A:
A' = R a ×A
Movement of point B:
B' = R a ×A+R b ×(BA)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question