Coordinate transformations question

In summary, the conversation discusses the struggle of determining new coordinates for a cube in a global coordinate system after it has been rotated at an arbitrary position. The angles between the local and global axes, represented by α, β, and γ, are used to define the new coordinates. The use of Euler angles is suggested to accurately determine the new coordinates, and equations are provided for computing the new absolute coordinates based on the cube's direction of travel and distance. The conversation also addresses the ambiguity of defining the orientation of a local coordinate system using angles from the absolute axis. Finally, the conversation concludes with a discussion on converting known angles δ, ε, and ζ to the Euler angles α, β, and γ, and the conventions used for Euler
  • #1
danhumphreys
3
0
Hi all,

I've been struggling with this for a couple of days now and am positing a question in the hope that someone can help me out.

I have a global cartesian coordinate system X, Y, Z and a cube with it's centre at (0,0,0) and dimension 1. Hence it's corners are: (0.5, -0.5, 0.5), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (0.5, -0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (0.5, 0.5, -0.5).

The cube is now at an arbitrary position where it's local axes are defined such that local axis x is oriented at angle [tex]\alpha[/tex] to global axis X, local axis y is oriented at angle [tex]\beta[/tex] to global axis Y, and local axis z is oriented [tex]\gamma[/tex] to global axis Z.

How can I determine the new cube coordinates in X, Y, Z? The angles [tex]\alpha[/tex], [tex]\beta[/tex] and [tex]\gamma[/tex] are not the same as the Euler angles, they define the position of the local axes relative to the global ones.

Any help would be very much appreciated.

Dan
 
Physics news on Phys.org
  • #2
danhumphreys said:
The cube is now at an arbitrary position where it's local axes are defined such that local axis x is oriented at angle [tex]\alpha[/tex] to global axis X, local axis y is oriented at angle [tex]\beta[/tex] to global axis Y, and local axis z is oriented [tex]\gamma[/tex] to global axis Z.

This does not make any sense. You must mean angles of rotaton around the X, Y and Z axis or from the vertical, horizontal planes.

danhumphreys said:
How can I determine the new cube coordinates in X, Y, Z? The angles [tex]\alpha[/tex], [tex]\beta[/tex] and [tex]\gamma[/tex] are not the same as the Euler angles, they define the position of the local axes relative to the global ones.

I think Euler angles is precisely what you mean and use.

Anyway, here are some equations for computing the new absolute coordinates of a given point in space after translating it a given distance 'M' in a given (α, β, γ) / (heading, elevation, roll) absolute direction.

It's been a long time and I remember I once made a typo writing the doc these came from. Please check they work correctly.

Forward
current x +cos(β)·sin(α)·M
current y +sin(β)·M
current z -cos(β)·cos(α)·M

Backward
current x -cos(β)·sin(α)·M
current y -sin(β)·M
current z +cos(β)·cos(α)·M

Upward
current x -[cos(α)·sin(γ)+sin(α)·cos(γ)·sin(β)]·M
current y +cos(γ)·cos(β)·M
current z +[cos(α)·cos(γ)·sin(β)-sin(α)·sin(γ)]·M

Downward
current x +[cos(α)·sin(γ)+sin(α)·cos(γ)·sin(β)]·M
current y -cos(γ)·cos(β)·M
current z -[cos(α)·cos(γ)·sin(β)-sin(α)·sin(γ)]·M

To the left
current x +[cos(α)·cos(γ)-sin(α)·sin(γ)·sin(β)]·M
current y +sin(γ)·cos(β)·M
current z +[cos(α)·sin(γ)·sin(β)+sin(α)·cos(γ)]·M

To the right
current x -[cos(α)·cos(γ)-sin(α)·sin(γ)·sin(β)]·M
current y -sin(γ)·cos(β)·M
current z -[cos(α)·sin(γ)·sin(β)+sin(α)·cos(γ)]·M


Alternatively, if you know the cube's arbitrary new position beforehand and you don't need to compute it from a direction and travel distance, you can simply move your cube to that position (by adding the new absolute position to all your cube's tips' relative positions) then apply rotations to the points, using their initial relative positions (XI,YI,ZI) from the centre of the cube so that you rotate the cube around its centre.

Code:
[FONT="Courier New"]
v1 = calf*xi+salf*zi;
v2 = calf*zi-salf*xi;
v3 = cbet*yi+sbet*v2;

zr = cbet*v2-sbet*yi;
xr = cgam*v1+sgam*v3;
yr = cgam*v3-sgam*v1;[/FONT]

I've been told these can be written down more efficiently using matrices. I dislike matrices.

salf = [tex]\sin(\alpha)[/tex];
calf = [tex]\cos(\alpha)[/tex];

etc.

These are global buffers for the sinus and cosinus values of the three Euler angles.

v1, v2, v3 are local value buffers, so you don't compute stuff twice.

You obtain new, rotated coordinates (XR,YR,ZR). Which you add to the absolute position of the cube's centre to get the absolute positions of the rotated cube's tips.
 
Last edited:
  • #3
Hi SonyAD,

Thanks for the reply.

I should have made it clearer in my post that I am only considering rotation about the centre of the cube (to begin with).

The Euler angles are defined in this picture here:

http://en.wikipedia.org/wiki/File:Eulerangles.svg

But in my example I've defined [tex]\alpha[/tex], [tex]\beta[/tex] and [tex]\gamma[/tex] as the angles between the local and global axes, i.e. the angles between x and X, y and Y and z and Z respectively. As per the angles defined on this picture:

http://en.wikipedia.org/wiki/File:Change_of_axes.svg

I am not really interested in how the cube is rotated to get to the new position but how I might define the new coordinates as a function of the angles between the global and local axes.

Dan
 
  • #4
Still doesn't make any sense. There are an infinite number of local coordinate systems whose X', Y' and Z' axis form given α, β and γ angles with the actual X, Y and Z axis.

That is the reason why Euler angles, who can uniquely and unambiguously define any possible orientation of an object or local coordinate system, are defined as angles of rotation around the Y, X and Z axis and NOT as angles from the absolute X, Y and Z axis of the local coordinate system's X', Y' and Z' axis.

Ok, I'm wrong. Not an infinite number:

Let α, β and γ be the Euler angles that describe the orientation of the local coordinate system vis-a-vis the absolute coordinate system.

Let δ, ε and ζ the angles between Z' and Z, X' and X and Y' and Y.

What we would then have is:

arccos( cos(α) · cos(β) ) = δ
arccos( cos(α) · cos(γ) ) = ε
arccos( cos(β) · cos(γ) ) = ζ

cos(α) · cos(β) = cos(δ)
cos(α) · cos(γ) = cos(ε)
cos(β) · cos(γ) = cos(ζ)

cos(β) = cos(δ) / cos(α)
cos(α) · cos(γ) = cos(ε)
cos(δ) / cos(α) · cos(γ) = cos(ζ)

cos(γ) = cos(ε) / cos(α)
cos(δ) / cos(α) · cos(ε) / cos(α) = cos(ζ)

( cos(δ) · cos(ε) ) / cos(α)2 = cos(ζ)

( cos(δ) · cos(ε) ) / cos(ζ) = cos(α)2

[tex]\alpha = \arccos \sqrt{ \frac{\cos(\delta) \cdot \cos(\epsilon)}{\cos(\zeta)} } [/tex]
 
Last edited:
  • #5
Hey SonyAD,

Thanks for updating your post. What you have given me now allows me to convert δ, ε and ζ (which I know) to Euler angles α, β and γ (which I don't know). Once I know the Euler angles, I can then apply an Euler rotation matrix to the angles to determine my new coordinates.

Just a couple of questions:

1. Where did you get your theory from?

2. What convention are your Euler angles α, β and γ? There are 12 possible conventions i.e. zyz, xyx, xzx etc. etc.

Dan
 
  • #6
danhumphreys said:
Hey SonyAD,

Thanks for updating your post. What you have given me now allows me to convert δ, ε and ζ (which I know) to Euler angles α, β and γ (which I don't know). Once I know the Euler angles, I can then apply an Euler rotation matrix to the angles to determine my new coordinates.

Just a couple of questions:

1. Where did you get your theory from?

2. What convention are your Euler angles α, β and γ? There are 12 possible conventions i.e. zyz, xyx, xzx etc. etc.

Dan

1. I deduced it. If you can, please check that it works properly.

It seemed self evident that the angle between Z and Z' is going to be influenced by the Euler angle α of rotation around the Y axis (heading) and the Euler angle β of rotation around the transformed X' axis (elevation).

You can think of α and β as longitude and latitude on a globe. As such, the Z axis would point to the Prime/Greenwich meridian at the Ecuator, south of Ghana and west of Gabon in the Atlantic, from the centre of the globe.

Then δ would be the angle between this place and the point indicated by α longitude and β latitude. So it follows intuitively that δ would be arccos( cos(α) · cos(β) ). The γ angle being the angle of rotation around the transformed (by α and β) Z' axis, it is not going to impact the angle between the transformed Z' axis and the original Z axis.

However, as you said, it does matter if you first apply the heading or longitude and then the elevation or latitude or vice versa. If you do it the other way around you'll have the 'poles' on the Ecuator and the same set of coordinates point to a different place.

However, even though the same longitude and latitude can point to different places on the globe (according to the order in which you apply the rotation transformations around YXZ or XYZ), the angle from those two different places to 0°, 0° will be the same (arccos( cos(α) · cos(β) ) versus arccos( cos(β) · cos(α) )).

This is reflected in the solution:

[tex]\alpha = \arccos \sqrt{ \frac{\cos(\delta) \cdot \cos(\epsilon)}{\cos(\zeta)} } [/tex]

There are two different solution sets for α, β and γ according to δ, ε and ζ.

The γ angle being the angle of rotation around the transformed Z' axis, it is not going to influence the δ angle between Z and Z'.

Just as δ, the angle between Z' and Z, is unaffected by the γ angle around Z', so too ε, the angle between X' and X, is unaffected by the β angle around X' and ζ, the angle between Y' and Y, is unaffected by the α angle around Y (not Y' because rotation around Y axis is the first rotation to be performed so Y transforms the other axis before they transform it).

We already know the order of the Euler rotations makes no difference as to the δ, ε and ζ angles.

2. α is the angle around the Y axis, β is the angle around the X axis and γ is the angle around the Z axis. Heading, elevation, roll.

What do you need this for?
 

Related to Coordinate transformations question

1. What is a coordinate transformation?

A coordinate transformation is a mathematical process used to convert the coordinates of a point from one coordinate system to another. This is often necessary when working with different maps or coordinate systems, such as converting from latitude and longitude to UTM coordinates.

2. Why are coordinate transformations important?

Coordinate transformations are important because they allow us to accurately represent locations on different maps or coordinate systems. They also allow us to perform calculations and analysis across different coordinate systems, which is essential in many scientific fields.

3. How do you perform a coordinate transformation?

There are various methods for performing a coordinate transformation, but they all involve using a set of equations or algorithms to convert the coordinates. This can be done manually using mathematical formulas, or with the help of software programs or GIS tools.

4. What are some common coordinate systems used in coordinate transformations?

Some common coordinate systems used in coordinate transformations include latitude and longitude, UTM (Universal Transverse Mercator), State Plane Coordinate System, and Lambert Conformal Conic. The specific coordinate system used will depend on the location and purpose of the transformation.

5. What are some potential sources of error in coordinate transformations?

There are several potential sources of error in coordinate transformations, including inaccurate input coordinates, incorrect equations or algorithms, and limitations of the coordinate system being used. It is important to carefully select the appropriate transformation method and double-check the results to minimize these errors.

Similar threads

  • Nuclear Engineering
Replies
1
Views
1K
Replies
2
Views
299
  • Differential Geometry
Replies
9
Views
439
  • Special and General Relativity
Replies
16
Views
2K
Replies
6
Views
2K
Replies
40
Views
2K
  • Special and General Relativity
Replies
9
Views
192
  • Differential Equations
Replies
2
Views
2K
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
828
Back
Top