23 inline bool IsFinite(
const Matrix2& R)
30 inline bool IsFinite(
const Matrix3& R)
37 inline bool IsFinite(
const Matrix4& R)
48 inline bool IsInf(
const Matrix2& R)
55 inline bool IsInf(
const Matrix3& R)
62 inline bool IsInf(
const Matrix4& R)
70 inline bool FuzzyZero(
const Vector2& x,Real tol=Epsilon) {
return Math::FuzzyZero(x.x,tol)&&Math::FuzzyZero(x.y,tol); }
71 inline bool FuzzyZero(
const Vector3& x,Real tol=Epsilon) {
return Math::FuzzyZero(x.x,tol)&&Math::FuzzyZero(x.y,tol)&&Math::FuzzyZero(x.z,tol); }
72 inline bool FuzzyZero(
const Vector4& x,Real tol=Epsilon) {
return Math::FuzzyZero(x.x,tol)&&Math::FuzzyZero(x.y,tol)&&Math::FuzzyZero(x.z,tol)&&Math::FuzzyZero(x.w,tol); }
75 inline bool NormLess(
const V& x, Real d) {
return x.normSquared() < Sqr(d); }
77 inline bool NormLEQ(
const V& x, Real d) {
return x.normSquared() <= Sqr(d); }
79 inline bool NormGreater(
const V& x, Real d) {
return x.normSquared() > Sqr(d); }
81 inline bool NormGEQ(
const V& x, Real d) {
return x.normSquared() <= Sqr(d); }
84 inline bool DistanceLess(
const V& x,
const V& y, Real d) {
return x.distanceSquared(y) < Sqr(d); }
86 inline bool DistanceLEQ(
const V& x,
const V& y, Real d) {
return x.distanceSquared(y) <= Sqr(d); }
88 inline bool DistanceGreater(
const V& x,
const V& y, Real d) {
return x.distanceSquared(y) > Sqr(d); }
90 inline bool DistanceGEQ(
const V& x,
const V& y, Real d) {
return x.distanceSquared(y) <= Sqr(d); }
100 return (p1.x - p0.x)*(p2.y - p0.y) - (p2.x - p0.x)*(p1.y - p0.y);
103 inline Real DistanceSquared2D(Real x1,Real y1,Real x2,Real y2)
105 return Sqr(x1-x2)+Sqr(y1-y2);
108 inline Real Distance2D(Real x1,Real y1,Real x2,Real y2)
110 return Sqrt(DistanceSquared2D(x1,y1,x2,y2));
113 inline bool IsSymmetric(
const Matrix2& R,Real tol=Epsilon)
118 inline bool IsSymmetric(
const Matrix3& R,Real tol=Epsilon)
120 return FuzzyEquals(R(0,1),R(1,0),tol) &&
FuzzyEquals(R(0,2),R(2,0),tol) &&
FuzzyEquals(R(1,2),R(2,1),tol);
123 inline bool IsSymmetric(
const Matrix4& R,Real tol=Epsilon)
131 inline bool IsUpperTriangular(
const Matrix2& R,Real tol=Epsilon)
133 return Math::FuzzyZero(R(1,0),tol);
136 inline bool IsUpperTriangular(
const Matrix3& R,Real tol=Epsilon)
138 return Math::FuzzyZero(R(1,0),tol) && Math::FuzzyZero(R(2,0),tol) && Math::FuzzyZero(R(2,1),tol);
141 inline bool IsUpperTriangular(
const Matrix4& R,Real tol=Epsilon)
145 if(!Math::FuzzyZero(R(i,j),tol))
return false;
A 2x2 matrix class.
Definition: math3d/primitives.h:333
int IsInf(double x)
Returns +1 if x is +inf, -1 if x is -inf, and 0 otherwise.
Definition: infnan.cpp:40
Real Orient2D(const Vector2 &p0, const Vector2 &p1, const Vector2 &p2)
Orientation test for 2d points.
Definition: d/misc.h:98
Class declarations for useful 3D math types.
A 4x4 matrix class.
Definition: math3d/primitives.h:626
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:12
A 3x3 matrix class.
Definition: math3d/primitives.h:469
A 2D vector class.
Definition: math3d/primitives.h:41
bool FuzzyEquals(double a, double b, double eps=dEpsilon)
Returns true if a and b are within +/- eps.
Definition: math.h:222
int IsFinite(double x)
Returns nonzero unless x is infinite or a NaN.
Definition: infnan.cpp:23