Getting a plane to be perpendicular to the Z axis.

조회 수: 2 (최근 30일)
Adam
Adam 2013년 7월 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
Walter Roberson
Walter Roberson 2013년 7월 30일
What is the maximum distance of points from the origin?
Adam
Adam 2013년 7월 30일
as of right now the plane is centered on the origin with z values of +/- 7*10^-4 and x y values of +/- 5*10^-2

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
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
  댓글 수: 1
Adam
Adam 2013년 7월 30일
getting the same results with atan2, however we got it flat doing a z rotation and then a y rotation instead of the arbitrary axis rotation. Very bizarre imo.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by