Class Vector2
Float vector with 2 elements. Experimental.
Inheritance
System.Object
Vector2
Assembly: Edgar.dll
Syntax
public sealed class Vector2 : ValueType, IEquatable<Vector2>
Constructors
Vector2(Single, Single)
Declaration
public Vector2(float x, float y)
Parameters
Type |
Name |
Description |
System.Single |
x |
|
System.Single |
y |
|
Fields
X
Declaration
Field Value
Type |
Description |
System.Single |
|
Y
Declaration
Field Value
Type |
Description |
System.Single |
|
Methods
ElementWiseProduct(Vector2)
Computes element-wise product of two vectors.
Declaration
public Vector2 ElementWiseProduct(Vector2 other)
Parameters
Type |
Name |
Description |
Vector2 |
other |
|
Returns
Equals(Vector2)
Check if two vectors are equal.
Declaration
public bool Equals(Vector2 other)
Parameters
Type |
Name |
Description |
Vector2 |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Check if two vectors are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
EuclideanDistance(Vector2, Vector2)
Compute an euclidean distance of two vectors.
Declaration
public static double EuclideanDistance(Vector2 a, Vector2 b)
Parameters
Returns
Type |
Description |
System.Double |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
ManhattanDistance(Vector2, Vector2)
Computes a manhattan distance of two vectors.
Declaration
public static float ManhattanDistance(Vector2 a, Vector2 b)
Parameters
Returns
Type |
Description |
System.Single |
|
MaxDistance(Vector2, Vector2)
Computes a maximum distance between corresponding components of two vectors.
Declaration
public static float MaxDistance(Vector2 a, Vector2 b)
Parameters
Returns
Type |
Description |
System.Single |
|
RotateAroundCenter(Int32)
Rotate the point around the center.
Declaration
public Vector2 RotateAroundCenter(int degrees)
Parameters
Type |
Name |
Description |
System.Int32 |
degrees |
Multiples of 90 are expected.
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
ToStringShort()
Declaration
public string ToStringShort()
Returns
Type |
Description |
System.String |
|
Transforms a given vector.
Declaration
public Vector2 Transform(TransformationGrid2D transformation)
Parameters
Returns
Operators
Addition(Vector2, Vector2)
Declaration
public static Vector2 operator +(Vector2 a, Vector2 b)
Parameters
Returns
Equality(Vector2, Vector2)
Declaration
public static bool operator ==(Vector2 a, Vector2 b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implicit(Vector2Int to Vector2)
Declaration
public static implicit operator Vector2(Vector2Int vector)
Parameters
Returns
Inequality(Vector2, Vector2)
Declaration
public static bool operator !=(Vector2 a, Vector2 b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Multiply(Single, Vector2)
Declaration
public static Vector2 operator *(float a, Vector2 b)
Parameters
Type |
Name |
Description |
System.Single |
a |
|
Vector2 |
b |
|
Returns
Subtraction(Vector2, Vector2)
Declaration
public static Vector2 operator -(Vector2 a, Vector2 b)
Parameters
Returns
Implements
System.IEquatable<>