Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.74
GEOM_FADE25D::Vector2 Class Reference

Vector. More...

#include <Vector2.h>

Public Member Functions

 Vector2 (const double x_, const double y_, const double z_)
 Constructor. More...
 Vector2 ()
 Default constructor. More...
 Vector2 (const Vector2 &v_)
 Copy constructor. More...
Vector2 orthogonalVector () const
 Get an orthogonal vector (CCW direction) More...
bool isDegenerate () const
 isDegenerate More...
double x () const
 Get the x-value.
double y () const
 Get the y-value.
double z () const
 Get the z-value.
void set (const double x_, const double y_, const double z_)
 Set the values.
double sqLength () const
 Get the squared length of the vector.
int getMaxIndex () const
 Get max index. More...
double length () const
 Get the length of the vector.
double operator* (const Vector2 &other) const
 Scalar product.
Vector2 operator* (double val) const
 Multiply by a scalar value.
Vector2 operator/ (double val) const
 Divide by a scalar value.

Protected Attributes

double valX
double valY
double valZ

Detailed Description

This class represents a vector in 2D

Constructor & Destructor Documentation

◆ Vector2() [1/3]

GEOM_FADE25D::Vector2::Vector2 ( const double  x_,
const double  y_,
const double  z_ 

◆ Vector2() [2/3]

GEOM_FADE25D::Vector2::Vector2 ( )

The vector is initialized to (0,0,0)

◆ Vector2() [3/3]

GEOM_FADE25D::Vector2::Vector2 ( const Vector2 v_)

Create a copy of vector v_

Member Function Documentation

◆ getMaxIndex()

int GEOM_FADE25D::Vector2::getMaxIndex ( ) const
the index of the largest component (0,1 or 2)

◆ isDegenerate()

bool GEOM_FADE25D::Vector2::isDegenerate ( ) const
true if the vector length is 0, false otherwise.

◆ orthogonalVector()

Vector2 GEOM_FADE25D::Vector2::orthogonalVector ( ) const
: Only (x,y) coordinates are computed, z=0

The documentation for this class was generated from the following file: