Openholo  v4.2
Open Source Digital Holographic Library
oph::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 &)
 
 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 &)
 
 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 &)
 
 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

structure for 2-dimensional Real type vector and its arithmetic.

Definition at line 66 of file vec.h.

Constructor & Destructor Documentation

◆ vec2() [1/20]

oph::vec2::vec2 ( )
inline

Definition at line 70 of file vec.h.

◆ vec2() [2/20]

oph::vec2::vec2 ( Real  a)
inline

Definition at line 71 of file vec.h.

◆ vec2() [3/20]

oph::vec2::vec2 ( Real  v_1,
Real  v_2 
)
inline

Definition at line 72 of file vec.h.

◆ vec2() [4/20]

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

Definition at line 73 of file vec.h.

◆ vec2() [5/20]

oph::vec2::vec2 ( const vec2 a)
inline

Definition at line 74 of file vec.h.

◆ vec2() [6/20]

oph::vec2::vec2 ( )
inline

Definition at line 70 of file vec.h.

◆ vec2() [7/20]

oph::vec2::vec2 ( Real  a)
inline

Definition at line 71 of file vec.h.

◆ vec2() [8/20]

oph::vec2::vec2 ( Real  v_1,
Real  v_2 
)
inline

Definition at line 72 of file vec.h.

◆ vec2() [9/20]

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

Definition at line 73 of file vec.h.

◆ vec2() [10/20]

oph::vec2::vec2 ( const vec2 a)
inline

Definition at line 74 of file vec.h.

◆ vec2() [11/20]

oph::vec2::vec2 ( )
inline

Definition at line 70 of file vec.h.

◆ vec2() [12/20]

oph::vec2::vec2 ( Real  a)
inline

Definition at line 71 of file vec.h.

◆ vec2() [13/20]

oph::vec2::vec2 ( Real  v_1,
Real  v_2 
)
inline

Definition at line 72 of file vec.h.

◆ vec2() [14/20]

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

Definition at line 73 of file vec.h.

◆ vec2() [15/20]

oph::vec2::vec2 ( const vec2 a)
inline

Definition at line 74 of file vec.h.

◆ vec2() [16/20]

oph::vec2::vec2 ( )
inline

Definition at line 70 of file vec.h.

◆ vec2() [17/20]

oph::vec2::vec2 ( Real  a)
inline

Definition at line 71 of file vec.h.

◆ vec2() [18/20]

oph::vec2::vec2 ( Real  v_1,
Real  v_2 
)
inline

Definition at line 72 of file vec.h.

◆ vec2() [19/20]

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

Definition at line 73 of file vec.h.

◆ vec2() [20/20]

oph::vec2::vec2 ( const vec2 a)
inline

Definition at line 74 of file vec.h.

Member Function Documentation

◆ is_parallel() [1/4]

int oph::vec2::is_parallel ( const vec2 vv,
Real  angle_tolerance = angle_tolerance 
) const

Definition at line 67 of file vec.cpp.

◆ is_parallel() [2/4]

int oph::vec2::is_parallel ( const vec2 ,
Real  = angle_tolerance 
) const

◆ is_parallel() [3/4]

int oph::vec2::is_parallel ( const vec2 ,
Real  = angle_tolerance 
) const

◆ is_parallel() [4/4]

int oph::vec2::is_parallel ( const vec2 ,
Real  = angle_tolerance 
) const

◆ is_perpendicular() [1/4]

bool oph::vec2::is_perpendicular ( const vec2 ,
Real  = angle_tolerance 
) const

◆ is_perpendicular() [2/4]

bool oph::vec2::is_perpendicular ( const vec2 vv,
Real  angle_tolerance = angle_tolerance 
) const

Definition at line 89 of file vec.cpp.

◆ is_perpendicular() [3/4]

bool oph::vec2::is_perpendicular ( const vec2 ,
Real  = angle_tolerance 
) const

◆ is_perpendicular() [4/4]

bool oph::vec2::is_perpendicular ( const vec2 ,
Real  = angle_tolerance 
) const

◆ is_tiny() [1/4]

bool oph::vec2::is_tiny ( Real  tiny_tol = epsilon) const
inline

Definition at line 87 of file vec.h.

◆ is_tiny() [2/4]

bool oph::vec2::is_tiny ( Real  tiny_tol = epsilon) const
inline

Definition at line 87 of file vec.h.

◆ is_tiny() [3/4]

bool oph::vec2::is_tiny ( Real  tiny_tol = epsilon) const
inline

Definition at line 87 of file vec.h.

◆ is_tiny() [4/4]

