385#include <SFML/System/Vector2.inl>
Represents an angle value.
Class template for manipulating 2-dimensional vectors.
constexpr Vector2(T x, T y)
Construct the vector from cartesian coordinates.
constexpr T cross(Vector2 rhs) const
Z component of the cross product of two 2D vectors.
T length() const
Length of the vector (floating-point).
Vector2(T r, Angle phi)
Construct the vector from polar coordinates (floating-point)
constexpr Vector2 componentWiseDiv(Vector2 rhs) const
Component-wise division of *this and rhs.
constexpr Vector2()=default
Default constructor.
constexpr Vector2< T > operator+(Vector2< T > left, Vector2< T > right)
Overload of binary operator+
constexpr Vector2 perpendicular() const
Returns a perpendicular vector.
constexpr T lengthSquared() const
Square of vector's length.
Vector2 projectedOnto(Vector2 axis) const
Projection of this vector onto axis (floating-point).
Vector2 rotatedBy(Angle phi) const
Rotate by angle phi (floating-point).
Angle angleTo(Vector2 rhs) const
Signed angle from *this to rhs (floating-point).
constexpr Vector2< T > operator-(Vector2< T > right)
Overload of unary operator-
constexpr bool operator==(Vector2< T > left, Vector2< T > right)
Overload of binary operator==
constexpr Vector2< T > operator-(Vector2< T > left, Vector2< T > right)
Overload of binary operator-
constexpr Vector2< T > & operator*=(Vector2< T > &left, T right)
Overload of binary operator*=
constexpr Vector2< T > & operator+=(Vector2< T > &left, Vector2< T > right)
Overload of binary operator+=
constexpr Vector2< T > & operator-=(Vector2< T > &left, Vector2< T > right)
Overload of binary operator-=
Vector2 normalized() const
Vector with same direction but length 1 (floating-point).
constexpr Vector2 componentWiseMul(Vector2 rhs) const
Component-wise multiplication of *this and rhs.
Angle angle() const
Signed angle from +X or (1,0) vector (floating-point).
constexpr Vector2< T > & operator/=(Vector2< T > &left, T right)
Overload of binary operator/=
constexpr T dot(Vector2 rhs) const
Dot product of two 2D vectors.
constexpr bool operator!=(Vector2< T > left, Vector2< T > right)
Overload of binary operator!=
constexpr Vector2< T > operator*(Vector2< T > left, T right)
Overload of binary operator*
constexpr Vector2< T > operator*(T left, Vector2< T > right)
Overload of binary operator*
constexpr Vector2< T > operator/(Vector2< T > left, T right)
Overload of binary operator/
Vector2< unsigned int > Vector2u
Vector2< float > Vector2f