I have a rigid body that translates and/or rotates about an axis perpendicular to the screen. I have co-ordinates of four points on the rigid body. How can I get the co-ordinates of a unknown point on the rigid body?
Can I form a linear equation with four known points to get the fifth unknown point? How to accommodate translation and rotation in the equation?
Any combination of rotation by θ about a point p and translation t' can be represented as a rotation by θ about the origin followed by a suitable translation t . So the problem becomes working out the value of θ and t from the known points. Then the transformation can be applied to the unknown point.
The easiest way to work, I think, is in homogeneous coordinates. With column vectors, rotation about the origin by θ is represented by the matrix M( θ ):
cos(θ) sin(θ) 0
-sin(θ) cos(θ) 0
0 0 1
Translation by t = ( tx , ty , 1) T is represented by the matrix T( t ):
1 0 tx
0 1 ty
0 0 1
The overall transformation is the product T( t )M( θ ). This needs to be solved for the three unknowns θ , tx , and ty . With four known points, there are eight equations (two for each point, corresponding to the x and y coordinates), so there's more than enough info to solve for the unknowns. It's just a matter of plugging in the values for the known points.
Since you have more points than is needed, you can use all of the points and solve the over-complete system to get a potentially more accurate transformation matrix (this is useful if you are not positive about the accuracy of the transformed coordinates).
In more details, you can can represent the transformation matrix as
a b c
-b a d
0 0 1
for some parameters a, b, and c (if you really need to, you can work out the angle and xy-translations from these a, b, and c). Then we have these two equations from each of the four points (x_i, y_i) and result (x_i', y_i'):
a x_i + b y_i + c = x_i'
a y_i + -b x_i + d = y_i'
Then you can rewrite the eight equations as a system of linear equations with variables (a, b, c, d) as follows (in matrix form):
x_1 y_1 1 0 x_1'
y_1 -x_1 0 1 a y_1'
x_2 y_2 1 0 b x_2'
y_2 -x_2 0 1 * c = y_2'
x_3 y_3 1 0 d x_3'
y_3 -x_3 0 1 y_3'
x_4 y_4 1 0 x_4'
y_4 -x_4 0 1 y_4'
or Ax = B, where A is the matrix on the left, x = [abcd]', and B = the vector on the right.
Now, decompose A using SVD to get UDV'. Then x can be found as VD -1 U'B, where D -1 is the inverse of the diagonal matrix D. For more information on SVD, look at Singular Valude Decomposition (SVD) .
Take two old points A, B (Line) with out loss of generality assume A is origin. Look at A' and B'. translate A' to A and corresponding translation to B' => b''. Find the angle and you have the effective translation and rotation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.