23 #if GEOM_PSEUDO3D==GEOM_TRUE
24 namespace GEOM_FADE25D {
25 #elif GEOM_PSEUDO3D==GEOM_FALSE
26 namespace GEOM_FADE2D {
28 #error GEOM_PSEUDO3D is not defined
32 class CLASS_DECLSPEC Vector2;
50 #if GEOM_PSEUDO3D==GEOM_TRUE
57 Vector2(
const double x_,
const double y_,
const double z_);
81 Vector2(
const double x_,
const double y_);
140 #if GEOM_PSEUDO3D==GEOM_TRUE
149 #if GEOM_PSEUDO3D==GEOM_TRUE
156 void set(
const double x_,
const double y_,
const double z_);
165 void set(
const double x_,
const double y_);
175 #if GEOM_PSEUDO3D==GEOM_TRUE
198 #if GEOM_PSEUDO3D==GEOM_TRUE
214 #if GEOM_PSEUDO3D==GEOM_TRUE
229 #if GEOM_PSEUDO3D==GEOM_TRUE
233 Vector2 operator/(
double val)
const;
239 #if GEOM_PSEUDO3D==GEOM_TRUE
259 #if GEOM_PSEUDO3D==GEOM_TRUE
260 stream <<
"Vector2: "<<vec.
x()<<
", "<<vec.
y()<<
", "<<vec.
z();
262 stream <<
"Vector2: "<<vec.
x()<<
", "<<vec.
y();
267 #if GEOM_PSEUDO3D==GEOM_TRUE
278 double x=vec0.
y() * vec1.
z() - vec0.
z() * vec1.
y();
279 double y=vec0.
z() * vec1.
x() - vec0.
x() * vec1.
z();
280 double z=vec0.
x() * vec1.
y() - vec0.
y() * vec1.
x();
294 #if GEOM_PSEUDO3D==GEOM_TRUE
311 #if GEOM_PSEUDO3D==GEOM_TRUE
312 return Vector2(d*vec.
x(),d*vec.
y(),d*vec.
z());
328 #if GEOM_PSEUDO3D==GEOM_TRUE
329 return Vector2(vec0.
x()+vec1.
x(), vec0.
y()+vec1.
y() , vec0.
z()+vec1.
z());
331 return Vector2(vec0.
x()+vec1.
x(), vec0.
y()+vec1.
y() );
345 #if GEOM_PSEUDO3D==GEOM_TRUE
346 return Vector2(vec0.
x()-vec1.
x(), vec0.
y()-vec1.
y() , vec0.
z()-vec1.
z());
348 return Vector2(vec0.
x()-vec1.
x(), vec0.
y()-vec1.
y() );
std::ostream & operator<<(std::ostream &stream, const Bbox2 &pC)
Prints the bounding box to a stream.
Definition: Bbox2.h:605
Vector2 crossProduct(const Vector2 &vec0, const Vector2 &vec1)
Cross product.
Definition: Vector2.h:276
Vector2 operator-(const Vector2 &in)
Opposite vector.
Definition: Vector2.h:292
Vector2 operator+(const Vector2 &vec0, const Vector2 &vec1)
Addition.
Definition: Vector2.h:326
Vector2 operator*(double d, const Vector2 &vec)
Multiplication with a scalar.
Definition: Vector2.h:309
Vector.
Definition: Vector2.h:47
double sqLength() const
Get the squared length of the vector.
Vector2()
Default constructor.
double x() const
Get the x-value.
bool isDegenerate() const
Check if the vector is degenerate.
double y() const
Get the y-value.
double z() const
Get the z-value.
Vector2 orthogonalVector() const
Get a normalized, orthogonal 2D vector (CCW direction)
double length() const
Get the length of the vector.
Vector2(const double x_, const double y_, const double z_)
Constructor.
Vector2 operator/(double val) const
Division by a scalar.
Vector2 operator*(double val) const
Multiplication by a scalar.
double operator*(const Vector2 &other) const
Scalar product.
void set(const double x_, const double y_, const double z_)
Set the components.
Vector2 & operator=(const Vector2 &other)
Assignment operator.
int getMaxIndex() const
Get the index of the largest absolute component.
Vector2(const Vector2 &v_)
Copy constructor.