MATLAB: Local to global co-ordinate system

co-ordinate systemslocal to global conversionloopsMATLAB

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.

Best Answer

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)