maliput
Vector3 Class Reference

Detailed Description

A 3-dimensional vector.

#include <include/maliput/math/vector.h>

Inheritance diagram for Vector3:
[legend]

Public Member Functions

 Vector3 ()
 Constructs a null 3-dimensional vector. More...
 
 Vector3 (std::initializer_list< double > values)
 Constructs a 3-dimensional vector using initializing list;. More...
 
 Vector3 (std::array< double, 3 > values)
 Constructs a 3-dimensional vector from a std::array object;. More...
 
 Vector3 (double x, double y, double z)
 Constructs a 3-dimensional from double type arguments.;. More...
 
 Vector3 (const Vector< 3 > &other)
 Constructs a Vector3 from a Vector<3>. More...
 
double x () const
 
double y () const
 
double z () const
 
doublex ()
 
doubley ()
 
doublez ()
 
Vector3 cross (const Vector3 &v) const
 
- Public Member Functions inherited from VectorBase< 3, Vector3 >
 VectorBase ()
 Constructs a null N-dimensional vector. More...
 
 VectorBase (std::array< double, N > values)
 Constructs an N-dimensional vector from a std::array object;. More...
 
 VectorBase (std::initializer_list< double > values)
 Constructs an N-dimensional vector using initializing list;. More...
 
 VectorBase (const VectorBase< N, Vector3 > &other)=default
 Copy constructor. More...
 
 VectorBase (VectorBase< N, Vector3 > &&other)=default
 Move constructor. More...
 
double dot (const VectorBase< N, Vector3 > &vector) const
 
double norm () const
 
void normalize ()
 Divides each vector component by norm(). More...
 
Vector3 normalized () const
 
std::size_t size () const
 
std::array< double, N > to_array () const
 
Vector3operator= (const VectorBase< N, Vector3 > &other)
 Assignment operator overload. More...
 
Vector3operator= (const VectorBase< N, Vector3 > &&other)
 Move assignment operator overload. More...
 
double operator[] (std::size_t index) const
 Constant subscripting array operator overload. More...
 
doubleoperator[] (std::size_t index)
 Subscripting array operator overload. More...
 
bool operator== (const VectorBase< N, Vector3 > &vector) const
 Equality operator overload. More...
 
bool operator!= (const VectorBase< N, Vector3 > &vector) const
 Inequality operator overload. More...
 
Vector3 operator+ (const VectorBase< N, Vector3 > &vector) const
 Add operator overload. More...
 
Vector3operator+= (const VectorBase< N, Vector3 > &vector)
 Add and assignment operator overload. More...
 
Vector3 operator- (const VectorBase< N, Vector3 > &vector) const
 Substract operator overload. More...
 
Vector3 operator/ (double scalar) const
 Divide operator overload between a VectorBase<N, Derived> vector and a double. More...
 
std::string to_str () const
 

Static Public Member Functions

static Vector3 UnitX ()
 
static Vector3 UnitY ()
 
static Vector3 UnitZ ()
 
- Static Public Member Functions inherited from VectorBase< 3, Vector3 >
static Vector3 Zero ()
 
static Vector3 Ones ()
 
static Vector3 FromStr (const std::string &vector_str)
 Parses vector_str that should come in the following format "{A, B, C, ...}" (white spaces could or could not be there). More...
 

Additional Inherited Members

- Static Public Attributes inherited from VectorBase< 3, Vector3 >
static constexpr std::size_t kDimension
 The dimension of the vector. More...
 
- Protected Attributes inherited from VectorBase< 3, Vector3 >
std::array< double, N > values_
 

Constructor & Destructor Documentation

◆ Vector3() [1/5]

Vector3 ( )

Constructs a null 3-dimensional vector.

◆ Vector3() [2/5]

Vector3 ( std::initializer_list< double values)

Constructs a 3-dimensional vector using initializing list;.

◆ Vector3() [3/5]

Vector3 ( std::array< double, 3 >  values)

Constructs a 3-dimensional vector from a std::array object;.

◆ Vector3() [4/5]

Vector3 ( double  x,
double  y,
double  z 
)

Constructs a 3-dimensional from double type arguments.;.

◆ Vector3() [5/5]

Vector3 ( const Vector< 3 > &  other)

Constructs a Vector3 from a Vector<3>.

Member Function Documentation

◆ cross()

Vector3 cross ( const Vector3 v) const
Returns
this x v.

◆ UnitX()

Vector3 UnitX ( )
static
Returns
An unitary 3-dimensional vector with direction at x axis.

◆ UnitY()

Vector3 UnitY ( )
static
Returns
An unitary 3-dimensional vector with direction at y axis.

◆ UnitZ()

Vector3 UnitZ ( )
static
Returns
An unitary 3-dimensional vector with direction at z axis.

◆ x() [1/2]

double& x ( )
Returns
The x value by reference.

◆ x() [2/2]

double x ( ) const
Returns
The x value.

◆ y() [1/2]

double& y ( )
Returns
The y value by reference.

◆ y() [2/2]

double y ( ) const
Returns
The y value.

◆ z() [1/2]

double& z ( )
Returns
The z value by reference.

◆ z() [2/2]

double z ( ) const
Returns
The z value.

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