bool oph::vec2::is_tiny ( Real  tiny_tol = epsilon) const
inline

Definition at line 87 of file vec.h.

◆ is_zero() [1/4]

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

Definition at line 86 of file vec.h.

◆ is_zero() [2/4]

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

Definition at line 86 of file vec.h.

◆ is_zero() [3/4]

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

Definition at line 86 of file vec.h.

◆ is_zero() [4/4]

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

Definition at line 86 of file vec.h.

◆ length() [1/4]

Real oph::vec2::length ( ) const

Definition at line 62 of file vec.cpp.

◆ length() [2/4]

Real oph::vec2::length ( ) const

◆ length() [3/4]

Real oph::vec2::length ( ) const

◆ length() [4/4]

Real oph::vec2::length ( ) const

◆ operator()() [1/8]

Real& oph::vec2::operator() ( int  i)
inline

Definition at line 80 of file vec.h.

◆ operator()() [2/8]

Real& oph::vec2::operator() ( int  i)
inline

Definition at line 80 of file vec.h.

◆ operator()() [3/8]

Real& oph::vec2::operator() ( int  i)
inline

Definition at line 80 of file vec.h.

◆ operator()() [4/8]

Real& oph::vec2::operator() ( int  i)
inline

Definition at line 80 of file vec.h.

◆ operator()() [5/8]

const Real& oph::vec2::operator() ( int  i) const
inline

Definition at line 81 of file vec.h.

◆ operator()() [6/8]

const Real& oph::vec2::operator() ( int  i) const
inline

Definition at line 81 of file vec.h.

◆ operator()() [7/8]

const Real& oph::vec2::operator() ( int  i) const
inline

Definition at line 81 of file vec.h.

◆ operator()() [8/8]

const Real& oph::vec2::operator() ( int  i) const
inline

Definition at line 81 of file vec.h.

◆ operator=() [1/4]

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

Definition at line 77 of file vec.h.

◆ operator=() [2/4]

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

Definition at line 77 of file vec.h.

◆ operator=() [3/4]

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

Definition at line 77 of file vec.h.

◆ operator=() [4/4]

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

Definition at line 77 of file vec.h.

◆ operator[]() [1/8]

Real& oph::vec2::operator[] ( int  i)
inline

Definition at line 78 of file vec.h.

◆ operator[]() [2/8]

Real& oph::vec2::operator[] ( int  i)
inline

Definition at line 78 of file vec.h.

◆ operator[]() [3/8]

Real& oph::vec2::operator[] ( int  i)
inline

Definition at line 78 of file vec.h.

◆ operator[]() [4/8]

Real& oph::vec2::operator[] ( int  i)
inline

Definition at line 78 of file vec.h.

◆ operator[]() [5/8]

const Real& oph::vec2::operator[] ( int  i) const
inline

Definition at line 79 of file vec.h.

◆ operator[]() [6/8]

const Real& oph::vec2::operator[] ( int  i) const
inline

Definition at line 79 of file vec.h.

◆ operator[]() [7/8]

const Real& oph::vec2::operator[] ( int  i) const
inline

Definition at line 79 of file vec.h.

◆ operator[]() [8/8]

const Real& oph::vec2::operator[] ( int  i) const
inline

Definition at line 79 of file vec.h.

◆ perpendicular() [1/8]

bool oph::vec2::perpendicular ( const vec2 )

◆ perpendicular() [2/8]

bool oph::vec2::perpendicular ( const vec2 )

◆ perpendicular() [3/8]

bool oph::vec2::perpendicular ( const vec2 )

◆ perpendicular() [4/8]

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

Definition at line 107 of file vec.cpp.

◆ perpendicular() [5/8]

bool oph::vec2::perpendicular ( const vec2 ,
const vec2  
)

◆ perpendicular() [6/8]

bool oph::vec2::perpendicular ( const vec2 ,
const vec2  
)

◆ perpendicular() [7/8]

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

Definition at line 118 of file vec.cpp.

◆ perpendicular() [8/8]

bool oph::vec2::perpendicular ( const vec2 ,
const vec2  
)

◆ unit() [1/4]

bool oph::vec2::unit ( )

◆ unit() [2/4]

bool oph::vec2::unit ( )

◆ unit() [3/4]

bool oph::vec2::unit ( )

Definition at line 53 of file vec.cpp.

◆ unit() [4/4]

bool oph::vec2::unit ( )

Member Data Documentation

◆ n

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

Definition at line 68 of file vec.h.

◆ v

Real oph::vec2::v

Definition at line 67 of file vec.h.


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