VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
kinematicTools.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
11 #include "vrfutil/vrfutilDefines.h"
12 #include <math.h>
13 #include <errno.h>
14 #include <matrix/LibMatrix.h>
15 #include <vl/topoView.h>
16 #include <matrix/vlTaitBryan.h>
17 #include <matrix/3dBoundingVolume.h>
18 
19 #include <map>
20 
22 #include <boost/math/special_functions/fpclassify.hpp>
23 
24 #define DtSIGN(x) (((x) > (0.0)) ? (1.0) : (-1.0))
25 
26 #define DtALMOST(x, y, e) (((x)<=((y)+(e))) && ((x)>=((y)-(e))))
27 
28 #define DtGRAVITY_CONSTANT (9.81)
29 #define DtPI_OVER_TWO (1.570796327)
30 #define DtTWO_PI (6.283185307)
31 #define DtMETERS_TO_FEET (3.2808)
32 #define DtMETERS_PER_SEC_TO_MPH (2.23)
33 #define DtLN2 (0.693147181)
34 #define DtNM_2_METERS (1852.0)
35 
36 #define SIN(x) DtSin(x)
37 #define COS(x) DtCos(x)
38 #define TAN(x) DtTan(x)
39 
40 #define ASIN(x) DtAsin(x)
41 #define ACOS(x) DtAcos(x)
42 #define ATAN(x) DtAtan(x)
43 #define ATAN2(y, x) DtAtan2((y), (x))
44 
45 #define DtFRand() ((double) rand() / RAND_MAX)
46 #define DtIRandom(from, to) DtIntRandom(from, to)
47 
48 class DtGeodeticCoord;
49 class Coordinate_System;
50 class DtChord;
51 class DtExtent;
52 class DtLocalVector;
53 class DtLocalVertexList;
54 class DtListItem;
56 class DtPoint;
59 class DtVertexList;
60 
64 #define EARTH_RADIUS_AVERAGE 6367500.0
65 
66 
69 DT_DLL_vrfutil double gRand();
70 
74 DT_DLL_vrfutil double centralLimitGaussian(int numDraws);
75 
81 
82 DT_DLL_vrfutil void Dt3DKinematicsTick(const DtVector& Position,
83  const DtVector& LinearVelocity,
84  const DtVector& LinearAcceleration,
85  DtConstDcm orientation,
86  const DtVector& angVelocity,
87  const DtVector& angAcceleration,
88  double DeltaTime,
89  DtVectorRef newPosition,
90  DtVectorRef newVelocity,
91  DtDcm& newOrientation,
92  DtVectorRef newAngVelocity);
93 
94 DT_DLL_vrfutil void Dt3DDynamicsTick(const DtVector& LinearForce,
95  double vehicleMass,
96  DtVectorRef newLinearAcceleration,
97  const DtVector& torque,
98  DtConstDcm vehicleInertia,
99  DtVectorRef newAngAcceleration);
100 
101 DT_DLL_vrfutil void DtGravityForce(double mass,
102  DtVectorRef returnForce);
103 
104 DT_DLL_vrfutil void DtResolve(const DtVector& forcePos,
105  const DtVector& force,
106  DtVectorRef resultTorqueAboutOrigin);
107 
108 DT_DLL_vrfutil void DtParallelAxisTheorem(DtConstDcm inertiaInOriginalFrame,
109  double mass,
110  const DtVector& newToOriginal,
111  DtDcm& inertiaInNewFrame);
112 
113 DT_DLL_vrfutil void DtRotateInertia(DtDcm inertiaInOriginalFrame,
114  DtDcm originalToNew,
115  DtDcm& inertiaInNewFrame);
116 
117 DT_DLL_vrfutil double DtPIDServo(double error,
118  double errorIntegral,
119  double velocity,
120  double proportionalGain,
121  double integralGain,
122  double derivativeGain,
123  double biasForce = 0.0,
124  double* control = 0);
125 
142  const double deceleration, const double dt, const double ownSpeed,
143  const double distance, const double targetSpeed, const double errorDecelValue = -1e10);
144 
145 DT_DLL_vrfutil void DtBlockInertia(const double xLen,
146  const double yLen,
147  const double zLen,
148  const double mass,
149  DtDcm& inertia);
150 
151 DT_DLL_vrfutil bool DtVectorIsZero(const DtVector& v,
152  double tolerance = 0.0);
153 
154 DT_DLL_vrfutil void DtDcmFromColumns(DtDcm& result,
155  const DtVector& col1,
156  const DtVector& col2,
157  const DtVector& col3);
158 
159 DT_DLL_vrfutil void DtDcmFromRows(DtDcm& result,
160  const DtVector& row1,
161  const DtVector& row2,
162  const DtVector& row3);
163 
164 
165 
174 DT_DLL_vrfutil bool DtPointInCone(const DtVector& coneEndPosition,
175  const DtVector& coneAxis,
176  const double coneAngle,
177  const DtVector& testPoint,
178  double* testAnglePtr = 0);
179 
180 
181 DT_DLL_vrfutil bool DtPointInWedge(const DtVector& wedgeEndPosition,
182  const DtVector& wedgeAxis,
183  const double wedgeAngle,
184  const DtVector& testPoint);
185 
186 DT_DLL_vrfutil DtFloat64 DtFastDist(const DtVector& pt1, const DtVector& pt2);
187 
189 DT_DLL_vrfutil void DtVecLimit(DtVectorRef vec,
190  double limit);
191 
192 inline double DtVecMag(const DtVector& vec)
193 {
194  return sqrt(vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ]);
195 };
196 
197 inline double DtVecMagSquared(const DtVector& vec)
198 {
199  return vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ];
200 };
201 
202 DT_DLL_vrfutil void DtRotX(double angle, DtDcm& rotMat);
203 DT_DLL_vrfutil void DtRotY(double angle, DtDcm& rotMat);
204 DT_DLL_vrfutil void DtRotZ(double angle, DtDcm& rotMat);
205 DT_DLL_vrfutil void DtBodyToLocalRef_to_Euler(DtConstDcm body2ref, DtTaitBryan *e);
206 DT_DLL_vrfutil void DtEuler_to_BodyToLocalRef(const DtTaitBryan &euler, DtDcm& body2ref);
207 DT_DLL_vrfutil const DtDcm & enu2ned();
208 DT_DLL_vrfutil const DtDcm & ned2enu();
209 
210 DT_DLL_vrfutil void DtRotX2(double sinAng, double cosAng, DtDcm& rotMat);
211 DT_DLL_vrfutil void DtRotY2(double sinAng, double cosAng, DtDcm& rotMat);
212 DT_DLL_vrfutil void DtRotZ2(double sinAng, double cosAng, DtDcm& rotMat);
213 
216 DT_DLL_vrfutil void DtRotBodyX(double angle, DtDcm& rotMat);
217 DT_DLL_vrfutil void DtRotBodyY(double angle, DtDcm& rotMat);
218 DT_DLL_vrfutil void DtRotBodyZ(double angle, DtDcm& rotMat);
219 
221 {
222  public:
223  DtPoleFilterType(double freq);
224  void setPole(double freq);
225  void output(DtTaitBryan* input,
226  double dT,
227  DtTaitBryan* output);
228  void output(const DtVector& input,
229  double dT,
230  DtVectorRef output);
231  double output(double input,
232  double dT);
233 
234  double getPole() { return poleFreq; }
235  const DtVector& getPrevOutput() { return prevOutput; }
236 
237  private:
238  double poleFreq;
239  DtVector prevOutput;
240 };
245 {
246  public:
247  DtNonLinearOutputType(double nonlinearity,
248  double gain = 1.0)
249  {
250  DtGain = gain;
251  DtExponent = nonlinearity+1.0;
252  }
253 
254  void DtSetGain(double gain) { DtGain = gain; }
255  void DtSetNonLinearity(double nonlinearity) { DtExponent = nonlinearity+1.0; }
256 
257  double DtGetGain() { return DtGain; }
258  double DtGetNonLinearity() { return DtExponent-1.0; }
259  double DtOutput(double input)
260  {
261  return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
262  }
263 
264  private:
265  double DtGain;
266  double DtExponent;
267 
268 };
269 
270 DT_DLL_vrfutil void DtCircleVerts(double radius,
271  int npts,
272  double* xCoords,
273  double* yCoords);
274 
277 
278 
280 DT_DLL_vrfutil void DtSpacesToDashes(char* str);
281 
282 
287 DT_DLL_vrfutil char* DtGetFilenameExtension(char* fileName, char* extension);
288 
289 
296 // y is left
297 // z is up
300 // Y is forward
301 // z is up
302 
303 DT_DLL_vrfutil void DtOrientationFromThreePoints(const DtVector& leftPoint,
304  const DtVector& rightPoint,
305  const DtVector& rearPoint,
306  DtDcm& orientation,
307  bool yIsForward=false);
308 
310 DT_DLL_vrfutil void DtOrientationFromThreePointsAndHeading(const DtVector& leftPoint,
311  const DtVector& rightPoint,
312  const DtVector& otherPoint,
313  double cosHeading,
314  double sinHeading,
315  DtDcm& orientation,
316  bool upsideDown = false);
317 
319 DT_DLL_vrfutil void DtOrientationFromThreePointsAndHeading(const DtVector& leftPoint,
320  const DtVector& rightPoint, const DtVector& otherPoint, double heading,
321  const DtDcm& topoToLocal, DtDcm& orientation);
322 
323 
327 DT_DLL_vrfutil bool DtCalculateNormal(const DtVector& pointA,
328  const DtVector& pointB, const DtVector& pointC, DtVector& normal);
329 
330 
333 DT_DLL_vrfutil void DtCalculateOrientation(DtVector localNormal, double heading,
334  const DtDcm& topoToLocal, DtDcm& localOrientation);
335 
336 
337 DT_DLL_vrfutil double DtFindZInPlane(const double posx, const double posy,
338  const DtVector& pointInPlane, const DtVector& normal);
339 
344 DT_DLL_vrfutil DtVector DtIntersectLineWithPlane(const DtVector& point, const DtVector& direction,
345  const DtVector& pointInPlane, const DtVector& planeNormal,
346  bool* noIntersection = 0);
347 
352  const DtChord& chord, const DtVector& lower, const DtVector& upper,
353  DtVrfChordIntersectRecordList* intList = 0);
354 
358  const DtChord& chord,
359  const DtVector& p1, const DtVector& p2, const DtVector& p3,
360  DtVector* result = 0, double* t = 0);
361 
364  double x1, double y1, double x2, double y2,
365  double z11, double z21, double z12, double z22,
366  double x, double y);
367 
371  const DtChord& chord,
372  double x1, double y1, double x2, double y2,
373  double z11, double z21, double z12, double z22,
376  double tolerance = 1e-20);
377 
381  double heading, const DtVector& position, DtDcm& bodyToRef);
382 
388 DT_DLL_vrfutil void DtTopoEulerToBodyToLocal(const DtTaitBryan& topoEuler,
389  const Coordinate_System& coordSystem, const DtVector& localPosition,
390  DtDcm& bodyToLocalDcm);
391 
392 DT_DLL_vrfutil DtDcm DtRotZToBodyToLocal(const Coordinate_System& coordSystem, double angle,
393  const DtVector& position);
394 DT_DLL_vrfutil DtDcm DtRotYToBodyToLocal(const Coordinate_System& coordSystem, double angle,
395  const DtVector& position);
396 DT_DLL_vrfutil DtDcm DtRotXToBodyToLocal(const Coordinate_System& coordSystem, double angle,
397  const DtVector& position);
398 
401 DT_DLL_vrfutil double DtHeadingFromGeocAToGeocB(const DtVector& geocA, const DtVector& geocB);
402 
406 
407 
409 
410 DT_DLL_vrfutil double DtSin(double r);
411 
412 inline double DtCos(double r)
413 {
414  return DtSin(r + DtPI_OVER_TWO);
415 }
416 
417 DT_DLL_vrfutil double DtTan(double r);
418 DT_DLL_vrfutil double DtAsin(double x);
419 
420 inline double DtAcos(double x)
421 {
422  return DtPI_OVER_TWO + DtAsin(-x);
423 }
424 
425 DT_DLL_vrfutil double DtAtan(double x);
426 DT_DLL_vrfutil double DtAtan2(double y, double x);
427 
428 DT_DLL_vrfutil bool DtSameSign(double x, double y);
429 
430 DT_DLL_vrfutil bool DtPointInSegment(const DtVector& testPoint, const DtVector& segStart,
431  const DtVector& segEnd);
432 
433 /*******************************************************************************
439  *******************************************************************************/
440 
457 DT_DLL_vrfutil int DtIntersect2D_Segments( DtVector P0, DtVector P1, DtVector Q0,
458  DtVector Q1, DtVector* I0 = 0, DtVector* I1 = 0,
459  double* isectParam1 = 0, double *isectParam2 = 0,
460  bool* parallel = 0, bool* collinear = 0);
461 
468 DT_DLL_vrfutil bool DtInSegment( DtVector P, DtVector P0, DtVector P1);
469 
473 
476 DT_DLL_vrfutil DtVector localGravityAcceleration(const DtVector& localPosition,
477  const Coordinate_System& coordinateSystem);
478 
481 
482 DT_DLL_vrfutil double altitudeOfPosition(const DtVector& localPosition,
483  const Coordinate_System& coordinateSystem);
484 DT_DLL_vrfutil double altitudeOfPosition(const DtPoint& localPosition,
485  const Coordinate_System& coordinateSystem);
487 
490 
491 DT_DLL_vrfutil void setAltitudeOfPosition(DtVector& localPosition, double newAltitude,
492  const Coordinate_System& coordinateSystem);
493 DT_DLL_vrfutil void setAltitudeOfPosition(DtPoint& localPosition, double newAltitude,
494  const Coordinate_System& coordinateSystem);
496 
499 DT_DLL_vrfutil void adjustAltitudeOfPosition(DtVector& localPosition, double altitudeChange,
500  const Coordinate_System& coordinateSystem);
501 
507 
510 DT_DLL_vrfutil double headingAngleTo(const DtVector& observerPosition,
511  const DtVector& targetPosition, const Coordinate_System& coordinateSystem);
512 
515 DT_DLL_vrfutil double elevationAngleTo(const DtVector& observerPosition,
516  const DtVector& targetPosition, const Coordinate_System& coordinateSystem);
517 
520 DT_DLL_vrfutil double bankAngleTo(const DtVector& observerPosition,
521  const DtVector& targetPosition, const Coordinate_System& coordinateSystem);
522 
525 DT_DLL_vrfutil double distSquaredTo2D(const DtVector& position1, const DtVector& position2,
526  const Coordinate_System& coordinateSystem);
527 
551 DT_DLL_vrfutil bool inside(const DtVector& localPoint,
552  const DtLocalVertexList& localVertexList,
553  const Coordinate_System& coordinateSystem);
554 
557 DT_DLL_vrfutil bool inside(const DtVector& point,
558  const std::vector<DtVector>& boundary);
559 
560 DT_DLL_vrfutil bool insideEllipsoid(const DtVector& localPoint,
561  const DtLocalVertexList& localVertexList,
562  const Coordinate_System& coordinateSystem);
563 
564 
570 DT_DLL_vrfutil bool leftOf(const DtVector& localPoint,
571  const DtLocalVertexList& localVertexList,
572  const Coordinate_System& coordinateSystem);
573 
579 DT_DLL_vrfutil double headingAngleTo(const DtVector& localPoint,
580  const DtLocalVertexList& localVertexList,
581  const Coordinate_System& coordinateSystem);
582 
587 DT_DLL_vrfutil double elevationAngleTo(const DtVector& localPoint,
588  const DtLocalVertexList& localVertexList,
589  const Coordinate_System& coordinateSystem);
590 
597 DT_DLL_vrfutil double localDistSquaredTo(const DtVector& localPoint,
598  const DtLocalVertexList& localVertexList,
599  const Coordinate_System& coordinateSystem);
600 
605 DT_DLL_vrfutil double distSquaredTo2D(const DtVector& localPoint,
606  const DtLocalVertexList& localVertexList,
607  const Coordinate_System& coordinateSystem);
608 
618 DT_DLL_vrfutil double distToBoundingVolume(const DtVector& localBaseLocation,
619  const Dt3dBoundingVolume& box, const DtTaitBryan& boxToLocalOrientation,
620  const DtVector& testPoint);
621 
627 DT_DLL_vrfutil bool intersects(const DtVector& localPoint1,
628  const DtVector& localPoint2, const DtLocalVertexList& localVertexList,
629  const Coordinate_System& coordinateSystem);
630 
633 DT_DLL_vrfutil DtListItem* getClosestVertex2D(const DtVector& localPoint,
634  const DtLocalVertexList& localVertexList,
635  const Coordinate_System& coordinateSystem);
636 
640 DT_DLL_vrfutil bool getClosestLine2D(const DtVector& localPoint,
641  DtVector& localLinePt1, DtVector& localLinePt2,
642  const DtLocalVertexList& localVertexList,
643  const Coordinate_System& coordinateSystem);
644 
649 DT_DLL_vrfutil double distanceSquaredPointToLine2D(const DtVector& localPoint,
650  const DtVector& localLinePt1, const DtVector& localLinePt2,
651  const Coordinate_System& coordinateSystem);
652 
655 DT_DLL_vrfutil double distanceSquaredPointToLineTopographic(const DtVector& topoPoint,
656  const DtVector& topoLinePt1, const DtVector & topoLinePoint2);
657 
661 DT_DLL_vrfutil double distanceSquaredPointToPoint2D(const DtVector& localLinePt1,
662  const DtVector& localLinePt2, const Coordinate_System& coordinateSystem);
663 
669 DT_DLL_vrfutil double closestPointAlongChord2D( const DtPoint& chordStart,
670  const DtPoint& chordEnd,
671  const DtPoint& testPoint, DtPoint & closestPoint,
672  const Coordinate_System& coordSys);
673 
687  const DtVector& point, const Coordinate_System& coordinateSystem,
688  DtLocalVectorIterator& localVertexIterator);
689 
694  const DtVector& point, const DtLocalVertexList& vertices,
695  int startingIndex, bool reverseDirection,
696  const Coordinate_System& coordinateSystem);
697 
706 
707 inline double dotProd2D(const DtVector& v1, const DtVector& v2)
708 {
709  return v1[0]*v2[0] + v1[1]*v2[1];
710 }
711 
712 inline double magnitudeSquared2D(const DtVector &v)
713 {
714  return dotProd2D(v, v);
715 }
716 
717 inline double crossProduct2D(const DtVector& v1, const DtVector& v2)
718 {
719  return v1[0]*v2[1] - v1[1]*v2[0];
720 }
721 
722 inline DtVector rotateRight2D(const DtVector& v)
723 {
724  DtVector res(v[1], -v[0], v[2]);
725  return res;
726 }
727 
728 inline void normalize2D(DtVector& v)
729 {
730  double length = sqrt(magnitudeSquared2D(v));
731  if (length > 0.0)
732  {
733  v[0] /= length;
734  v[1] /= length;
735  }
736 }
737 
739 inline double vectorAngle2D(DtVector& v)
740 {
741  return DtModPerLo(atan2(v[1], v[0]), -M_PI, M_PI);
742 }
746 
758 DT_DLL_vrfutil void localVectorToGeocentricVector(const DtVector &geocentricPosition,
759  const DtVector& localVector, const Coordinate_System& coordinateSystem,
760  DtVector& geocentricVector);
761 
773 DT_DLL_vrfutil void localOrientationToGeocentricOrientation(const DtVector geocentricPosition,
774  const DtTaitBryan& localOrientation,
775  const Coordinate_System& coordinateSystem,
776  DtTaitBryan& geocentricOrientation);
777 
782  const DtDcm& newOrientation,
783  const DtDcm& oldOrientation, double dT);
784 
787 DT_DLL_vrfutil double calculateSpeedForArrival(double distance, double currentSpeed, double acceleration,
788  double deceleration, double timeToArrive);
789 
800 DT_DLL_vrfutil void geocentricVectorToLocalVector(const DtVector &geocentricPosition,
801  const DtVector& geocentricVector, const Coordinate_System& coordinateSystem,
802  DtVector& localVector);
803 
816  const DtVector& geocentricPosition,
817  const DtTaitBryan& geocentricOrientation,
818  const Coordinate_System& coordinateSystem,
819  DtTaitBryan& localOrientation);
820 
822 DT_DLL_vrfutil int DtIntRandom(int iFrom, int iTo);
823 
825 DT_DLL_vrfutil bool DtIsValidNumber(double x);
826 
829 DT_DLL_vrfutil double DtHoursMinutesSeconds2Seconds(double hours, double minutes, double seconds);
830 
832 DT_DLL_vrfutil void DtSeconds2HoursMinutesSeconds(double totalSeconds, int& hoursOut,
833  int& minutesOut, double& secondsOut);
834 
836 DT_DLL_vrfutil unsigned int DtVRFGetThreadId();
837 
839 DT_DLL_vrfutil double calculateLengthOfLine(const std::vector<DtVector>& points);
840 
843 DT_DLL_vrfutil double calculateLengthOfLine(const Coordinate_System& coordinateSystem, const std::vector<DtVector>& points);
844 
847 DT_DLL_vrfutil void calculateLengthAndWidthOfShape(const Coordinate_System& coordSytem, const std::vector<DtVector>& points,
848  double& length, double& width);
849 
851 DT_DLL_vrfutil void calculateLengthAndWidthOfShape(const std::vector<DtVector>& points,
852  double& length, double& width);
853 
854 DT_DLL_vrfutil DtVector DtPoint2DtVector(const DtPoint& p);
855 DT_DLL_vrfutil DtPoint DtVector2DtPoint(const DtVector& p);
856 
861 DT_DLL_vrfutil DtVector calculateWorldVelocityFromPosition(const DtVector & currentWorldPos,
862  const DtVector & currentLocalPos, const DtVector & localVelocity,
863  const Coordinate_System& coordinateSystem);
864 
876 DT_DLL_vrfutil double illuminationValueAtPosition(const DtGeodeticCoord& position, time_t time,
877  double nighttimeMaximum = 0.1, double illuminationMinimum = 0.001, bool useDayNightIlluminationModel = true,
878  int* sunstate = 0);
879 
886 DT_DLL_vrfutil bool calculateEstimatedTot(const DtVector& localCurrentPos, const DtVector& localTargetPos,
887  double orderedSpeed, double currentSimTime, double currentSpeed, double acceleration,
888  const Coordinate_System& coordinateSystem, double& totResult, double& speedResult);
889 
896 DT_DLL_vrfutil bool calculateEstimatedTot(const DtVector& localCurrentPos, const DtLocalVertexList& localVertexList,
897  double orderedSpeed, double currentSimTime, double currentSpeed, double acceleration,
898  const Coordinate_System& coordinateSystem, double& totResult, double& speedResult);
899 
901 inline bool checkForNAN(const DtVector& vector)
902 {
903  if (boost::math::isnan(vector.x()) ||
904  boost::math::isnan(vector.y()) ||
905  boost::math::isnan(vector.z()))
906  {
907  return true;
908  }
909  else
910  {
911  return false;
912  }
913 }
914 
916 inline bool checkForNAN(const DtTaitBryan& tb)
917 {
918  if (boost::math::isnan(tb.phi()) ||
919  boost::math::isnan(tb.psi()) ||
920  boost::math::isnan(tb.theta()))
921  {
922  return true;
923  }
924  else
925  {
926  return false;
927  }
928 }
929 
931 inline bool checkForNAN(const DtDcm& dcm)
932 {
933  if (boost::math::isnan(dcm[0].x()) ||
934  boost::math::isnan(dcm[0].y()) ||
935  boost::math::isnan(dcm[0].z()) ||
936  boost::math::isnan(dcm[1].x()) ||
937  boost::math::isnan(dcm[1].y()) ||
938  boost::math::isnan(dcm[1].z()) ||
939  boost::math::isnan(dcm[2].x()) ||
940  boost::math::isnan(dcm[2].y()) ||
941  boost::math::isnan(dcm[2].z()))
942  {
943  return true;
944  }
945  else
946  {
947  return false;
948  }
949 }
950 
952 DT_DLL_vrfutil std::map<std::string, std::string> convertToStdStringMap(const std::map<DtString, DtString>& source,
953  bool convertValueForXml = false);
954 
957 
958 #include <boost/algorithm/string.hpp>
959 template< typename SequenceSequenceT, typename RangeT, typename PredicateT >
960 inline SequenceSequenceT& oldBoostSplit(
961  SequenceSequenceT& Result,
962  RangeT& Input,
963  PredicateT Pred,
964  boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off )
965 {
966  if (Input.length())
967  {
968  ::boost::algorithm::iter_split(
969  Result,
970  Input,
971  ::boost::algorithm::token_finder( Pred, eCompress ) );
972  }
973 
974  return Result;
975 }
976 
986 DT_DLL_vrfutil bool isPointWithinCorridor(double& heading, double corridorWidth,
987  double corridorHeight, const DtVector& localPoint, const DtLocalVertexList& localVertexList,
988  const Coordinate_System& coordinateSystemRef);
989 
997 DT_DLL_vrfutil bool isChordWithinCorridor(const DtChord& localChord, const DtLocalVertexList& localVertexList,
998  double corridorWidth, double corridorHeight, const Coordinate_System& coordinateSystemRef);
999 
1007 DT_DLL_vrfutil bool isPointRoughlyWithinCorridor(double corridorWidth,
1008  double corridorHeight, const DtVector& localPoint, const DtExtent & lineExtent,
1009  const Coordinate_System& coordinateSystemRef);
1010 
1018 DT_DLL_vrfutil bool isChordRoughlyWithinCorridor(const DtChord& localChord, const DtExtent& lineExtent,
1019  double corridorWidth, double corridorHeight, const Coordinate_System& coordinateSystemRef);
1020 
1025 DT_DLL_vrfutil double getHeadingFromGeocentric(const DtVector& firstPoint, const DtVector& secondPoint);
1026 
1029 DT_DLL_vrfutil bool calculateGeometricCenter(const DtVertexList& vertices, DtVector& geometricCenter);
DT_DLL_vrfutil void DtParallelAxisTheorem(DtConstDcm inertiaInOriginalFrame, double mass, const DtVector &newToOriginal, DtDcm &inertiaInNewFrame)
double DtVecMag(const DtVector &vec)
Definition: kinematicTools.h:192
DT_DLL_vrfutil char * DtGetFilenameExtension(char *fileName, char *extension)
Extract the extension from the fileName, excluding the period(.). Returns 0 if no period is found...
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
double DtGetGain()
Definition: kinematicTools.h:257
#define DtSIGN(x)
Boost includes.
Definition: kinematicTools.h:24
DT_DLL_vrfutil bool isChordWithinCorridor(const DtChord &localChord, const DtLocalVertexList &localVertexList, double corridorWidth, double corridorHeight, const Coordinate_System &coordinateSystemRef)
This function determines whether a given chord intersects with the volume defined by the corridor...
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords. This is useful for followi...
Definition: vrfChordIntersectRecordList.h:31
double DtOutput(double input)
Definition: kinematicTools.h:259
DT_DLL_vrfutil void DtResolve(const DtVector &forcePos, const DtVector &force, DtVectorRef resultTorqueAboutOrigin)
DT_DLL_vrfutil bool DtIsValidNumber(double x)
Returns true if the number is not infinite or not nan.
DT_DLL_vrfutil void localOrientationToGeocentricOrientation(const DtVector geocentricPosition, const DtTaitBryan &localOrientation, const Coordinate_System &coordinateSystem, DtTaitBryan &geocentricOrientation)
Transforms an orientation matrix in for going from body to local coordinates (database coordinates) t...
DT_DLL_vrfutil double illuminationValueAtPosition(const DtGeodeticCoord &position, time_t time, double nighttimeMaximum=0.1, double illuminationMinimum=0.001, bool useDayNightIlluminationModel=true, int *sunstate=0)
Give a geodetic coordinate and a UTC time, return an illumination value (0 - 1) at that position base...
DT_DLL_vrfutil const DtDcm & ned2enu()
DT_DLL_vrfutil double getHeadingFromGeocentric(const DtVector &firstPoint, const DtVector &secondPoint)
This function returns the heading of an object with two points in geocentric Basically this is used t...
#define DtPI_OVER_TWO
Definition: kinematicTools.h:29
DT_DLL_vrfutil bool setCurrentVertexToClosestInDirectionOfTraversal(const DtVector &point, const Coordinate_System &coordinateSystem, DtLocalVectorIterator &localVertexIterator)
Sets current vertex in localVertexIterator to that vertex closest to the given point, in the direction of travel. This may or may not be the overall closest vertex, depending on whether or not the closest vertex is &#39;behind&#39; the given point. If there is no &#39;next&#39; vertex along the direction of traversal, then sets that to be the current vertex. If there is a next vertex along the direction of traversal, then tests the heading angle formed between a vector from the point to the current vertex and the vector going from the current vertex to the next. If this angle is &gt; 0 (opposite the direction of traversal), then sets the current vertex to be the next vertex (because moving to current vertex would require turning opposite to the sense of the traversal). Otherwise, sets the current vertex to be the overall closest vertex (closest vertex is already in the direction of the traversal).
double DtVecMagSquared(const DtVector &vec)
Definition: kinematicTools.h:197
DT_DLL_vrfutil void DtRotateInertia(DtDcm inertiaInOriginalFrame, DtDcm originalToNew, DtDcm &inertiaInNewFrame)
I in frame B.
DT_DLL_vrfutil double DtAsin(double x)
DT_DLL_vrfutil DtListItem * getClosestVertex2D(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Sets vertex to be the vertex closest in 2D to point in localVertexList. Position and vertex list must...
double vectorAngle2D(DtVector &v)
This is a heading if v is in topo coordinates.
Definition: kinematicTools.h:739
DT_DLL_vrfutil void setAltitudeOfPosition(DtVector &localPosition, double newAltitude, const Coordinate_System &coordinateSystem)
Alters localPosition to have the specified altitude (above 0 altitude). localPosition must be in the ...
DT_DLL_vrfutil void DtRotZ2(double sinAng, double cosAng, DtDcm &rotMat)
DT_DLL_vrfutil void DtRotBodyZ(double angle, DtDcm &rotMat)
DT_DLL_vrfutil bool DtInSegment(DtVector P, DtVector P0, DtVector P1)
DtInSegment(): determine if a collinear Point P is inside a Segment P0 to P1.
DT_DLL_vrfutil void DtRotX2(double sinAng, double cosAng, DtDcm &rotMat)
DT_DLL_vrfutil double altitudeOfPosition(const DtVector &localPosition, const Coordinate_System &coordinateSystem)
DT_DLL_vrfutil double distToBoundingVolume(const DtVector &localBaseLocation, const Dt3dBoundingVolume &box, const DtTaitBryan &boxToLocalOrientation, const DtVector &testPoint)
Returns the distance of the testPoint to the bounding volume. This is the perpendicular distance to t...
DT_DLL_vrfutil void DtRotY2(double sinAng, double cosAng, DtDcm &rotMat)
double poleFreq
Definition: kinematicTools.h:238
File: lclVecIter.h.
Definition: localVectorIterator.h:25
DT_DLL_vrfutil DtPoint DtVector2DtPoint(const DtVector &p)
DtVector rotateRight2D(const DtVector &v)
Definition: kinematicTools.h:722
DT_DLL_vrfutil double DtSin(double r)
DT_DLL_vrfutil double maxAccelerationFromConstraint(const double deceleration, const double dt, const double ownSpeed, const double distance, const double targetSpeed, const double errorDecelValue=-1e10)
This function computes the maximum acceleration that an entity can use during the next tick and still...
DT_DLL_vrfutil double gRand()
Generates a Gaussian random number. Calls centralLimitGaussian() with the number of draws set to 6...
DT_DLL_vrfutil bool DtPointInSegment(const DtVector &testPoint, const DtVector &segStart, const DtVector &segEnd)
DT_DLL_vrfutil double DtPIDServo(double error, double errorIntegral, double velocity, double proportionalGain, double integralGain, double derivativeGain, double biasForce=0.0, double *control=0)
I in frame B.
DT_DLL_vrfutil const DtDcm & enu2ned()
DT_DLL_vrfutil bool insideEllipsoid(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
DT_DLL_vrfutil double DtFindZInPlane(const double posx, const double posy, const DtVector &pointInPlane, const DtVector &normal)
DT_DLL_vrfutil unsigned int DtIntersectChordWithBilinearSurface(const DtChord &chord, double x1, double y1, double x2, double y2, double z11, double z21, double z12, double z22, DtVrfChordIntersectionRecord &isect1, DtVrfChordIntersectionRecord &isect2, double tolerance=1e-20)
Find intersection between bilinear interpolated surface and line.
DT_DLL_vrfutil double headingAngleTo(const DtVector &observerPosition, const DtVector &targetPosition, const Coordinate_System &coordinateSystem)
Local(database) functions for performing topocentric 2-D geometry operations on points and vertex li...
DT_DLL_vrfutil DtDcm DtRotYToBodyToLocal(const Coordinate_System &coordSystem, double angle, const DtVector &position)
DT_DLL_vrfutil double centralLimitGaussian(int numDraws)
Generates a Gaussian random number (an approximation), from a series of n uniform random number draws...
DT_DLL_vrfutil double DtBilinearInterpolate(double x1, double y1, double x2, double y2, double z11, double z21, double z12, double z22, double x, double y)
Returns result of bilinear interpolation on grid defined by (x1,y1) to (x1,y2) at point (x...
double DtExponent
Definition: kinematicTools.h:266
A nonlinearity of zero gives you a simple linear relation: output = gain * input. Increasing positive...
Definition: kinematicTools.h:244
DT_DLL_vrfutil DtVector localGravityAcceleration(const DtVector &localPosition, const Coordinate_System &coordinateSystem)
Terrain related functions.
const DtVector & getPrevOutput()
Definition: kinematicTools.h:235
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
DT_DLL_vrfutil bool leftOf(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Returns true if localPoint is left of the localVertexList in 2D. Always returns false if this has onl...
DT_DLL_vrfutil bool DtChordIntersectsExtentArea(const DtChord &chord, const DtVector &lower, const DtVector &upper, DtVrfChordIntersectRecordList *intList=0)
Returns true if the chord intersects the extent area (i.e. including the interior points)...
DT_DLL_vrfutil void Dt3DDynamicsTick(const DtVector &LinearForce, double vehicleMass, DtVectorRef newLinearAcceleration, const DtVector &torque, DtConstDcm vehicleInertia, DtVectorRef newAngAcceleration)
DT_DLL_vrfutil void DtRotBodyX(double angle, DtDcm &rotMat)
Returns a matrix for converting from the new system to the old system where both systems are using bo...
DT_DLL_vrfutil DtVector DtPoint2DtVector(const DtPoint &p)
DT_DLL_vrfutil double calculateLengthOfLine(const std::vector< DtVector > &points)
Given the points return the length of the line. Assumes points are geocentric.
DT_DLL_vrfutil double distanceSquaredPointToPoint2D(const DtVector &localLinePt1, const DtVector &localLinePt2, const Coordinate_System &coordinateSystem)
Returns the distance^2 from point1 to point2 in 2D. All points must be in the coordinate system given...
double DtGain
Definition: kinematicTools.h:265
DT_DLL_vrfutil int DtIntersect2D_Segments(DtVector P0, DtVector P1, DtVector Q0, DtVector Q1, DtVector *I0=0, DtVector *I1=0, double *isectParam1=0, double *isectParam2=0, bool *parallel=0, bool *collinear=0)
Description:
DT_DLL_vrfutil bool calculateEstimatedTot(const DtVector &localCurrentPos, const DtVector &localTargetPos, double orderedSpeed, double currentSimTime, double currentSpeed, double acceleration, const Coordinate_System &coordinateSystem, double &totResult, double &speedResult)
Returns the estimated time-on-target to a local target position, given local current position...
DT_DLL_vrfutil double elevationAngleTo(const DtVector &observerPosition, const DtVector &targetPosition, const Coordinate_System &coordinateSystem)
Returns the elevation angle in radians from observer position to target position. Positions must be i...
DT_DLL_vrfutil void DtTrigInit()
Functions for trig table lookups.
DT_DLL_vrfutil double DtHeadingFromGeocAToGeocB(const DtVector &geocA, const DtVector &geocB)
Expects geocentric coordinates. Standing at point A, returns the heading along which you would need t...
DT_DLL_vrfutil double DtAtan(double x)
double DtCos(double r)
Definition: kinematicTools.h:412
DT_DLL_vrfutil bool inside(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Determine if the given localPoint is inside the polygon defined by the given localVertexList.
DT_DLL_vrfutil void DtRotBodyY(double angle, DtDcm &rotMat)
DT_DLL_vrfutil bool DtIntersectChordWithTriangle(const DtChord &chord, const DtVector &p1, const DtVector &p2, const DtVector &p3, DtVector *result=0, double *t=0)
Returns the point of intersection between a chord and a triangle. Takes into account end points of ch...
DtVector prevOutput
Definition: kinematicTools.h:239
DT_DLL_vrfutil unsigned int DtVRFGetThreadId()
Gets the current thread id.
DT_DLL_vrfutil bool isPointWithinCorridor(double &heading, double corridorWidth, double corridorHeight, const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystemRef)
This function determines whether a given point is within a corridor and if so it populates the headin...
DT_DLL_vrfutil void DtRotY(double angle, DtDcm &rotMat)
DT_DLL_vrfutil DtVector DtCalculateRotationalVelocity(const DtDcm &newOrientation, const DtDcm &oldOrientation, double dT)
Calculates rotational velocity from new and old orientation body DCMs. Which coordinate system is use...
Definition: coordSystem.h:54
DT_DLL_vrfutil double distanceSquaredPointToLine2D(const DtVector &localPoint, const DtVector &localLinePt1, const DtVector &localLinePt2, const Coordinate_System &coordinateSystem)
Returns the distance^2 from point to linePt1-linePt2 in topographic 2D. All points must be in the giv...
void DtSetGain(double gain)
Definition: kinematicTools.h:254
DT_DLL_vrfutil void DtBlockInertia(const double xLen, const double yLen, const double zLen, const double mass, DtDcm &inertia)
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
DT_DLL_vrfutil double DtTan(double r)
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
Definition: localVector.h:25
DT_DLL_vrfutil void DtVecLimit(DtVectorRef vec, double limit)
If mag(vec)&gt;limit, shortens vector to mag = limit.
DT_DLL_vrfutil void localVectorToGeocentricVector(const DtVector &geocentricPosition, const DtVector &localVector, const Coordinate_System &coordinateSystem, DtVector &geocentricVector)
local(database)/geocentric conversion functions
class DtVertexList:
Definition: vertexList.h:22
DT_DLL_vrfutil void DtBodyToRefFromHeadingAndPosition(const Coordinate_System &coordSystem, double heading, const DtVector &position, DtDcm &bodyToRef)
Calculates a Dcm for rotating from a body coordinate system, defined by a given heading (no pitch or ...
DT_DLL_vrfutil void geocentricOrientationToLocalOrientation(const DtVector &geocentricPosition, const DtTaitBryan &geocentricOrientation, const Coordinate_System &coordinateSystem, DtTaitBryan &localOrientation)
Transforms an orientation matrix in for going from body to local coordinates (database coordinates) t...
DT_DLL_vrfutil double closestPointAlongChord2D(const DtPoint &chordStart, const DtPoint &chordEnd, const DtPoint &testPoint, DtPoint &closestPoint, const Coordinate_System &coordSys)
Finds the closest point along the chord defined by chordStart and chordEnd to testPoint. This point is returned as closestPoint, and the distance between testPoint and closestPoint is returned. All calculations are done in 2D, and all points must be in the coordinate system provided.
DT_DLL_vrfutil DtVector DtIntersectLineWithPlane(const DtVector &point, const DtVector &direction, const DtVector &pointInPlane, const DtVector &planeNormal, bool *noIntersection=0)
Returns the point of intersection between a line (defined by a point and a direction vector) and a pl...
DT_DLL_vrfutil void DtSeconds2HoursMinutesSeconds(double totalSeconds, int &hoursOut, int &minutesOut, double &secondsOut)
Converts totalSeconds into hours, minutes, and seconds.
double dotProd2D(const DtVector &v1, const DtVector &v2)
---------------------------------------------------------------------------- 2D functions on 3D topo...
Definition: kinematicTools.h:707
double DtFloat64
Definition: vrvControlStructTypes.h:36
DT_DLL_vrfutil void DtEuler_to_BodyToLocalRef(const DtTaitBryan &euler, DtDcm &body2ref)
DT_DLL_vrfutil int closestVertexInDirectionOfTraversal(const DtVector &point, const DtLocalVertexList &vertices, int startingIndex, bool reverseDirection, const Coordinate_System &coordinateSystem)
Returns the index of the vertex in the list that is closest to the given point, in the specified dire...
bool checkForNAN(const DtVector &vector)
Checks for not a number (NAN) values.
Definition: kinematicTools.h:901
double DtAcos(double x)
Definition: kinematicTools.h:420
DT_DLL_vrfutil double calculateSpeedForArrival(double distance, double currentSpeed, double acceleration, double deceleration, double timeToArrive)
Given a distance, current speed, max acceleration, max deceleration, and desired arrival time...
DT_DLL_vrfutil DtDcm DtRotZToBodyToLocal(const Coordinate_System &coordSystem, double angle, const DtVector &position)
void normalize2D(DtVector &v)
Definition: kinematicTools.h:728
DT_DLL_vrfutil double gaussianRandom()
Generates a Gaussian random number using the Marsaglia polar method. See e.g. Wikipedia (http://en...
const char * source
Definition: lz4.h:442
DT_DLL_vrfutil int DtIntRandom(int iFrom, int iTo)
Returns a random number from the base to the max.
double crossProduct2D(const DtVector &v1, const DtVector &v2)
Definition: kinematicTools.h:717
DT_DLL_vrfutil void Dt3DKinematicsTick(const DtVector &Position, const DtVector &LinearVelocity, const DtVector &LinearAcceleration, DtConstDcm orientation, const DtVector &angVelocity, const DtVector &angAcceleration, double DeltaTime, DtVectorRef newPosition, DtVectorRef newVelocity, DtDcm &newOrientation, DtVectorRef newAngVelocity)
Definition: asyncJobServer.h:39
DT_DLL_vrfutil void DtOrientationFromThreePointsAndHeading(const DtVector &leftPoint, const DtVector &rightPoint, const DtVector &otherPoint, double cosHeading, double sinHeading, DtDcm &orientation, bool upsideDown=false)
This form preserves heading; the previous one does not!
DT_DLL_vrfutil void DtRotZ(double angle, DtDcm &rotMat)
DT_DLL_vrfutil void DtBodyToLocalRef_to_Euler(DtConstDcm body2ref, DtTaitBryan *e)
DT_DLL_vrfutil double DtHoursMinutesSeconds2Seconds(double hours, double minutes, double seconds)
DT_DLL_vrfutil std::map< std::string, std::string > convertToStdStringMap(const std::map< DtString, DtString > &source, bool convertValueForXml=false)
Converts DtString to std::string map.
DT_DLL_vrfutil bool DtSameSign(double x, double y)
DT_DLL_vrfutil void DtDcmFromRows(DtDcm &result, const DtVector &row1, const DtVector &row2, const DtVector &row3)
DT_DLL_vrfutil void DtGravityForce(double mass, DtVectorRef returnForce)
DT_DLL_vrfutil DtFloat64 DtFastDist(const DtVector &pt1, const DtVector &pt2)
DT_DLL_vrfutil void DtCalculateOrientation(DtVector localNormal, double heading, const DtDcm &topoToLocal, DtDcm &localOrientation)
Calculates the orientation from the specified local normal and heading.
Definition: vrfChordIntersectionRecord.h:19
double magnitudeSquared2D(const DtVector &v)
Definition: kinematicTools.h:712
DT_DLL_vrfutil void DtSpacesToDashes(char *str)
Inline versions of some functions in LibMatrix. NOTE: that unlike the LibMatrix counterpart.
DT_DLL_vrfutil double distanceSquaredPointToLineTopographic(const DtVector &topoPoint, const DtVector &topoLinePt1, const DtVector &topoLinePoint2)
Same as distanceSquaredPointToLine2D, except that the points are assumed to be in topographic coordin...
double DtGetNonLinearity()
Definition: kinematicTools.h:258
DT_DLL_vrfutil double bankAngleTo(const DtVector &observerPosition, const DtVector &targetPosition, const Coordinate_System &coordinateSystem)
Returns the bank angle in radians from observer position to target position. Positions must be in the...
DT_DLL_vrfutil bool getClosestLine2D(const DtVector &localPoint, DtVector &localLinePt1, DtVector &localLinePt2, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Sets linePt1 and linePt2 to be the vertices of the line segment closest in 2D to point in localVertex...
DT_DLL_vrfutil bool calculateGeometricCenter(const DtVertexList &vertices, DtVector &geometricCenter)
Calculates the geometric center of the given vertex list. Returns true. Will use strictly geocentric ...
DT_DLL_vrfutil bool isPointRoughlyWithinCorridor(double corridorWidth, double corridorHeight, const DtVector &localPoint, const DtExtent &lineExtent, const Coordinate_System &coordinateSystemRef)
This function roughly determines whether a point may be within a corridor.
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
SequenceSequenceT & oldBoostSplit(SequenceSequenceT &Result, RangeT &Input, PredicateT Pred, boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off)
Replace boost split with version that returns an empty set if the supplied string has no length...
Definition: kinematicTools.h:960
DT_DLL_vrfutil void geocentricVectorToLocalVector(const DtVector &geocentricPosition, const DtVector &geocentricVector, const Coordinate_System &coordinateSystem, DtVector &localVector)
Transforms a vector in geocentric coordinates to local (database) coordinates. Inputs: geocentricPosi...
DT_DLL_vrfutil bool DtCalculateNormal(const DtVector &pointA, const DtVector &pointB, const DtVector &pointC, DtVector &normal)
Calculates the normal formed by the plane containing points A, B, and C.
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
DT_DLL_vrfutil double DtAtan2(double y, double x)
DT_DLL_vrfutil void DtDcmFromColumns(DtDcm &result, const DtVector &col1, const DtVector &col2, const DtVector &col3)
DT_DLL_vrfutil bool isChordRoughlyWithinCorridor(const DtChord &localChord, const DtExtent &lineExtent, double corridorWidth, double corridorHeight, const Coordinate_System &coordinateSystemRef)
This function determines whether a given chord roughly intersects with the volume defined by the corr...
DT_DLL_vrfutil bool DtPointInCone(const DtVector &coneEndPosition, const DtVector &coneAxis, const double coneAngle, const DtVector &testPoint, double *testAnglePtr=0)
Test if a point is in a cone. All quantities are assumed to be in the same coordinate system...
DtNonLinearOutputType(double nonlinearity, double gain=1.0)
Definition: kinematicTools.h:247
DT_DLL_vrfutil bool intersects(const DtVector &localPoint1, const DtVector &localPoint2, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Returns true if the line segment localPoint1-localPoint2 intersects any line segment in localVert...
DT_DLL_vrfutil double localDistSquaredTo(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Returns the distance from localPoint to the closest vertex in localVertexList. If localVertexList is ...
DT_DLL_vrfutil bool DtPointInWedge(const DtVector &wedgeEndPosition, const DtVector &wedgeAxis, const double wedgeAngle, const DtVector &testPoint)
DT_DLL_vrfutil DtVector calculateWorldVelocityFromPosition(const DtVector &currentWorldPos, const DtVector &currentLocalPos, const DtVector &localVelocity, const Coordinate_System &coordinateSystem)
If the database is in a projected system, error is introduced in the velocity when converting it to g...
DT_DLL_vrfutil void calculateLengthAndWidthOfShape(const Coordinate_System &coordSytem, const std::vector< DtVector > &points, double &length, double &width)
Given points and the coordinate system those points are in find the length/width of the given polygon...
Definition: kinematicTools.h:220
DT_DLL_vrfutil void DtRotX(double angle, DtDcm &rotMat)
double getPole()
Definition: kinematicTools.h:234
class DtLocalVertexList:
Definition: localVertexList.h:20
DT_DLL_vrfutil bool DtVectorIsZero(const DtVector &v, double tolerance=0.0)
void DtSetNonLinearity(double nonlinearity)
Definition: kinematicTools.h:255
DT_DLL_vrfutil void adjustAltitudeOfPosition(DtVector &localPosition, double altitudeChange, const Coordinate_System &coordinateSystem)
Alters the altitude of the provided localPosition by the value in altitudeChange based on the down ve...
DT_DLL_vrfutil void DtTopoEulerToBodyToLocal(const DtTaitBryan &topoEuler, const Coordinate_System &coordSystem, const DtVector &localPosition, DtDcm &bodyToLocalDcm)
Calculates the rotation matrix for going from a body to local (database) reference frame...
DT_DLL_vrfutil DtDcm DtRotXToBodyToLocal(const Coordinate_System &coordSystem, double angle, const DtVector &position)
Definition: point.h:34
DT_DLL_vrfutil void DtOrientationFromThreePoints(const DtVector &leftPoint, const DtVector &rightPoint, const DtVector &rearPoint, DtDcm &orientation, bool yIsForward=false)
Given the world position of the three big-wheel points, this returns the resulting orientation of big...
DT_DLL_vrfutil void DtCircleVerts(double radius, int npts, double *xCoords, double *yCoords)
DT_DLL_vrfutil double distSquaredTo2D(const DtVector &position1, const DtVector &position2, const Coordinate_System &coordinateSystem)
Returns the (2D) squared distance between given position. Positions must be in the given coordinate s...

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)