Local to global co-ordinate system
2 ビュー (過去 30 日間)
古いコメントを表示
Hey guys, As part of my work I have a body travelling in a circular path with a local co-ordinate system located at the center of the body. I want to trace a the path of the body from a point outside the body (i.e., convert the local co-ordinates to global co-ordinates) I intend to plot this path from the global co-ordinate system center.
Thanking you for all you help.
0 件のコメント
採用された回答
Iain
2013 年 8 月 21 日
So you have a body travelling in a circle, which is fixed at coordinates (0,0) in body axes, and you want to translate those co-ordinates into global co-ordinates?
Step 1: Define an actual, fixed axis set, centred somewhere sensible - eg. the centre of the circle.
Step 2: Calculate the position in THAT axis set.
x = Radius * cos(time*angular_rate);
y = Radius * sin(time*angular_rate);
Step 3: Translate that position to the actually desired axis set:
x = x + 500;
y = y + 205;
Step 4: Plot it:
plot(x,y)
3 件のコメント
Iain
2013 年 8 月 21 日
Step 1 is something you need to do.
I think you need three axis sets:
Axis set 0 = Body axis set. (e.g. where a car is) Axis set 1 = A fixed axis set which is convenient to use. (e.g. what point the car is turning around) Axis set 2 = "Global axis set", which is defined as having an origin in a fixed place (e.g. the corner of the car park that the car is turning inside)
Step 2 - You have a circular motion, this would imply that the circle has a Radius. (the radius of the car's turning circle)
Step 3 - Since the car's position relative to the centre of the circle it's turning around isn't what you want, you need to translate that axis set to the correct axis set. This is done by adding the appropriate offsets to the coordinates. I randomly chose 500 and 205.
Who is Lain?
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!