Fade2.5D Documentation pages v2.16.7
Delaunay Features
GEOM_FADE25D::Vector2 Class Reference

Vector. More...

#include <Vector2.h>

Public Member Functions

 Vector2 ()
 Default constructor. More...
 
 Vector2 (const double x_, const double y_, const double z_)
 Constructor. More...
 
 Vector2 (const Vector2 &v_)
 Copy constructor. More...
 
int getMaxIndex () const
 Get the index of the largest absolute component. More...
 
bool isDegenerate () const
 Check if the vector is degenerate. More...
 
double length () const
 Get the length of the vector. More...
 
double operator* (const Vector2 &other) const
 Scalar product. More...
 
Vector2 operator* (double val) const
 Multiplication by a scalar. More...
 
Vector2 operator/ (double val) const
 Division by a scalar. More...
 
Vector2operator= (const Vector2 &other)
 Assignment operator. More...
 
Vector2 orthogonalVector () const
 Get a normalized, orthogonal 2D vector (CCW direction) More...
 
void set (const double x_, const double y_, const double z_)
 Set the components. More...
 
double sqLength () const
 Get the squared length of the vector. More...
 
double x () const
 Get the x-value. More...
 
double y () const
 Get the y-value. More...
 
double z () const
 Get the z-value. More...
 

Protected Attributes

double valX
 
double valY
 
double valZ
 

Detailed Description

This class represents a 2.5D vector.

Constructor & Destructor Documentation

◆ Vector2() [1/3]

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

Constructs a vector with the given x, y, and z components.

Parameters
x_,y_,z_The coordinates of the vector.

◆ Vector2() [2/3]

GEOM_FADE25D::Vector2::Vector2 ( )

Initializes the vector to (0, 0, 0).

◆ Vector2() [3/3]

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

Creates a copy of the given vector.

Parameters
v_The vector to copy.

Member Function Documentation

◆ getMaxIndex()

int GEOM_FADE25D::Vector2::getMaxIndex ( ) const

Returns the index of the largest absolute component (0 for x, 1 for y, or 2 for z).

Returns
The index of the largest absolute component of the vector.

◆ isDegenerate()

bool GEOM_FADE25D::Vector2::isDegenerate ( ) const

Checks if the vector is degenerate (i.e., has zero length).

Returns
true if the vector length is 0, false otherwise.

◆ length()

double GEOM_FADE25D::Vector2::length ( ) const
Returns
The length of the vector.

◆ operator*() [1/2]

double GEOM_FADE25D::Vector2::operator* ( const Vector2 other) const

Computes the scalar product of the current vector and another vector.

Parameters
otherThe other vector to compute the scalar product with.
Returns
The scalar product of the two vectors.

◆ operator*() [2/2]

Vector2 GEOM_FADE25D::Vector2::operator* ( double  val) const

Multiplies the vector by a scalar value.

Parameters
valThe scalar value to multiply by.
Returns
A new vector resulting from the multiplication.

◆ operator/()

Vector2 GEOM_FADE25D::Vector2::operator/ ( double  val) const

Divides the vector by a scalar value.

Parameters
valThe scalar value to divide by.
Returns
A new vector resulting from the division.

◆ operator=()

Vector2& GEOM_FADE25D::Vector2::operator= ( const Vector2 other)

Assigns the values of one vector to another.

Parameters
otherThe vector to copy.
Returns
The updated vector.

◆ orthogonalVector()

Vector2 GEOM_FADE25D::Vector2::orthogonalVector ( ) const

Computes a 2D Vector2 orthogonal to the current vector in a counterclockwise (CCW) direction. The z-coordinate is set to 0.

Returns
A Vector2 orthogonal to the current vector in CCW direction.

◆ set()

void GEOM_FADE25D::Vector2::set ( const double  x_,
const double  y_,
const double  z_ 
)

Sets the x, y, and z components of the vector.

Parameters
x_,y_,z_The components of the vector.

◆ sqLength()

double GEOM_FADE25D::Vector2::sqLength ( ) const
Returns
The squared length of the vector.

◆ x()

double GEOM_FADE25D::Vector2::x ( ) const
Returns
The x-coordinate of the vector.

◆ y()

double GEOM_FADE25D::Vector2::y ( ) const
Returns
The y-coordinate of the vector.

◆ z()

double GEOM_FADE25D::Vector2::z ( ) const
Returns
The z-coordinate of the vector.

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