cgv
Loading...
Searching...
No Matches
cgv::media::plane< T > Class Template Reference

A plane of arbitrary dimension stored as a homogeneous vector that defines the coefficients of the plane equation. More...

#include <plane.h>

Public Member Functions

 plane (int dim=3)
 construct plane of give dimension allocating a homogenous vector of one dimension mor
 
 plane (const cgv::math::vec< T > &n, const T &distance)
 construct from normal vector and distance of plane to origin, which is negated before it is copied to the last component of the stored homogenous vector
 
cgv::math::vec< T > get_normal () const
 return the normal vector
 
get_distance () const
 return the distance of the plane to the origin
 

Public Attributes

cgv::math::vec< T > h
 

Detailed Description

template<class T>
class cgv::media::plane< T >

A plane of arbitrary dimension stored as a homogeneous vector that defines the coefficients of the plane equation.

Definition at line 13 of file plane.h.

Constructor & Destructor Documentation

◆ plane() [1/2]

template<class T >
cgv::media::plane< T >::plane ( int  dim = 3)
inline

construct plane of give dimension allocating a homogenous vector of one dimension mor

Definition at line 18 of file plane.h.

References cgv::math::vec< T >::resize().

◆ plane() [2/2]

template<class T >
cgv::media::plane< T >::plane ( const cgv::math::vec< T > &  n,
const T &  distance 
)
inline

construct from normal vector and distance of plane to origin, which is negated before it is copied to the last component of the stored homogenous vector

Definition at line 25 of file plane.h.

References cgv::math::vec< T >::resize(), and cgv::math::vec< T >::size().

Member Function Documentation

◆ get_distance()

template<class T >
T cgv::media::plane< T >::get_distance ( ) const
inline

return the distance of the plane to the origin

Definition at line 42 of file plane.h.

References cgv::math::vec< T >::size().

◆ get_normal()

template<class T >
cgv::math::vec< T > cgv::media::plane< T >::get_normal ( ) const
inline

return the normal vector

Definition at line 33 of file plane.h.

References cgv::math::vec< T >::resize(), and cgv::math::vec< T >::size().

Member Data Documentation

◆ h

template<class T >
cgv::math::vec<T> cgv::media::plane< T >::h

Definition at line 16 of file plane.h.


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