void | Deconstruct ( float x, float y ) | Helper method for deconstruction into a tuple. |
Vector2 | Abs ( ) | Returns a new vector with all components in absolute values (i.e. positive). |
float | Angle ( ) | Returns this vector's angle with respect to the X axis, or (1, 0) vector, in radians. Equivalent to the result of Mathf.Atan2(real_t, real_t) when called with the vector's Y and X as parameters: Mathf.Atan2(v.Y, v.X) . |
float | AngleTo ( Vector2 to ) | Returns the angle to the given vector, in radians. |
float | AngleToPoint ( Vector2 to ) | Returns the angle between the line connecting the two points and the X axis, in radians. |
float | Aspect ( ) | Returns the aspect ratio of this vector, the ratio of X to Y . |
Vector2 | Bounce ( Vector2 normal ) | Returns the vector "bounced off" from a plane defined by the given normal. |
Vector2 | Ceil ( ) | Returns a new vector with all components rounded up (towards positive infinity). |
Vector2 | Clamp ( Vector2 min, Vector2 max ) | Returns a new vector with all components clamped between the components of name and name using Mathf.Clamp(real_t, real_t, real_t) . |
Vector2 | Clamp ( float min, float max ) | Returns a new vector with all components clamped between the name and name using Mathf.Clamp(real_t, real_t, real_t) . |
float | Cross ( Vector2 with ) | Returns the cross product of this vector and name . |
Vector2 | CubicInterpolate ( Vector2 b, Vector2 preA, Vector2 postB, float weight ) | Performs a cubic interpolation between vectors name , this vector, name , and name , by the given amount name . |
Vector2 | CubicInterpolateInTime ( Vector2 b, Vector2 preA, Vector2 postB, float weight, float t, float preAT, float postBT ) | Performs a cubic interpolation between vectors name , this vector, name , and name , by the given amount name . It can perform smoother interpolation than CubicInterpolate by the time values. |
Vector2 | BezierInterpolate ( Vector2 control1, Vector2 control2, Vector2 end, float t ) | Returns the point at the given name on a one-dimensional Bezier curve defined by this vector and the given name , name , and name points. |
Vector2 | BezierDerivative ( Vector2 control1, Vector2 control2, Vector2 end, float t ) | Returns the derivative at the given name on the Bezier curve defined by this vector and the given name , name , and name points. |
Vector2 | DirectionTo ( Vector2 to ) | Returns the normalized vector pointing from this vector to name . |
float | DistanceSquaredTo ( Vector2 to ) | Returns the squared distance between this vector and name . This method runs faster than DistanceTo , so prefer it if you need to compare vectors or need the squared distance for some formula. |
float | DistanceTo ( Vector2 to ) | Returns the distance between this vector and name . |
float | Dot ( Vector2 with ) | Returns the dot product of this vector and name . |
Vector2 | Floor ( ) | Returns a new vector with all components rounded down (towards negative infinity). |
Vector2 | Inverse ( ) | Returns the inverse of this vector. This is the same as new Vector2(1 / v.X, 1 / v.Y) . |
bool | IsFinite ( ) | Returns true if this vector is finite, by calling Mathf.IsFinite(real_t) on each component. |
bool | IsNormalized ( ) | Returns true if the vector is normalized, and false otherwise. |
float | Length ( ) | Returns the length (magnitude) of this vector. |
float | LengthSquared ( ) | Returns the squared length (squared magnitude) of this vector. This method runs faster than Length , so prefer it if you need to compare vectors or need the squared length for some formula. |
Vector2 | Lerp ( Vector2 to, float weight ) | Returns the result of the linear interpolation between this vector and name by amount name . |
Vector2 | LimitLength ( float length ) | Returns the vector with a maximum length by limiting its length to name . |
Vector2 | Max ( Vector2 with ) | Returns the result of the component-wise maximum between this vector and name . Equivalent to new Vector2(Mathf.Max(X, with.X), Mathf.Max(Y, with.Y)) . |
Vector2 | Max ( float with ) | Returns the result of the component-wise maximum between this vector and name . Equivalent to new Vector2(Mathf.Max(X, with), Mathf.Max(Y, with)) . |
Vector2 | Min ( Vector2 with ) | Returns the result of the component-wise minimum between this vector and name . Equivalent to new Vector2(Mathf.Min(X, with.X), Mathf.Min(Y, with.Y)) . |
Vector2 | Min ( float with ) | Returns the result of the component-wise minimum between this vector and name . Equivalent to new Vector2(Mathf.Min(X, with), Mathf.Min(Y, with)) . |
Axis | MaxAxisIndex ( ) | Returns the axis of the vector's highest value. See Axis . If both components are equal, this method returns Axis.X . |
Axis | MinAxisIndex ( ) | Returns the axis of the vector's lowest value. See Axis . If both components are equal, this method returns Axis.Y . |
Vector2 | MoveToward ( Vector2 to, float delta ) | Moves this vector toward name by the fixed name amount. |
Vector2 | Normalized ( ) | Returns the vector scaled to unit length. Equivalent to v / v.Length() . |
Vector2 | PosMod ( float mod ) | Returns a vector composed of the Mathf.PosMod(real_t, real_t) of this vector's components and name . |
Vector2 | PosMod ( Vector2 modv ) | Returns a vector composed of the Mathf.PosMod(real_t, real_t) of this vector's components and name 's components. |
Vector2 | Project ( Vector2 onNormal ) | Returns a new vector resulting from projecting this vector onto the given vector name . The resulting new vector is parallel to name . See also Slide . Note: If the vector name is a zero vector, the components of the resulting new vector will be real_t.NaN . |
Vector2 | Reflect ( Vector2 normal ) | Returns this vector reflected from a plane defined by the given name . |
Vector2 | Rotated ( float angle ) | Rotates this vector by name radians. |
Vector2 | Round ( ) | Returns this vector with all components rounded to the nearest integer, with halfway cases rounded towards the nearest multiple of two. |
Vector2 | Sign ( ) | Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling Mathf.Sign(real_t) on each component. |
Vector2 | Slerp ( Vector2 to, float weight ) | Returns the result of the spherical linear interpolation between this vector and name by amount name . This method also handles interpolating the lengths if the input vectors have different lengths. For the special case of one or both input vectors having zero length, this method behaves like Lerp . |
Vector2 | Slide ( Vector2 normal ) | Returns a new vector resulting from sliding this vector along a line with normal name . The resulting new vector is perpendicular to name , and is equivalent to this vector minus its projection on name . See also Project . Note: The vector name must be normalized. See also Normalized . |
Vector2 | Snapped ( Vector2 step ) | Returns a new vector with each component snapped to the nearest multiple of the corresponding component in name . This can also be used to round to an arbitrary number of decimals. |
Vector2 | Snapped ( float step ) | Returns a new vector with each component snapped to the nearest multiple of name . This can also be used to round to an arbitrary number of decimals. |
Vector2 | Orthogonal ( ) | Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. |
bool | Equals ( object? obj ) | Returns true if the vector is exactly equal to the given object ( name ). Note: Due to floating-point precision errors, consider using IsEqualApprox instead, which is more reliable. |
bool | Equals ( Vector2 other ) | Returns true if the vectors are exactly equal. Note: Due to floating-point precision errors, consider using IsEqualApprox instead, which is more reliable. |
bool | IsEqualApprox ( Vector2 other ) | Returns true if this vector and name are approximately equal, by running Mathf.IsEqualApprox(real_t, real_t) on each component. |
bool | IsZeroApprox ( ) | Returns true if this vector's values are approximately zero, by running Mathf.IsZeroApprox(real_t) on each component. This method is faster than using IsEqualApprox with one value as a zero vector. |
int | GetHashCode ( ) | Serves as the hash function for Vector2 . |
string | ToString ( ) | Converts this Vector2 to a string. |
string | ToString ( string? format ) | Converts this Vector2 to a string with the given name . |