Getting a plane to be perpendicular to the Z axis.
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Jan
2013년 7월 30일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!