Openholo  v5.0
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 &)
 

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/5]

oph::vec2::vec2 ( )
inline

Definition at line 70 of file vec.h.

◆ vec2() [2/5]

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

Definition at line 71 of file vec.h.

◆ vec2() [3/5]

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

Definition at line 72 of file vec.h.

◆ vec2() [4/5]

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

Definition at line 73 of file vec.h.

◆ vec2() [5/5]

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

Definition at line 74 of file vec.h.

Member Function Documentation

◆ is_parallel()

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

Definition at line 67 of file vec.cpp.

◆ is_perpendicular()

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

Definition at line 89 of file vec.cpp.

◆ is_tiny()

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

Definition at line 87 of file vec.h.

◆ is_zero()

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

Definition at line 86 of file vec.h.

◆ length()

Real oph::vec2::length ( ) const

Definition at line 62 of file vec.cpp.

◆ operator()() [1/2]

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

Definition at line 80 of file vec.h.

◆ operator()() [2/2]

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

Definition at line 81 of file vec.h.

◆ operator=()

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

Definition at line 77 of file vec.h.

◆ operator[]() [1/2]

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

Definition at line 78 of file vec.h.

◆ operator[]() [2/2]

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

Definition at line 79 of file vec.h.

◆ perpendicular() [1/2]

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

Definition at line 107 of file vec.cpp.

◆ perpendicular() [2/2]

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

Definition at line 118 of file vec.cpp.

◆ unit()

bool oph::vec2::unit ( )

Definition at line 53 of file vec.cpp.

Member Data Documentation

◆ n

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

Definition at line 68 of file vec.h.

◆ v

Real oph::vec2::v[2]

Definition at line 67 of file vec.h.


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