108 |
|
RotMat3x3d rot = RotMat3x3d::identity(); // initalize rot as a unit matrix |
109 |
|
|
110 |
|
// use a small angle aproximation for sin and cosine |
111 |
< |
|
111 |
> |
/* |
112 |
|
angleSqr = angle * angle; |
113 |
|
angleSqrOver4 = angleSqr / 4.0; |
114 |
|
top = 1.0 - angleSqrOver4; |
116 |
|
|
117 |
|
cosAngle = top / bottom; |
118 |
|
sinAngle = angle / bottom; |
119 |
< |
|
119 |
> |
*/ |
120 |
|
// or don't use the small angle approximation: |
121 |
< |
//cosAngle = cos(angle); |
122 |
< |
//sinAngle = sin(angle); |
121 |
> |
cosAngle = cos(angle); |
122 |
> |
sinAngle = sin(angle); |
123 |
> |
|
124 |
|
rot(axes1, axes1) = cosAngle; |
125 |
|
rot(axes2, axes2) = cosAngle; |
126 |
|
|