File Exchange

image thumbnail

3D Rotations

version (7.16 KB) by Giampiero Campa
3D Space Coordinate Transformations


Updated 12 May 2005

View License

3D Space Coordinate Transformations

This folder contains 3 files (m-functions) :

- t2x.m Transformation Matrix to Generalized Position Vector.
- x2t.m Generalized Position Vector to Transformation Matrix.
- m2m.m Mass/Inertia Tensor transformation with coordinate change.

In the Generalized Position Vector the orientation can be expressed with:
- unit quaternion,
- Euler angles xyz (roll, pitch, and yaw),
- Euler angles zyz (rotation, precession, and mutation),
- unit vector and rotation angle,
- Denavitt-Hartemberg parameters.
Conversion between the above orientation systems can be easily achieved.

The three files work independently on each other, but since they work
on the same objects it is somewhat useful to keep them in the same folder.

For more detailed information see the help texts of the three functions.

January 2001

Cite As

Giampiero Campa (2019). 3D Rotations (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

gdfg sdgsd

Laurent SIMON

Errr... whatever the T matrix I enter, in roll-pitch-yaw mode, the roll is ALWAYS equal to pi/2... ?

jate sri

Mugabo Gustave

Gianluigi Baldesi

Lakshmi Ranganathan

the version is excellent can be made more user friendly

xhienna ver

hey can you do vector / coordinate transformation too? mmm input ax ay az then show 3d of its cartesian plot and cylindrical and spherical.. really need to know how to do it. its a homework for my class. thanks.:)

Chaim Cohen

Well done and easy to use.

Thang Do tran

Hank Jones

I changed the function names to make them more descriptive, but the coding was well-done and the documentation is clear. Thanks, Giampy!

Lina Chang


yang guoan


Removed dir structure from zip file

Renamed everything lowercase

Changed the file exchange category

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux