VCV Rack API  v1
rack::math::Vec Struct Reference

#include <math.hpp>

Public Member Functions

 Vec ()
 
 Vec (float x, float y)
 
Vec neg () const
 Negates the vector. More...
 
Vec plus (Vec b) const
 
Vec minus (Vec b) const
 
Vec mult (float s) const
 
Vec mult (Vec b) const
 
Vec div (float s) const
 
Vec div (Vec b) const
 
float dot (Vec b) const
 
float arg () const
 
float norm () const
 
Vec normalize () const
 
float square () const
 
Vec rotate (float angle)
 Rotates counterclockwise in radians. More...
 
Vec flip () const
 Swaps the coordinates. More...
 
Vec min (Vec b) const
 
Vec max (Vec b) const
 
Vec abs () const
 
Vec round () const
 
Vec floor () const
 
Vec ceil () const
 
bool isEqual (Vec b) const
 
bool isZero () const
 
bool isFinite () const
 
Vec clamp (Rect bound) const
 
Vec clampSafe (Rect bound) const
 
Vec crossfade (Vec b, float p)
 

Public Attributes

float x = 0.f
 
float y = 0.f
 

Constructor & Destructor Documentation

◆ Vec() [1/2]

rack::math::Vec::Vec ( )
inline

◆ Vec() [2/2]

rack::math::Vec::Vec ( float  x,
float  y 
)
inline

Member Function Documentation

◆ neg()

Vec rack::math::Vec::neg ( ) const
inline

Negates the vector.

Equivalent to a reflection across the y = -x line.

◆ plus()

Vec rack::math::Vec::plus ( Vec  b) const
inline

◆ minus()

Vec rack::math::Vec::minus ( Vec  b) const
inline

◆ mult() [1/2]

Vec rack::math::Vec::mult ( float  s) const
inline

◆ mult() [2/2]

Vec rack::math::Vec::mult ( Vec  b) const
inline

◆ div() [1/2]

Vec rack::math::Vec::div ( float  s) const
inline

◆ div() [2/2]

Vec rack::math::Vec::div ( Vec  b) const
inline

◆ dot()

float rack::math::Vec::dot ( Vec  b) const
inline

◆ arg()

float rack::math::Vec::arg ( ) const
inline

◆ norm()

float rack::math::Vec::norm ( ) const
inline

◆ normalize()

Vec rack::math::Vec::normalize ( ) const
inline

◆ square()

float rack::math::Vec::square ( ) const
inline

◆ rotate()

Vec rack::math::Vec::rotate ( float  angle)
inline

Rotates counterclockwise in radians.

◆ flip()

Vec rack::math::Vec::flip ( ) const
inline

Swaps the coordinates.

Equivalent to a reflection across the y = x line.

◆ min()

Vec rack::math::Vec::min ( Vec  b) const
inline

◆ max()

Vec rack::math::Vec::max ( Vec  b) const
inline

◆ abs()

Vec rack::math::Vec::abs ( ) const
inline

◆ round()

Vec rack::math::Vec::round ( ) const
inline

◆ floor()

Vec rack::math::Vec::floor ( ) const
inline

◆ ceil()

Vec rack::math::Vec::ceil ( ) const
inline

◆ isEqual()

bool rack::math::Vec::isEqual ( Vec  b) const
inline

◆ isZero()

bool rack::math::Vec::isZero ( ) const
inline

◆ isFinite()

bool rack::math::Vec::isFinite ( ) const
inline

◆ clamp()

Vec rack::math::Vec::clamp ( Rect  bound) const
inline

◆ clampSafe()

Vec rack::math::Vec::clampSafe ( Rect  bound) const
inline

◆ crossfade()

Vec rack::math::Vec::crossfade ( Vec  b,
float  p 
)
inline

Member Data Documentation

◆ x

float rack::math::Vec::x = 0.f

◆ y

float rack::math::Vec::y = 0.f

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