SpinParser  1.0
Public Member Functions | Public Attributes | List of all members
geometry::Vec3< T > Struct Template Reference

Three-dimensional vector. More...

#include <Geometry.hpp>

Public Member Functions

 Vec3 ()
 Construct a new Vec3 object with uninitialized values.
 
 Vec3 (const T &xyz)
 Construct a new Vec3 object and initialize all numbers with the same value. More...
 
 Vec3 (const T &x, const T &y, const T &z)
 Construct a new Vec3 object and initialize numbers.
More...
 
norm () const
 Compute the Euclidean norm of a Vec3 object. More...
 
Vec3normalize ()
 Normalize the Vec3 object with respect to its Euclidean norm. More...
 

Public Attributes

x
 x Component.
 
y
 y Component.
 
z
 z Component.
 

Detailed Description

template<typename T>
struct geometry::Vec3< T >

Three-dimensional vector.

Template Parameters
TUnderlying fundamental data type.

Constructor & Destructor Documentation

◆ Vec3() [1/2]

template<typename T >
geometry::Vec3< T >::Vec3 ( const T &  xyz)
inline

Construct a new Vec3 object and initialize all numbers with the same value.

Parameters
xyzValue to initialize.

◆ Vec3() [2/2]

template<typename T >
geometry::Vec3< T >::Vec3 ( const T &  x,
const T &  y,
const T &  z 
)
inline

Construct a new Vec3 object and initialize numbers.

Parameters
xValue to initialize x component.
yValue to initialize y component.
zValue to initialize z component.

Member Function Documentation

◆ norm()

template<typename T >
T geometry::Vec3< T >::norm ( ) const
inline

Compute the Euclidean norm of a Vec3 object.

Returns
T Value of the norm.

◆ normalize()

template<typename T >
Vec3& geometry::Vec3< T >::normalize ( )
inline

Normalize the Vec3 object with respect to its Euclidean norm.

Returns
Vec3& Reference to self.

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