Struct Vector2d
Namespace:Mapbox.Utils
Assembly:Mapbox.Utils.dll
Syntax
Constructors
Vector2d(Double, Double)
Declaration
public Vector2d(double x, double y)
Parameters
Type |
Name |
Description |
System.Double |
x |
|
System.Double |
y |
|
Fields
kEpsilon
Declaration
public const double kEpsilon = null
Field Value
Type |
Description |
System.Double |
|
x
Declaration
Field Value
Type |
Description |
System.Double |
|
y
Declaration
Field Value
Type |
Description |
System.Double |
|
Properties
Item[Int32]
Declaration
public double this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
Type |
Description |
System.Double |
|
magnitude
Declaration
public double magnitude { get; }
Property Value
Type |
Description |
System.Double |
|
normalized
Declaration
public Vector2d normalized { get; }
Property Value
one
Declaration
public static Vector2d one { get; }
Property Value
right
Declaration
public static Vector2d right { get; }
Property Value
sqrMagnitude
Declaration
public double sqrMagnitude { get; }
Property Value
Type |
Description |
System.Double |
|
up
Declaration
public static Vector2d up { get; }
Property Value
zero
Declaration
public static Vector2d zero { get; }
Property Value
Methods
Angle(Vector2d, Vector2d)
Declaration
public static double Angle(Vector2d from, Vector2d to)
Parameters
Returns
Type |
Description |
System.Double |
|
ClampMagnitude(Vector2d, Double)
Declaration
public static Vector2d ClampMagnitude(Vector2d vector, double maxLength)
Parameters
Type |
Name |
Description |
Vector2d |
vector |
|
System.Double |
maxLength |
|
Returns
Distance(Vector2d, Vector2d)
Declaration
public static double Distance(Vector2d a, Vector2d b)
Parameters
Returns
Type |
Description |
System.Double |
|
Dot(Vector2d, Vector2d)
Declaration
public static double Dot(Vector2d lhs, Vector2d rhs)
Parameters
Returns
Type |
Description |
System.Double |
|
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Lerp(Vector2d, Vector2d, Double)
Declaration
public static Vector2d Lerp(Vector2d from, Vector2d to, double t)
Parameters
Returns
Max(Vector2d, Vector2d)
Declaration
public static Vector2d Max(Vector2d lhs, Vector2d rhs)
Parameters
Returns
Min(Vector2d, Vector2d)
Declaration
public static Vector2d Min(Vector2d lhs, Vector2d rhs)
Parameters
Returns
MoveTowards(Vector2d, Vector2d, Double)
Declaration
public static Vector2d MoveTowards(Vector2d current, Vector2d target, double maxDistanceDelta)
Parameters
Type |
Name |
Description |
Vector2d |
current |
|
Vector2d |
target |
|
System.Double |
maxDistanceDelta |
|
Returns
Normalize()
Declaration
Scale(Vector2d)
Declaration
public void Scale(Vector2d scale)
Parameters
Scale(Vector2d, Vector2d)
Declaration
public static Vector2d Scale(Vector2d a, Vector2d b)
Parameters
Returns
Set(Double, Double)
Declaration
public void Set(double new_x, double new_y)
Parameters
Type |
Name |
Description |
System.Double |
new_x |
|
System.Double |
new_y |
|
SqrMagnitude()
Declaration
public double SqrMagnitude()
Returns
Type |
Description |
System.Double |
|
SqrMagnitude(Vector2d)
Declaration
public static double SqrMagnitude(Vector2d a)
Parameters
Returns
Type |
Description |
System.Double |
|
ToArray()
Declaration
public double[] ToArray()
Returns
Type |
Description |
System.Double[] |
|
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Operators
Addition(Vector2d, Vector2d)
Declaration
public static Vector2d operator +(Vector2d a, Vector2d b)
Parameters
Returns
Division(Vector2d, Double)
Declaration
public static Vector2d operator /(Vector2d a, double d)
Parameters
Type |
Name |
Description |
Vector2d |
a |
|
System.Double |
d |
|
Returns
Equality(Vector2d, Vector2d)
Declaration
public static bool operator ==(Vector2d lhs, Vector2d rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(Vector2d, Vector2d)
Declaration
public static bool operator !=(Vector2d lhs, Vector2d rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Multiply(Vector2d, Double)
Declaration
public static Vector2d operator *(Vector2d a, double d)
Parameters
Type |
Name |
Description |
Vector2d |
a |
|
System.Double |
d |
|
Returns
Multiply(Single, Vector2d)
Declaration
public static Vector2d operator *(float d, Vector2d a)
Parameters
Type |
Name |
Description |
System.Single |
d |
|
Vector2d |
a |
|
Returns
Subtraction(Vector2d, Vector2d)
Declaration
public static Vector2d operator -(Vector2d a, Vector2d b)
Parameters
Returns
UnaryNegation(Vector2d)
Declaration
public static Vector2d operator -(Vector2d a)
Parameters
Returns