Go to the documentation of this file.
40 class LX_GEOM_EXPORT
Vec
60 Vec(
const double Xv,
const double Yv,
const double Zv);
73 void setCoord(
const int Index,
const double Xi);
76 void setCoord(
const double Xv,
const double Yv,
const double Zv);
90 double coord(
const int Index)
const;
92 void coord(
double& Xv,
double& Yv,
double& Zv)
const;
111 bool isEqual(
const Vec& Other,
const double LinearTolerance,
const double AngularTolerance)
const;
116 bool isNormal(
const Vec& Other,
const double AngularTolerance)
const;
178 Vec operator*(
const double Scalar)
const {
return multiplied(Scalar); }
343 double x = v1.
x() - v2.
x(), y = v1.
y() - v2.
y(), z = v1.
z() - v2.
z();
344 return static_cast<double>(sqrt((x * x) + (y * y) + (z * z)));
350 double x = v1.
x() - v2.
x(), y = v1.
y() - v2.
y(), z = v1.
z() - v2.
z();
351 return x * x + y * y + z * z;
void setCoord(const double Xv, const double Yv, const double Zv)
void setXYZ(const Geom::XYZ &Coord)
Assigns the three coordinates of Coord to this vector.
Vec transformed(const Geom::Trsf &T) const
Transforms a vector with the transformation T.
Vec divided(const double Scalar) const
Divides a vector by a scalar //! computes the cross product between two vectors
Vec multiplied(const double Scalar) const
Multiplies a vector by a scalar //! Divides a vector by a scalar
Vec operator/(const double Scalar) const
Definition: Vec.h:186
void add(const Vec &Other)
double operator*(const Vec &Other) const
Definition: Vec.h:214
double & operator[](int i)
void subtract(const Vec &Right)
double distanceToLine(const Geom::Vec &rclBase, const Geom::Vec &rclDirect) const
Computes the distance from this point to the line given by rclBase and rclDirect.
void setCoord(const int Index, const double Xi)
Vec(const Vec &rhs)
Copy constructor.
Vec rotated(const Geom::Ax1 &A1, const double Ang) const
bool isEqual(const Vec &Other, const double LinearTolerance, const double AngularTolerance) const
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Vec(const Geom::Dir &V)
Creates a unitary vector from a direction V.
Vec(const Geom::Pnt &P1, const Geom::Pnt &P2)
Vec(const double Xv, const double Yv, const double Zv)
Creates a point with its three Cartesian coordinates.
double squareMagnitude() const
Computes the square magnitude of this vector. //! Adds two vectors
Vec operator^(const Vec &Right) const
Definition: Vec.h:194
double dotCross(const Vec &V1, const Vec &V2) const
Vec subtracted(const Vec &Right) const
Subtracts two vectors //! Multiplies a vector by a scalar
Vec mirrored(const Geom::Ax2 &A2) const
X
Definition: Globals.h:29
double crossMagnitude(const Vec &Right) const
Vec crossCrossed(const Vec &V1, const Vec &V2) const
Vec crossed(const Vec &Right) const
computes the cross product between two vectors
double x() const
For this vector, returns its X coordinate.
double magnitude() const
Computes the magnitude of this vector.
void operator-=(const Vec &Right)
Definition: Vec.h:166
Vec operator*(const double Scalar) const
Definition: Vec.h:178
Vec reversed() const
Reverses the direction of a vector
double angleWithRef(const Vec &Other, const Vec &VRef) const
void cross(const Vec &Right)
void setLinearForm(const double A1, const Vec &V1, const double A2, const Vec &V2, const double A3, const Vec &V3)
void crossCross(const Vec &V1, const Vec &V2)
const Geom::XYZ & xyz() const
void operator/=(const double Scalar)
Definition: Vec.h:182
bool isNormal(const Vec &Other, const double AngularTolerance) const
void mirror(const Vec &V)
void setLinearForm(const Vec &V1, const Vec &V2)
<me> is setted to the following linear form : V1 + V2
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Vec mirrored(const Geom::Ax1 &A1) const
double coord(const int Index) const
Vec operator-(const Vec &Right) const
Definition: Vec.h:170
Vec mirrored(const Vec &V) const
void setZ(const double Z)
Assigns the given value to the X coordinate of this vector.
Geom::Vec perpendicular(const Geom::Vec &rclBase, const Geom::Vec &rclDir) const
Z
Definition: Globals.h:31
void setLinearForm(const double A1, const Vec &V1, const Vec &V2)
<me> is setted to the following linear form : A1 * V1 + V2
double distance(const Geom::Vec &v1, const Geom::Vec &v2)
Returns the distance between two points.
Definition: Vec.h:341
void operator^=(const Vec &Right)
Definition: Vec.h:190
double crossSquareMagnitude(const Vec &Right) const
void mirror(const Geom::Ax2 &A2)
void setY(const double Y)
Assigns the given value to the X coordinate of this vector.
void operator+=(const Vec &Other)
Definition: Vec.h:158
void divide(const double Scalar)
void setX(const double X)
Assigns the given value to the X coordinate of this vector.
Y
Definition: Globals.h:30
Geom::Vec operator*(const double Scalar, const Geom::Vec &V)
Definition: Vec.h:357
void setLinearForm(const double A1, const Vec &V1, const double A2, const Vec &V2)
void multiply(const double Scalar)
Geom::Vec distanceToLineSegment(const Geom::Vec &rclP1, const Geom::Vec &rclP2) const
double y() const
For this vector, returns its Y coordinate.
double z() const
For this vector, returns its Z coordinate.
bool isOpposite(const Vec &Other, const double AngularTolerance) const
Vec operator+(const Vec &Other) const
Definition: Vec.h:162
double dot(const Vec &Other) const
computes the scalar product
void rotate(const Geom::Ax1 &A1, const double Ang)
double angle(const Vec &Other) const
LX_GEOM_EXPORT QString to_string(const Dir &dir)
Vec added(const Vec &Other) const
Adds two vectors //! Subtracts two vectors
Vec(const Geom::XYZ &Coord)
Creates a vector with a triplet of coordinates.
void setLinearForm(const double A1, const Vec &V1, const double A2, const Vec &V2, const Vec &V3)
void setLinearForm(const double A1, const Vec &V1, const double A2, const Vec &V2, const double A3, const Vec &V3, const Vec &V4)
void mirror(const Geom::Ax1 &A1)
void transform(const Geom::Trsf &T)
void scale(const double S)
Vec operator-() const
Definition: Vec.h:230
double distanceToPlane(const Geom::Vec &rclBase, const Geom::Vec &rclNorm) const
void operator*=(const double Scalar)
Definition: Vec.h:174
bool isParallel(const Vec &Other, const double AngularTolerance) const
Vec()
Creates an indefinite vector.
Vec scaled(const double S) const
Scales a vector. S is the scaling value. //! Transforms a vector with the transformation T.
Geom::Vec & projectToLine(const Geom::Vec &rclPoint, const Geom::Vec &rclLine)
Projects this point onto the line given by the base rclPoint and the direction rclLine.
void coord(double &Xv, double &Yv, double &Zv) const
For this vector returns its three coordinates Xv, Yv, and Zvinline
Definition: PropertyContainer.h:33
double distanceP2(const Geom::Vec &v1, const Geom::Vec &v2)
Returns the squared distance between two points.
Definition: Vec.h:348