# Forum

### Author Topic: Align coordinate system to marker, point or camera  (Read 2275 times)

#### mcstieg

• Jr. Member
• Posts: 89
##### Align coordinate system to marker, point or camera
« on: December 24, 2019, 09:54:15 AM »
Hello,

I try to rotate a model a given amount of degrees around x and y axis.
The python script for rotation around any axis is already working.

The Problem is, that the second rotation will result in an unwanted change of the first angle.

Example:
- We have 3 given Markers on a flat surface. 1 & 2 are horizontal and position 3 is anywhere on the surface.
- We also know the real angle between markers 1-2 and 2-3 because we measured them ... -20 degrees and +30 degrees.

If I rotate -20 degrees around vertical axis, 1-2 are perfectly matching -20 degrees.
How can I rotate the model now to reach a +30 degree angle between 2-3?

Thanks a lot!!!!!

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 14943
##### Re: Align coordinate system to marker, point or camera
« Reply #1 on: December 25, 2019, 03:50:55 PM »
Hello mcsteig,

Do you mean that you would like to perform the rotation around any line that should be defined as a pair of markers?
Best regards,
Alexey Pasumansky,
Agisoft LLC

#### mcstieg

• Jr. Member
• Posts: 89
##### Re: Align coordinate system to marker, point or camera
« Reply #2 on: December 26, 2019, 12:13:17 AM »
Dear Alexey,

sounds like what I am looking for ...

#### mcstieg

• Jr. Member
• Posts: 89
##### Re: Align coordinate system to marker, point or camera
« Reply #3 on: December 28, 2019, 07:34:18 AM »
...if you have any information on how to calculate this - I would be very happy! Thank you!

Just found out how to calculate the rotation matrix for any axis and a given angle. Now I need to calculate the rotation angle only. But I think this should possible somehow.

Thank you!
« Last Edit: December 28, 2019, 10:05:46 AM by mcstieg »