How to calculate the center of rotation and transformation given two bodies in planar space, of which the coordinates are known?

11 次查看(过去 30 天)
Hi All,
Im stuck on the following:
A body with three known point on it rotates and translates in space. At t=0 the points on the body are A = [x_a0 y_a0], B = [x_b0 y_b0] and C = [x_c0 y_c0] and at t= 1 A = [x_a1 y_a1], B = [x_b1 y_b1] and C = [x_c1 y_c1].
How do I calculate the rotation and center of rotation from this?
Thanks in advance

回答(1 个)

Nihal
Nihal 2024-4-25
To calculate the rotation and the center of rotation given the positions of three points on a body at two different times, you can use a method that involves linear algebra and geometric considerations. The process can be broken down into several steps:
  1. Translation: First, determine if there's a pure translation component by checking if the centroid of the triangle formed by the points at (t=0) moves to the centroid of the triangle at (t=1). The centroid at each time can be calculated as the average of the coordinates of the three points.
  2. Rotation: After accounting for any translation, you can focus on determining the rotation. The rotation can be found by calculating the angle between corresponding line segments from the two triangles (from (t=0) to (t=1)).
  3. Center of Rotation: This is more complex to determine analytically in a general 2D case and might not be necessary if you're only interested in the rotation angle. However, if needed, you can infer it geometrically from the intersection of perpendicular bisectors of the segments connecting corresponding points before and after the transformation, assuming the rotation is not 180 degrees (which makes the center of rotation ambiguous).
Let's go through a simplified approach to calculate the rotation angle and attempt to infer the center of rotation:
Step 1: Translation
Calculate the centroids at (t=0) and (t=1):
The translation vector () from (t=0) to (t=1) for the centroids is:
Step 2: Rotation
To simplify, let's assume we've compensated for the translation, focusing on rotation. Choose a pair of points (e.g., A and B) and calculate the angle between the line segment (AB) at (t=0) and (t=1). One way to calculate the angle (\theta) between two vectors is by using the dot product:
Where ) and similarly for ().
Step 3: Center of Rotation
Determining the exact center of rotation analytically in 2D from just the positions at two instances can be complex due to the infinite number of possible solutions (e.g., different rotations and translations can result in the same final positions). However, for many practical purposes, especially in computer graphics or kinematics, the rotation is often considered around the centroid, or the problem is simplified to rotations without translation by moving the centroid to the origin before calculating rotations.
If the rotation is small or can be approximated linearly, and you've corrected for translation by moving the centroid to the origin, then you could assume the center of rotation is at or near this centroid. For more complex scenarios, or if precise calculation of the center is critical, you may need to employ numerical methods or more advanced geometric analysis based on the specific constraints of your problem.

类别

Help CenterFile Exchange 中查找有关 3-D Scene Control 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by