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_);
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
182 int getMaxIndex()
const;
198 #if GEOM_PSEUDO3D==GEOM_TRUE
214 #if GEOM_PSEUDO3D==GEOM_TRUE
229 #if GEOM_PSEUDO3D==GEOM_TRUE
230 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
276 inline Vector2 crossProduct(
const Vector2& vec0,
const Vector2& vec1)
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();
281 return Vector2(x,y,z);
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 operator+(const Vector2 &vec0, const Vector2 &vec1)
Addition.
Definition: Vector2.h:326
Vector2 operator-(const Vector2 &in)
Opposite vector.
Definition: Vector2.h:292
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(const Vector2 &v_)
Copy constructor.
Vector2()
Default constructor.
Vector2 orthogonalVector() const
Get a normalized, orthogonal 2D vector (CCW direction)
void set(const double x_, const double y_)
Set the components.
bool isDegenerate() const
Check if the vector is degenerate.
Vector2 operator*(double val) const
Multiplication by a scalar.
double y() const
Get the y-value.
double operator*(const Vector2 &other) const
Scalar product.
Vector2 & operator=(const Vector2 &other)
Assignment operator.
double length() const
Get the length of the vector.
Vector2(const double x_, const double y_)
Constructor.
double x() const
Get the x-value.
Vector2 operator/(double val) const
Division by a scalar.