3BEGIN_MOOTOOLS_NAMESPACE
35 x = point2.x - point1.x;
36 y = point2.y - point1.y;
37 z = point2.z - point1.z;
85 x = point2.x - point1.x;
86 y = point2.y - point1.y;
87 z = point2.z - point1.z;
112 neg.x = (x == -0.0) ? 0.0 : -x;
113 neg.y = (y == -0.0) ? 0.0 : -y;
114 neg.z = (z == -0.0) ? 0.0 : -z;
134 CPt::operator=(
vect);
151 if (x !=
src.x || y !=
src.y || z !=
src.z)
159 if (x !=
src.x || y !=
src.y || z !=
src.z)
168 double(z)*
vect.x -
double(x)*
vect.z,
169 double(x)*
vect.y -
double(y)*
vect.x);
224 return C3DTVector(
double(x)*weight,
double(y)*weight,
double(z)*weight);
229 return (
double(x)*
vect.x +
double(y)*
vect.y +
double(z)*
vect.z);
234 return C3DTVector(x/weight, y/weight, z/weight);
239 x = (
TYPE)(x * weight);
240 y = (
TYPE)(y * weight);
241 z = (
TYPE)(z * weight);
248 x = (
TYPE)(x / weight);
249 y = (
TYPE)(y / weight);
250 z = (
TYPE)(z / weight);
258 return (
double(x) *
vect.x +
double(y) *
vect.y +
double(z) *
vect.z);
391 return sqrt(
double(x)*x +
double(y)*y +
double(z)*z);
396 return (
double(x)*x +
double(y)*y +
double(z)*z);
414 else if (result < -1.0)
423 double length = Length();
424 if (length > PRECISION_LIMIT)
426 x = (
TYPE)(x/length);
427 y = (
TYPE)(y/length);
428 z = (
TYPE)(z/length);
434 MOOTOOLS_PRIVATE_TRACE(
"Warning null vector in 3DVector.Cpp\n");
468END_MOOTOOLS_NAMESPACE
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
bool IsInfinite() const
Check if one of the coordinate has inf value.
Definition 3DPoint.inl:186
bool IsNan(bool resetToZero=false)
Check if one of the coordinate has nan value. resetToZero nan = true, reset coordinates to zero if an...
Definition 3DPoint.inl:194
bool IsInfinite() const
Check if one of the coordinate has inf value.
Definition 3DVector.inl:338
C3DTVector Negate() const
/ operator - : return negate of each component (-x, -y, -z)
Definition 3DVector.inl:104
bool Normalize()
Return false if vector length is null.
Definition 3DVector.inl:421
bool IsNull(double precision=PRECISION_LIMIT) const
Compare vector to (0.0, 0.0, 0.0). Return true if equal, false otherwise.
Definition 3DVector.inl:439
C3DTVector Mult(const C3DTVector &vector) const
Multiply each component (x, y, z) with vect(x, y, z). This is not the scalar product !
Definition 3DVector.inl:256
bool IsNan(bool resetToZero=false)
Check if one of the coordinate has nan value. resetToZero nan = true, reset coordinates to zero if an...
Definition 3DVector.inl:346
C3DTVector Div(const C3DTVector &vector, bool checkZero=true) const
Divide each component (x, y, z) with vect(x, y, z). This is not the scalar product !
Definition 3DVector.inl:261
C3DTVector & SelfDiv(const C3DTVector &vector, bool checkZero=true)
Self divide each component (x, y, z) with vect(x, y, z). This is not the scalar product !
Definition 3DVector.inl:293
void Offset(TYPE value)
Add value to x, y, z.
Definition 3DVector.inl:322
C3DTVector Invert() const
/ operator / : return invert each component (1/x, 1/y, 1/z)
Definition 3DVector.inl:118
void SetValues(const TYPE2 *values3t)
Set vector from 3 TYPE.
Definition 3DVector.inl:76
void SelfInvert()
/ operator / : invert each component (1/x, 1/y, 1/z)
Definition 3DVector.inl:97
void SelfNegate()
/ operator - : negate each component (-x, -y, -z)
Definition 3DVector.inl:90
C3DTVector NegateCheckZeroSign() const
/ operator - : return negate of each component (-x, -y, -z). If a component is 0, it return a +0,...
Definition 3DVector.inl:109
bool IsNormalized(double precision=FLOAT_EPSILON) const
Check if vector normalized. Return true if normalized, false otherwise.
Definition 3DVector.inl:447
bool IsAnormal() const
either infinite or nan. Zero and denormalized value are allowed.
Definition 3DVector.inl:329
C3DTVector & SelfMult(const C3DTVector &vector)
Self multiply each component (x, y, z) with vect(x, y, z). This is not the scalar product !...
Definition 3DVector.inl:284
bool IsUnit(double precision=PRECISION_LIMIT) const
Compare vector to (1.0, 1.0, 1.0). Return true if equal, false otherwise.
Definition 3DVector.inl:455
C3DTVector InvertCheckZeroSign() const
/ operator / : return invert each component (1/x, 1/y, 1/z). If a component is -0,...
Definition 3DVector.inl:123
void SubstractTo(const C3DTVector &vect)
return this = vect-this, instead this = this-vect. This can be used for fast computation (using the s...
Definition 3DVector.inl:179