Local to global co-ordinate system

1 view (last 30 days)
James
James on 21 Aug 2013
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.

Accepted Answer

Iain
Iain on 21 Aug 2013
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 Comments
Iain
Iain on 21 Aug 2013
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?
James
James on 21 Aug 2013
Thanks for replying. I think I am able to understand it all. I will go play with this in matlab and see where it gets me.
Thank you for all your help.
P.S. Sorry, I meant to say Iain.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!