Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Public Attributes | List of all members
core_mathlib::vec2 Class Reference

2D Vector Vector defined with 2 float numbers More...

#include <mathlib.h>

Public Member Functions

 vec2 (void)
 
 vec2 (decimal _x, decimal _y)
 
 vec2 (const decimal *_v)
 
 vec2 (const vec2 &_v)
 
 vec2 (const vec2 &_v, const vec2 &_w)
 
 vec2 (const vec3 &_v)
 
 vec2 (const vec4 &_v)
 
int operator== (const vec2 &_v)
 
int operator!= (const vec2 &_v)
 
vec2operator= (decimal _f)
 
const vec2 operator* (decimal _f) const
 
const vec2 operator/ (decimal _f) const
 
const vec2 operator+ (const vec2 &_v) const
 
const vec2 operator- () const
 
const vec2 operator- (const vec2 &_v) const
 
decimal operator^ (const vec2 &_v) const
 
vec2operator*= (decimal _f)
 
vec2operator/= (decimal _f)
 
vec2operator+= (const vec2 &_v)
 
vec2operator-= (const vec2 &_v)
 
decimal operator* (const vec2 &_v) const
 
 operator decimal * ()
 
 operator const decimal * () const
 
decimaloperator[] (int _i)
 
const decimaloperator[] (int _i) const
 
void set (decimal _x, decimal _y)
 
void reset (void)
 
decimal length (void) const
 
decimal normalize (void)
 
decimal det (vec2 &v)
 2D determinant More...
 
decimal dot (const vec2 &v)
 Scalar product. More...
 
bool compare (const vec2 &_v, decimal epsi=EPSILON_6)
 
vec2 closestPointOnLine (const vec2 &vA, const vec2 &vB)
 Return the coordinates of the nearest point of *this on the line passing by vA and vB. More...
 
vec2 closestPointOnSegment (const vec2 &vA, const vec2 &vB)
 Return the coordinates of the nearest point of *this on the segment vA,vB. More...
 
decimal projectionOnLine (const vec2 &vA, const vec2 &vB)
 Return the projection factor of *this on the line passing by vA and vB. More...
 
vec2 lerp (vec2 &u, vec2 &v, decimal factor)
 Linear interpolation function between 2 vectors. More...
 
decimal angle (void)
 
decimal angle (const vec2 &v)
 

Public Attributes

union {
   struct {
      decimal   x
 
      decimal   y
 
   } 
 
   struct {
      decimal   s
 
      decimal   t
 
   } 
 
   decimal   v [2]
 
}; 
 

Detailed Description

2D Vector Vector defined with 2 float numbers

Definition at line 472 of file mathlib.h.

Constructor & Destructor Documentation

◆ vec2() [1/7]

core_mathlib::vec2::vec2 ( void  )
inline

Definition at line 475 of file mathlib.h.

Here is the caller graph for this function:

◆ vec2() [2/7]

core_mathlib::vec2::vec2 ( decimal  _x,
decimal  _y 
)
inline

Definition at line 476 of file mathlib.h.

◆ vec2() [3/7]

core_mathlib::vec2::vec2 ( const decimal _v)
inline

Definition at line 477 of file mathlib.h.

◆ vec2() [4/7]

core_mathlib::vec2::vec2 ( const vec2 _v)
inline

Definition at line 478 of file mathlib.h.

◆ vec2() [5/7]

core_mathlib::vec2::vec2 ( const vec2 _v,
const vec2 _w 
)
inline

Definition at line 479 of file mathlib.h.

◆ vec2() [6/7]

core_mathlib::vec2::vec2 ( const vec3 _v)
inline

Definition at line 678 of file mathlib.h.

◆ vec2() [7/7]

core_mathlib::vec2::vec2 ( const vec4 _v)
inline

Definition at line 897 of file mathlib.h.

Member Function Documentation

◆ angle() [1/2]

decimal core_mathlib::vec2::angle ( const vec2 v)
inline

Definition at line 640 of file mathlib.h.

◆ angle() [2/2]

decimal core_mathlib::vec2::angle ( void  )
inline

Definition at line 636 of file mathlib.h.

◆ closestPointOnLine()

vec2 core_mathlib::vec2::closestPointOnLine ( const vec2 vA,
const vec2 vB 
)
inline

Return the coordinates of the nearest point of *this on the line passing by vA and vB.

Definition at line 607 of file mathlib.h.

Here is the call graph for this function:

◆ closestPointOnSegment()

vec2 core_mathlib::vec2::closestPointOnSegment ( const vec2 vA,
const vec2 vB 
)
inline

Return the coordinates of the nearest point of *this on the segment vA,vB.

Definition at line 612 of file mathlib.h.

Here is the call graph for this function:

◆ compare()

bool core_mathlib::vec2::compare ( const vec2 _v,
decimal  epsi = EPSILON_6 
)
inline

