VCV Rack API v2
|
2-dimensional vector of floats, representing a point on the plane for graphics. More...
#include <math.hpp>
Public Member Functions | |
Vec () | |
Vec (float xy) | |
Vec (float x, float y) | |
float & | operator[] (int i) |
const float & | operator[] (int i) const |
Vec | neg () const |
Negates the vector. | |
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 |
float | area () const |
Vec | rotate (float angle) |
Rotates counterclockwise in radians. | |
Vec | flip () const |
Swaps the coordinates. | |
Vec | min (Vec b) const |
Vec | max (Vec b) const |
Vec | abs () const |
Vec | round () const |
Vec | floor () const |
Vec | ceil () const |
bool | equals (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) |
bool | isEqual (Vec b) const |
Public Attributes | |
float | x = 0.f |
float | y = 0.f |
2-dimensional vector of floats, representing a point on the plane for graphics.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Negates the vector.
Equivalent to a reflection across the y = -x
line.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Rotates counterclockwise in radians.
|
inline |
Swaps the coordinates.
Equivalent to a reflection across the y = x
line.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
float rack::math::Vec::x = 0.f |
float rack::math::Vec::y = 0.f |