Go to the source code of this file.
Macros | |
#define | VERDICT_EXPORTS |
Functions | |
VerdictVector | interpolate (const double param, const VerdictVector &v1, const VerdictVector &v2) |
VerdictVector | vectorRotate (const double angle, const VerdictVector &normalAxis, const VerdictVector &referenceAxis) |
Variables | |
const double | TWO_VERDICT_PI = 2.0 * VERDICT_PI |
#define VERDICT_EXPORTS |
Definition at line 23 of file VerdictVector.cpp.
VerdictVector interpolate | ( | const double | param, |
const VerdictVector & | v1, | ||
const VerdictVector & | v2 | ||
) |
Definition at line 98 of file VerdictVector.cpp.
99 {
100 VerdictVector temp = ( 1.0 - param ) * v1;
101 temp += param * v2;
102 return temp;
103 }
VerdictVector vectorRotate | ( | const double | angle, |
const VerdictVector & | normalAxis, | ||
const VerdictVector & | referenceAxis | ||
) |
Definition at line 225 of file VerdictVector.cpp.
226 {
227 // A new coordinate system is created with the xy plane corresponding
228 // to the plane normal to the normal axis, and the x axis corresponding to
229 // the projection of the reference axis onto the normal plane. The normal
230 // plane is the tangent plane at the root point. A unit vector is
231 // constructed along the local x axis and then rotated by the given
232 // ccw angle to form the new point. The new point, then is a unit
233 // distance from the global origin in the tangent plane.
234
235 double x, y;
236
237 // project a unit distance from root along reference axis
238
239 VerdictVector yAxis = normalAxis * referenceAxis;
240 VerdictVector xAxis = yAxis * normalAxis;
241 yAxis.normalize();
242 xAxis.normalize();
243
244 x = cos( angle );
245 y = sin( angle );
246
247 xAxis *= x;
248 yAxis *= y;
249 return VerdictVector( xAxis + yAxis );
250 }
References moab::angle(), and VerdictVector::normalize().
const double TWO_VERDICT_PI = 2.0 * VERDICT_PI |
Definition at line 34 of file VerdictVector.cpp.
Referenced by VerdictVector::scale_angle(), VerdictVector::vector_angle(), VerdictVector::vector_angle_quick(), and VerdictVector::xy_to_rtheta().