Home > FR3DSource > zAxisAngle.m

# zAxisAngle

## PURPOSE zAxisAngle(R) computes the axis and angle of rotation in an orthogonal

## SYNOPSIS function [axis, angle] = zAxisAngle(R)

## DESCRIPTION ``` zAxisAngle(R) computes the axis and angle of rotation in an orthogonal
matrix R, then makes the axis point up and the angle be between -90 and 270
degrees```

## CROSS-REFERENCE INFORMATION This function calls:
This function is called by:
• zAnalyzePair zAnalyzePair(N1,N2,CL) computes distances, angles, and classification

## SOURCE CODE ```0001 % zAxisAngle(R) computes the axis and angle of rotation in an orthogonal
0002 % matrix R, then makes the axis point up and the angle be between -90 and 270
0003 % degrees
0004
0005
0006 function [axis, angle] = zAxisAngle(R)
0007
0008 [axis, angle] = zAxisAngleRadians(R);
0009
0010 angle = angle*57.29577951308232;
0011
0012 if axis(3) < 0,                   % make axis point up
0013   axis = -axis;
0014   angle = -angle;
0015 end
0016
0017 if angle < -90,              % make angles be between -90 and 270 degrees
0018   angle = angle + 360;
0019 end
0020```

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003