Parfis  v0.0.7
Public Member Functions | Public Attributes | Friends | List of all members
parfis::Vec3D< T > Struct Template Reference

Struct that represents a 3d vector with components of type T. More...

#include <datastruct.h>

Public Member Functions

len () const
 Returns the vector length in Eucledian metric. More...
 
lenSq () const
 Returns the squared vector length in Eucledian metric. More...
 

Public Attributes

x
 Variable x.
 
y
 Variable y.
 
z
 Variable z.
 

Friends

bool operator== (const Vec3D< T > &lhs, const Vec3D< T > &rhs)
 Compares if vectors are equal.
 
bool operator!= (const Vec3D< T > &lhs, const Vec3D< T > &rhs)
 Compares if vectors are not equal.
 
std::ostream & operator<< (std::ostream &os, const Vec3D< T > &vec)
 Oveload of std::out operator. More...
 

Detailed Description

template<class T>
struct parfis::Vec3D< T >

Struct that represents a 3d vector with components of type T.

The struct has three member variables x, y and z of type T.

Member Function Documentation

◆ len()

template<class T >
T parfis::Vec3D< T >::len ( ) const
inline

Returns the vector length in Eucledian metric.

The length is calculated as \( \sqrt{x^2 + y^2 + z^2} \)

◆ lenSq()

template<class T >
T parfis::Vec3D< T >::lenSq ( ) const
inline

Returns the squared vector length in Eucledian metric.

The length is calculated as \( x^2 + y^2 + z^2 \)

Friends And Related Function Documentation

◆ operator<<

template<class T >
std::ostream& operator<< ( std::ostream &  os,
const Vec3D< T > &  vec 
)
friend

Oveload of std::out operator.

Parameters
osOutput stream
vec3DVec to output
Returns
ostream&