25 return {
static_cast<int>(
x),
static_cast<int>(
y)};
44 const float nx =
x *
cos(a) -
y *
sin(a);
45 const float ny =
x *
sin(a) +
y *
cos(a);
85 return {to.
x - from.
x, to.
y - from.
y};
120 const auto l = r.normalize();
139 return {
static_cast<float>(
x),
static_cast<float>(
y)};
184 return {to.
x - from.
x, to.
y - from.
y};
210 const float nx =
x *
cos(a) -
y *
sin(a);
211 const float ny =
x *
sin(a) +
y *
cos(a);
230 return x *
x +
y *
y;
283 const float nx =
x *
cos(a) -
y *
sin(a);
284 const float ny =
x *
sin(a) +
y *
cos(a);
389 return lhs.
x == rhs.
x && lhs.
y == rhs.
y;
395 return !(lhs == rhs);
402 return lhs.
x * rhs.
x + lhs.
y * rhs.
y;
419 static_cast<int>(
lerp_float(
static_cast<float>(from.
x), v,
static_cast<float>(to.
x))),
420 static_cast<int>(
lerp_float(
static_cast<float>(from.
y), v,
static_cast<float>(to.
y)))
426 {
return fmt::format(
"({}, {})", v.x, v.y); }
429 {
return fmt::format(
"({}, {})", v.x, v.y); }
432 {
return fmt::format(
"({}, {})", v.x, v.y); }
438 const auto x =
cos(angle);
439 const auto y =
sin(angle);
Angle operator+(const Angle &lhs, const Angle &rhs)
bool operator==(const Lrud< T > &lhs, const Lrud< T > &rhs)
Angle operator-(const Angle &lhs, const Angle &rhs)
Angle operator/(const Angle &lhs, float rhs)
float lerp_float(float f, float scale, float t)
std::string to_string(const Aabb &a)
bool is_equal(int lhs, int rhs)
bool operator!=(const Lrud< T > &lhs, const Lrud< T > &rhs)
float cos(const Angle &ang)
unit2f create_random_unit(Random *random)
Angle get_random_angle(::eu::Random *random)
float sin(const Angle &ang)
Angle operator*(const Angle &lhs, float rhs)
float dot(const quatf &lhs, const quatf &rhs)
vec2f lerp_vec2f(const vec2f &from, float v, const vec2f &to)
Transform.
vec2i lerp_vec2i(const vec2i &from, float v, const vec2i &to)
WEL512 Random Number Generator.
Scale2f(float ax, float ay)
Scale2f get_flipped_y() const
Scale2f get_rotated(const Angle &a) const
Scale2f operator-() const
unit2f get_flipped_y() const
unit2f get_rotated(const Angle &a) const
unit2f(float ax, float ay)
float get_length_squared() const
void operator*=(float rhs)
unit2f get_normalized() const
void operator-=(const vec2f &rhs)
vec2f get_rotated(const Angle &a) const
void operator/=(float rhs)
static vec2f from_to(const vec2f &from, const vec2f &to)
vec2f get_flipped_y() const
NormalizedAndLength< unit2f, float > get_normalized_and_length() const
void operator+=(const vec2f &rhs)
float get_length_squared() const
vec2i get_flipped_y() const
static vec2i from_to(const vec2i &from, const vec2i &to)
void operator-=(const vec2i &rhs)
void operator+=(const vec2i &rhs)