58 template <
class T>
static T
Sqrt(T val) {
return sqrt(val);}
59 template <
class T>
static T
Abs(T val) {
return fabs(val);}
60 static int Abs(
int val) {
if (val>0)
return val;
else return -val;}
61 template <
class T>
static T
Sin(T val) {
return sin(val);}
62 template <
class T>
static T
Cos(T val) {
return cos(val);}
63 template <
class T>
static T
Tan(T val) {
return tan(val);}
69 template <
class T>
static T
Squared(T val) {
return val*val;}
71 template <
class T>
static int NumDigits(T val);
72 template <
class T>
static double GetNormalizedValueRespectingLength(T val);
109 template <
class T>
static T
clamp(T val, T minval, T maxval);
118 template <
class T>
static T
lerp( T a, T b, T t );
134 template <
class T>
static bool isFinite(T n);
136 template <
class T>
static T
Min(T lhs, T rhs);
137 template <
class T>
static T
Max(T lhs, T rhs);
157 template <
class T>
static T
positiveInfinity(
void) {
return std::numeric_limits<T>::max();}
158 template <
class T>
static T
negativeInfinity(
void) {
return std::numeric_limits<T>::min();}
175 Assert(minval <= maxval &&
"Invalid clamp range");
176 return std::max(std::min(val, maxval), minval);
222 T vm = va + (vb - va) * t;
240 vm[0] = va[0] + (vb[0] - va[0]) * t;
241 vm[1] = va[1] + (vb[1] - va[1]) * t;
260 vm[0] = va[0] + (vb[0] - va[0]) * t;
261 vm[1] = va[1] + (vb[1] - va[1]) * t;
262 vm[2] = va[2] + (vb[2] - va[2]) * t;
281 vm[0] = va[0] + (vb[0] - va[0]) * t;
282 vm[1] = va[1] + (vb[1] - va[1]) * t;
283 vm[2] = va[2] + (vb[2] - va[2]) * t;
284 vm[3] = va[3] + (vb[3] - va[3]) * t;
292 T theta = toRadians(thetaDegrees);
293 T phi = toRadians(phiDegrees);
302 T temp = vPosition.
y;
303 vPosition.
y = vPosition.
z;
329 intersect = (lineDir * w) + linePoint1;
347 double normalizedValue = (double)(val)/(double)(std::numeric_limits<T>::max());
348 return normalizedValue;
355 && (n != +std::numeric_limits<T>::infinity())
356 && (n != -std::numeric_limits<T>::infinity())
395 return (radiansPerSec / (2.0f *
DtMath::PI)) * 60.0f;
#define Assert(exp)
Definition DtAssert.h:25
virtual ~DtDegrees()
Definition DtMath.h:29
DtDegrees(float32 fVal)
Definition DtMath.h:28
DtDegrees()
Definition DtMath.h:34
DtRadians toRadians(void) const
bool isEqual(const DtDegrees &rhs) const
float32 myVal
Definition DtMath.h:35
float32 val() const
Definition DtMath.h:30
Math utilities.
Definition DtMath.h:54
static bool linePlaneIntersection(const DtVector3< T > &linePoint1, const DtVector3< T > &linePoint2, const DtVector3< T > &planePoint, const DtVector3< T > &planeNormal, DtVector3< T > &intersect, float &w)
Basic intersections.
Definition DtMath.h:311
static T rpmToRadiansPerSec(T rpm)
rpm to radians per sec
Definition DtMath.h:387
static T Sqrt(T val)
Standard math routines.
Definition DtMath.h:58
static T lerp(T a, T b, T t)
Lerping routines.
Definition DtMath.h:210
static float64 rangeRandom(float64 fLow, float64 fHigh)
static int Abs(int val)
Definition DtMath.h:60
static float Sin(const DtDegrees &val)
static const float32 TWO_PI
Definition DtMath.h:160
static float32 rangeRandom(float32 fLow, float32 fHigh)
static double fractional(double val)
fractional part of a number
static int rangeRandom(int iLow, int iHigh)
static T clamp(T val, T minval, T maxval)
Clamping routines.
Definition DtMath.h:173
static uint32 getUpperPowerOfTwo(uint32 val)
static bool randomBool(void)
static double GetNormalizedValueRespectingLength(T val)
Definition DtMath.h:345
static const float32 PI_BY_3
Definition DtMath.h:163
static T Sin(T val)
Definition DtMath.h:61
static uint32 nextPowerOf2(uint32 i)
static const float32 m_fConvertToRadians
Definition DtMath.h:167
static uint32 getLowerPowerOfTwo(uint32 val)
static float32 unitRandom32(void)
Random number generation routines.
static bool isEqual(float64 lhs, float64 rhs, float64 tolerance=std::numeric_limits< float64 >::epsilon())
static const float32 PI_BY_6
Definition DtMath.h:165
static const float32 Gravity
Definition DtMath.h:166
static const float32 PI_BY_2
Definition DtMath.h:162
static const float32 PI
Definition DtMath.h:161
static const float32 PI_BY_4
Definition DtMath.h:164
static unsigned int tilelog2(unsigned int x)
static DtVector3< T > toCartesian(T thetaDegrees, T phiDegrees, bool flipYZ)
Definition DtMath.h:290
static bool isFinite(T n)
Definition DtMath.h:352
static T Tan(T val)
Definition DtMath.h:63
static T positiveInfinity(void)
Definition DtMath.h:157
static std::string formatBytes(uint64_t sizeInBytes)
format a size in bytes to a string like Mb, Kb and so on
static int NumDigits(T val)
Definition DtMath.h:334
static T Squared(T val)
Definition DtMath.h:69
static bool isEqual(int32 lhs, int32 rhs, int32 tolerance=std::numeric_limits< int32 >::epsilon())
Test equality with tolerance.
static float64 unitRandom64(void)
static T negativeInfinity(void)
Definition DtMath.h:158
static bool isEqual(float32 lhs, float32 rhs, float32 tolerance=std::numeric_limits< float32 >::epsilon())
static T Max(T lhs, T rhs)
Definition DtMath.h:374
static bool isPowerOf2(uint32 i)
static float Tan(const DtDegrees &val)
static T Min(T lhs, T rhs)
Definition DtMath.h:361
static T radiansPerSecToRpm(T radiansPerSec)
radians per sec to rpm
Definition DtMath.h:393
static float Cos(const DtDegrees &val)
static const float32 m_fConvertToDegrees
Definition DtMath.h:168
static T Abs(T val)
Definition DtMath.h:59
static T Cos(T val)
Definition DtMath.h:62
static bool isEqual(uint32 lhs, uint32 rhs, uint32 tolerance=std::numeric_limits< uint32 >::epsilon())
float32 myVal
Definition DtMath.h:48
float32 val() const
Definition DtMath.h:43
DtRadians()
Definition DtMath.h:47
bool isEqual(const DtRadians &rhs) const
virtual ~DtRadians()
Definition DtMath.h:42
DtRadians(float32 fVal)
Definition DtMath.h:41
DtDegrees toDegrees(void) const
2 dimensional vector
Definition DtVector2.h:26
T y
Definition DtVector2.h:105
T x
Definition DtVector2.h:105
2 dimensional vector
Definition DtVector3.h:27
T y
Definition DtVector3.h:135
T z
Definition DtVector3.h:135
T x
Definition DtVector3.h:135
T dotProduct(const DtVector3 &rhs) const
get the dot product of this vector and rhs
Definition DtVector3.h:268
void normalize(void)
normalize this vector in place
Definition DtVector3.h:167
4 dimensional vector
Definition DtVector4.h:28
T x
Definition DtVector4.h:118
T w
Definition DtVector4.h:118
T z
Definition DtVector4.h:118
T y
Definition DtVector4.h:118
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
unsigned int uint32
Definition DtCommonTypes.h:28
float float32
Definition DtCommonTypes.h:33
double float64
Definition DtCommonTypes.h:34
int int32
Definition DtCommonTypes.h:31
#define DT_DLL_VRVMATH
Definition vrvMath.h:18