Force axis while finding optimal rotation using singular value decomposition?

297 Views Asked by At

I'm using the method from here to obtain a transformation matrix with optimal rotations given two sets of 3D points: http://nghiaho.com/?page_id=671

So far so good. I can extract Euler angles from this matrix, RotX, RotY and RotZ.

But what if I want to force a specific rotation axis, for example RotX=50 degrees, but still using SVD to find optimal/best possible rotations around Y and Z (with the aim to minimize point distance errors, RMSE)? Is that possible and how to modify SVD function in that case. I'm using SVD for PHP: https://github.com/d3veloper/SVD/blob/master/svd.php