Coordinate transformation (global to local)

Hi all!

I just would like to make a coordinate transformation from points given in the global coordinate system to a local coordinate system (also defined in global CS by r and axes). Mathematically I would say:

Pglob = R * Ploc + t

with the rotation matrix R and the translation t.
R = {axes1, axes2, axes3};
t = r;

Ploc = invÂ® * (Pglob - t)

How do I translate this into AnyScript or is there even a defined class? The formulation:

AnyVec3 Ploc = Râ€™ * (Pglob - t)â€™;

Did not work for me.

Thanks a lot and I appreciate any help!
klabauterjunge

Dear Malte,

It will be easier for you if you can see the explanation of the â€˜AnyRefFrameâ€™ class in the AnyBody reference manual.

[i]Notice that AnyBodyâ„¢ stores all vectors in row format, so they must be transposed before the transformation and the expression must be turned around. In AnyScriptâ„¢ syntax this looks like

GlobalVector = (Axes * LocalVectorâ€™)â€™;

or

GlobalVector = LocalVector * Axesâ€™; [/i]