Getting a plane to be perpendicular to the Z axis.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a collection of about 500 points which lie roughly along a plane. I need to rotate the plane fit of this data to lie perpendicular to the Z axis. I can't seem get the plane any flatter than a slope of ~ 7*10^-3
Currently I am crossing the normal vector of the plane with [0,0,1] to find an axis of rotation. Then asin of the magnitude of the cross product to find the angle to rotate. Then put the angle and axis into a rotation matrix from wikipedia ( http://en.wikipedia.org/wiki/Rotation_matrix the one labeled "Rotation matrix from axis and angle") and multiply my points in.
I have tried using format long and a "trig-free" method of replacing the trig functions in the rotation matrix with their actual terms so as to avoid any error in the asin function. Both of these things made no difference.
any insight as to how to get the plane flat would be appreciated. I need it to have a slope of <10^-6.
2 Kommentare
Antworten (1)
Jan
am 30 Jul. 2013
ASIN and ACOS are numerical instable at some locations, such that accurate measurements of angles are expected by ATAN2 only. See http://www.mathworks.de/matlabcentral/newsreader/view_thread/151925
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!