Definition at line 602 of file mathlib.h.

◆ det()

decimal core_mathlib::vec2::det ( vec2 v)
inline

2D determinant

Definition at line 594 of file mathlib.h.

◆ dot()

decimal core_mathlib::vec2::dot ( const vec2 v)
inline

Scalar product.

Definition at line 598 of file mathlib.h.

◆ length()

decimal core_mathlib::vec2::length ( void  ) const
inline

Definition at line 578 of file mathlib.h.

Here is the caller graph for this function:

◆ lerp()

vec2 core_mathlib::vec2::lerp ( vec2 u,
vec2 v,
decimal  factor 
)
inline

Linear interpolation function between 2 vectors.

Definition at line 632 of file mathlib.h.

◆ normalize()

decimal core_mathlib::vec2::normalize ( void  )
inline

Definition at line 582 of file mathlib.h.

Here is the call graph for this function:

◆ operator const decimal *()

core_mathlib::vec2::operator const decimal * ( ) const
inline

Definition at line 556 of file mathlib.h.

◆ operator decimal *()

core_mathlib::vec2::operator decimal * ( )
inline

Definition at line 552 of file mathlib.h.

◆ operator!=()

int core_mathlib::vec2::operator!= ( const vec2 _v)
inline

Definition at line 488 of file mathlib.h.

◆ operator*() [1/2]

decimal core_mathlib::vec2::operator* ( const vec2 _v) const
inline

Definition at line 547 of file mathlib.h.

◆ operator*() [2/2]

const vec2 core_mathlib::vec2::operator* ( decimal  _f) const
inline

Definition at line 499 of file mathlib.h.

Here is the call graph for this function:

◆ operator*=()

vec2& core_mathlib::vec2::operator*= ( decimal  _f)
inline

Definition at line 530 of file mathlib.h.

◆ operator+()

const vec2 core_mathlib::vec2::operator+ ( const vec2 _v) const
inline

Definition at line 512 of file mathlib.h.

Here is the call graph for this function:

◆ operator+=()

vec2& core_mathlib::vec2::operator+= ( const vec2 _v)
inline

Definition at line 538 of file mathlib.h.

◆ operator-() [1/2]

const vec2 core_mathlib::vec2::operator- ( ) const
inline

Definition at line 516 of file mathlib.h.

Here is the call graph for this function:

◆ operator-() [2/2]

const vec2 core_mathlib::vec2::operator- ( const vec2 _v) const
inline

Definition at line 520 of file mathlib.h.

Here is the call graph for this function:

◆ operator-=()

vec2& core_mathlib::vec2::operator-= ( const vec2 _v)
inline

Definition at line 542 of file mathlib.h.

◆ operator/()

const vec2 core_mathlib::vec2::operator/ ( decimal  _f) const
inline

Definition at line 503 of file mathlib.h.

◆ operator/=()

vec2& core_mathlib::vec2::operator/= ( decimal  _f)
inline

Definition at line 534 of file mathlib.h.

◆ operator=()

vec2& core_mathlib::vec2::operator= ( decimal  _f)
inline

Definition at line 493 of file mathlib.h.

◆ operator==()

int core_mathlib::vec2::operator== ( const vec2 _v)
inline

Definition at line 483 of file mathlib.h.

◆ operator[]() [1/2]

decimal& core_mathlib::vec2::operator[] ( int  _i)
inline

Definition at line 560 of file mathlib.h.

◆ operator[]() [2/2]

const decimal& core_mathlib::vec2::operator[] ( int  _i) const
inline

Definition at line 564 of file mathlib.h.

◆ operator^()

decimal core_mathlib::vec2::operator^ ( const vec2 _v) const
inline

Definition at line 525 of file mathlib.h.

◆ projectionOnLine()

decimal core_mathlib::vec2::projectionOnLine ( const vec2 vA,
const vec2 vB 
)
inline

Return the projection factor of *this on the line passing by vA and vB.

Definition at line 626 of file mathlib.h.

Here is the caller graph for this function:

◆ reset()

void core_mathlib::vec2::reset ( void  )
inline

Definition at line 574 of file mathlib.h.

◆ set()

void core_mathlib::vec2::set ( decimal  _x,
decimal  _y 
)
inline

Definition at line 569 of file mathlib.h.

Member Data Documentation

◆ 

union { ... }

◆ s

decimal core_mathlib::vec2::s

Definition at line 653 of file mathlib.h.

◆ t

decimal core_mathlib::vec2::t

Definition at line 653 of file mathlib.h.

◆ v

decimal core_mathlib::vec2::v[2]

Definition at line 655 of file mathlib.h.

◆ x

decimal core_mathlib::vec2::x

Definition at line 649 of file mathlib.h.

◆ y

decimal core_mathlib::vec2::y

Definition at line 649 of file mathlib.h.


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