27 explicit v2(
const std::tuple<float, float>&
a);
#define ADD_CATCH_FORMATTER_DEF(TYPE)
An operator/(const An &lhs, float rhs)
An operator-(const An &lhs, const An &rhs)
v2 lerp_vec2f(const v2 &from, float v, const v2 &to)
float dot(const Q &lhs, const Q &rhs)
An operator+(const An &lhs, const An &rhs)
An operator*(const An &lhs, float rhs)
std::string string_from(const An &a)
An angle in both degrees and radians.
A (inclusive) range between two values.
n2 get_rotated(const An &a) const
Assumes the unit vector is a point and returns it if it was rotated around (0,0)
n2(float ax, float ay)
asserts that the length is 1
n2 get_flipped_y() const
Returns a new unit vector where the sign of the y component is flipped.
bool is_valid() const
returns false if the length isn't 1
const float * get_data_ptr() const
Returns an array to the data.
n2(const v2 &v)
asserts that the length is 1
std::optional< n2 > get_normalized() const
Changes the length to 1.
void operator/=(float rhs)
void operator*=(float rhs)
float get_length() const
Returns the length of the vector.
float get_length_squared() const
Returns the squared length of the vector.
const float * get_data_ptr() const
Returns an array to the data.
void operator-=(const v2 &rhs)
float * get_data_ptr()
Returns an array to the data.
v2 get_flipped_y() const
Returns a new vector where the sign of the y component is flipped.
constexpr v2(float ax, float ay)
void operator+=(const v2 &rhs)
static v2 from_to(const v2 &from, const v2 &to)
v2 get_rotated(const An &a) const
Assumes the vector is a point and returns it if it was rotated around (0,0)
static v2 from(const n2 &n)
v2(const std::tuple< float, float > &a)
bool normalize()
Changes the length to 1.