13 #include <matrix/LibMatrix.h>
14 #include <vl/topoView.h>
15 #include <matrix/vlTaitBryan.h>
16 #include <matrix/3dBoundingVolume.h>
18 #include "tdbutil/mathUtilities.h"
21 #include <boost/math/special_functions/fpclassify.hpp>
23 #define DtSIGN(x) (((x) > (0.0)) ? (1.0) : (-1.0))
25 #define DtALMOST(x, y, e) (((x)<=((y)+(e))) && ((x)>=((y)-(e))))
27 #define DtGRAVITY_CONSTANT (9.81)
28 #define DtPI_OVER_TWO (1.570796327)
29 #define DtTWO_PI (6.283185307)
30 #define DtMETERS_TO_FEET (3.2808)
31 #define DtMETERS_PER_SEC_TO_MPH (2.23)
32 #define DtLN2 (0.693147181)
34 #define SIN(x) DtSin(x)
35 #define COS(x) DtCos(x)
36 #define TAN(x) DtTan(x)
38 #define ASIN(x) DtAsin(x)
39 #define ACOS(x) DtAcos(x)
40 #define ATAN(x) DtAtan(x)
41 #define ATAN2(y, x) DtAtan2((y), (x))
43 #define DtFRand() ((double) rand() / RAND_MAX)
44 #define DtIRandom(from, to) DtIntRandom(from, to)
46 class DtGeodeticCoord;
47 class Coordinate_System;
75 DtConstDcm orientation,
79 DtVectorRef newPosition,
80 DtVectorRef newVelocity,
81 DtDcm& newOrientation,
82 DtVectorRef newAngVelocity);
86 DtVectorRef newLinearAcceleration,
88 DtConstDcm vehicleInertia,
89 DtVectorRef newAngAcceleration);
92 DtVectorRef returnForce);
96 DtVectorRef resultTorqueAboutOrigin);
101 DtDcm& inertiaInNewFrame);
105 DtDcm& inertiaInNewFrame);
108 double errorIntegral,
110 double proportionalGain,
112 double derivativeGain,
113 double biasForce = 0.0,
114 double* control = 0);
123 double tolerance = 0.0);
147 const double coneAngle,
149 double* testAnglePtr = 0);
154 const double wedgeAngle,
165 return sqrt(vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ]);
170 return vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ];
195 void setPole(
double freq);
196 void output(DtTaitBryan* input,
198 DtTaitBryan* output);
202 double output(
double input,
222 DtExponent = nonlinearity+1.0;
230 double DtOutput(
double input)
232 return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
278 bool yIsForward=
false);
287 bool upsideDown =
false);
292 const DtDcm& topoToLocal, DtDcm& orientation);
305 const DtDcm& topoToLocal, DtDcm& localOrientation);
320 double heading,
const DtVector& position, DtDcm& bodyToRef);
328 const Coordinate_System& coordSystem,
const DtVector& localPosition,
329 DtDcm& bodyToLocalDcm);
358 double cosR =
DtCos(r);
360 if (DtIsZero<double>(cosR))
368 return DtSin(r) / cosR;
413 double* isectParam1 = 0,
double *isectParam2 = 0,
414 bool* parallel = 0,
bool* collinear = 0);
431 const Coordinate_System& coordinateSystem);
437 const Coordinate_System& coordinateSystem);
439 const Coordinate_System& coordinateSystem);
446 const Coordinate_System& coordinateSystem);
448 const Coordinate_System& coordinateSystem);
461 const DtVector& targetPosition,
const Coordinate_System& coordinateSystem);
466 const DtVector& targetPosition,
const Coordinate_System& coordinateSystem);
471 const DtVector& targetPosition,
const Coordinate_System& coordinateSystem);
476 const Coordinate_System& coordinateSystem);
484 const Coordinate_System& coordinateSystem);
493 const Coordinate_System& coordinateSystem);
502 const Coordinate_System& coordinateSystem);
510 const Coordinate_System& coordinateSystem);
520 const Coordinate_System& coordinateSystem);
528 const Coordinate_System& coordinateSystem);
540 const Dt3dBoundingVolume* box,
const DtTaitBryan& boxToLocalOrientation,
550 const Coordinate_System& coordinateSystem);
556 const Coordinate_System& coordinateSystem);
564 const Coordinate_System& coordinateSystem);
570 const Coordinate_System& coordinateSystem);
576 const DtVector& localLinePt2,
const Coordinate_System& coordinateSystem);
584 const DtPoint& chordEnd,
585 const DtPoint& testPoint, DtPoint & closestPoint,
586 const Coordinate_System& coordSys);
601 const DtVector& point,
const Coordinate_System& coordinateSystem,
615 return v1[0]*v2[0] + v1[1]*v2[1];
625 return v1[0]*v2[1] - v1[1]*v2[0];
647 return DtModPerLo(atan2(v[1], v[0]), -M_PI, M_PI);
665 const DtVector& localVector,
const Coordinate_System& coordinateSystem,
680 const DtTaitBryan& localOrientation,
681 const Coordinate_System& coordinateSystem,
682 DtTaitBryan& geocentricOrientation);
695 const DtVector& geocentricVector,
const Coordinate_System& coordinateSystem,
711 const DtTaitBryan& geocentricOrientation,
712 const Coordinate_System& coordinateSystem,
713 DtTaitBryan& localOrientation);
750 &geocPosition,
const DtTaitBryan& local, DtTaitBryan& geoc);
783 const DtTaitBryan& local);
803 &geocPosition,
const DtTaitBryan& geoc, DtTaitBryan& local);
844 int& minutesOut,
double& secondsOut);
856 double& length,
double& width);
860 double& length,
double& width);
876 double nighttimeMaximum = 0.1,
double illuminationMinimum = 0.001,
bool useDayNightIlluminationModel =
true,
882 if (boost::math::isnan(vector.x()) ||
883 boost::math::isnan(vector.y()) ||
884 boost::math::isnan(vector.z()))
897 if (boost::math::isnan(tb.phi()) ||
898 boost::math::isnan(tb.psi()) ||
899 boost::math::isnan(tb.theta()))
912 if (boost::math::isnan(dcm[0].x()) ||
913 boost::math::isnan(dcm[0].y()) ||
914 boost::math::isnan(dcm[0].z()) ||
915 boost::math::isnan(dcm[1].x()) ||
916 boost::math::isnan(dcm[1].y()) ||
917 boost::math::isnan(dcm[1].z()) ||
918 boost::math::isnan(dcm[2].x()) ||
919 boost::math::isnan(dcm[2].y()) ||
920 boost::math::isnan(dcm[2].z()))
933 #include <boost/algorithm/string.hpp>
934 template<
typename SequenceSequenceT,
typename RangeT,
typename PredicateT >
936 SequenceSequenceT& Result,
939 boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off )
943 ::boost::algorithm::iter_split(
946 ::boost::algorithm::token_finder( Pred, eCompress ) );