HologramDepthmap Library
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
graphics::vec2 Struct Reference

structure for 2-dimensional real type vector and its arithmetic. More...

#include <vec.h>

Public Member Functions

 vec2 ()
 
 vec2 (real a)
 
 vec2 (real v_1, real v_2)
 
 vec2 (const ivec2 &a)
 
 vec2 (const vec2 &a)
 
vec2operator= (const vec2 &a)
 
realoperator[] (int i)
 
const realoperator[] (int i) const
 
realoperator() (int i)
 
const realoperator() (int i) const
 
bool unit ()
 
real length () const
 
bool is_zero () const
 
bool is_tiny (real tiny_tol=epsilon) const
 
int is_parallel (const vec2 &, real=angle_tolerance) const
 
bool is_perpendicular (const vec2 &, real=angle_tolerance) const
 
bool perpendicular (const vec2 &)
 
bool perpendicular (const vec2 &, const vec2 &)
 

Public Attributes

real v [2]
 

Static Public Attributes

static const int n = 2
 

Detailed Description

Definition at line 22 of file vec.h.

Constructor & Destructor Documentation

◆ vec2() [1/5]

graphics::vec2::vec2 ( )
inline

Definition at line 26 of file vec.h.

◆ vec2() [2/5]

graphics::vec2::vec2 ( real  a)
inline

Definition at line 27 of file vec.h.

◆ vec2() [3/5]

graphics::vec2::vec2 ( real  v_1,
real  v_2 
)
inline

Definition at line 32 of file vec.h.

◆ vec2() [4/5]

graphics::vec2::vec2 ( const ivec2 a)
inline

Definition at line 37 of file vec.h.

◆ vec2() [5/5]

graphics::vec2::vec2 ( const vec2 a)
inline

Definition at line 42 of file vec.h.

Member Function Documentation

◆ is_parallel()

int graphics::vec2::is_parallel ( const vec2 vv,
real  angle_tolerance = angle_tolerance 
) const

Definition at line 22 of file vec.cpp.

◆ is_perpendicular()

bool graphics::vec2::is_perpendicular ( const vec2 vv,
real  angle_tolerance = angle_tolerance 
) const

Definition at line 44 of file vec.cpp.

◆ is_tiny()

bool graphics::vec2::is_tiny ( real  tiny_tol = epsilon) const
inline

Definition at line 62 of file vec.h.

◆ is_zero()

bool graphics::vec2::is_zero ( ) const
inline

Definition at line 61 of file vec.h.

◆ length()

real graphics::vec2::length ( ) const

Definition at line 17 of file vec.cpp.

◆ operator()() [1/2]

real& graphics::vec2::operator() ( int  i)
inline

Definition at line 55 of file vec.h.

◆ operator()() [2/2]

const real& graphics::vec2::operator() ( int  i) const
inline

Definition at line 56 of file vec.h.

◆ operator=()

vec2& graphics::vec2::operator= ( const vec2 a)
inline

Definition at line 47 of file vec.h.

◆ operator[]() [1/2]

real& graphics::vec2::operator[] ( int  i)
inline

Definition at line 53 of file vec.h.

◆ operator[]() [2/2]

const real& graphics::vec2::operator[] ( int  i) const
inline

Definition at line 54 of file vec.h.

◆ perpendicular() [1/2]

bool graphics::vec2::perpendicular ( const vec2 vv)

Definition at line 62 of file vec.cpp.

◆ perpendicular() [2/2]

bool graphics::vec2::perpendicular ( const vec2 p,
const vec2 q 
)

Definition at line 73 of file vec.cpp.

◆ unit()

bool graphics::vec2::unit ( )

Definition at line 8 of file vec.cpp.

Member Data Documentation

◆ n

const int graphics::vec2::n = 2
static

Definition at line 24 of file vec.h.

◆ v

real graphics::vec2::v[2]

Definition at line 23 of file vec.h.


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