Vector2

StockSharp.Xaml.Charting.Rendering.HighQualityRasterizer.Agg.VectorMath

Represents a 2D vector using two double-precision floating-point numbers.

Implementa: IEquatable<Vector2>

Construtores

Vector2(double, double)

Constructs left vector with the given coordinates.

x
The X coordinate.
y
The Y coordinate.

Propriedades

Length : double

Gets the length (magnitude) of the vector.

LengthSquared : double

Gets the square of the vector length (magnitude).

PerpendicularLeft : Vector2

Gets the perpendicular vector on the left side of this vector.

PerpendicularRight : Vector2

Gets the perpendicular vector on the right side of this vector.

Métodos

Add(Vector2, Vector2, Vector2)

Adds two vectors.

a
Left operand.
b
Right operand.
result
Result of operation.
Add(Vector2, Vector2) : Vector2

Adds two vectors.

a
Left operand.
b
Right operand.

Retorna: Result of operation.

BaryCentric(Vector2, Vector2, Vector2, double, double, Vector2)

Interpolate 3 Vectors using Barycentric coordinates

a
First input Vector.
b
Second input Vector.
c
Third input Vector.
u
First Barycentric Coordinate.
v
Second Barycentric Coordinate.
result
Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise
BaryCentric(Vector2, Vector2, Vector2, double, double) : Vector2

Interpolate 3 Vectors using Barycentric coordinates

a
First input Vector
b
Second input Vector
c
Third input Vector
u
First Barycentric Coordinate
v
Second Barycentric Coordinate

Retorna: a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise

Clamp(Vector2, Vector2, Vector2, Vector2)

Clamp a vector to the given minimum and maximum vectors

vec
Input vector
min
Minimum vector
max
Maximum vector
result
The clamped vector
Clamp(Vector2, Vector2, Vector2) : Vector2

Clamp a vector to the given minimum and maximum vectors

vec
Input vector
min
Minimum vector
max
Maximum vector

Retorna: The clamped vector

ComponentMax(Vector2, Vector2, Vector2)

Calculate the component-wise maximum of two vectors

a
First operand
b
Second operand
result
The component-wise maximum
ComponentMax(Vector2, Vector2) : Vector2

Calculate the component-wise maximum of two vectors

a
First operand
b
Second operand

Retorna: The component-wise maximum

ComponentMin(Vector2, Vector2, Vector2)

Calculate the component-wise minimum of two vectors

a
First operand
b
Second operand
result
The component-wise minimum
ComponentMin(Vector2, Vector2) : Vector2

Calculate the component-wise minimum of two vectors

a
First operand
b
Second operand

Retorna: The component-wise minimum

Cross(Vector2, Vector2) : double

Calculate the cross product of two vectors

left
First operand
right
Second operand

Retorna: The cross product of the two inputs

Divide(Vector2, Vector2) : Vector2

Divides a vector by the components of a vector (scale).

vector
Left operand.
scale
Right operand.

Retorna: Result of the operation.

Divide(Vector2, Vector2, Vector2)

Divide a vector by the components of a vector (scale).

vector
Left operand.
scale
Right operand.
result
Result of the operation.
Divide(Vector2, double) : Vector2

Divides a vector by a scalar.

vector
Left operand.
scale
Right operand.

Retorna: Result of the operation.

Divide(Vector2, double, Vector2)

Divides a vector by a scalar.

vector
Left operand.
scale
Right operand.
result
Result of the operation.
Dot(Vector2, Vector2) : double

Calculate the dot (scalar) product of two vectors

left
First operand
right
Second operand

Retorna: The dot product of the two inputs

Dot(Vector2, Vector2, double)

Calculate the dot (scalar) product of two vectors

left
First operand
right
Second operand
result
The dot product of the two inputs
Equals(object) : bool

Indicates whether this instance and a specified object are equal.

obj
The object to compare to.

Retorna: True if the instances are equal; false otherwise.

Equals(Vector2) : bool

Indicates whether the current vector is equal to another vector.

other
A vector to compare with this vector.

Retorna: true if the current vector is equal to the vector parameter; otherwise, false.

Equals(Vector2, double) : bool

Indicates whether the current vector is equal to another vector.

other
A vector to compare with this vector.
errorRange

Retorna: true if the current vector is equal to the vector parameter; otherwise, false.

GetHashCode() : int

Returns the hashcode for this instance.

Retorna: A System.Int32 containing the unique hashcode for this instance.

GetNormal() : Vector2

Returns a normalized Vector of this.

Lerp(Vector2, Vector2, double) : Vector2

Returns a new Vector that is the linear blend of the 2 given Vectors

a
First input vector
b
Second input vector
blend
The blend factor. a when blend=0, b when blend=1.

Retorna: a when blend=0, b when blend=1, and a linear combination otherwise

Lerp(Vector2, Vector2, double, Vector2)

Returns a new Vector that is the linear blend of the 2 given Vectors

a
First input vector
b
Second input vector
blend
The blend factor. a when blend=0, b when blend=1.
result
a when blend=0, b when blend=1, and a linear combination otherwise
Max(Vector2, Vector2) : Vector2

Calculate the component-wise maximum of two vectors

a
First operand
b
Second operand

Retorna: The component-wise maximum

Max(Vector2, Vector2, Vector2)

Calculate the component-wise maximum of two vectors

a
First operand
b
Second operand
result
The component-wise maximum
Min(Vector2, Vector2) : Vector2

Calculate the component-wise minimum of two vectors

a
First operand
b
Second operand

Retorna: The component-wise minimum

Min(Vector2, Vector2, Vector2)

Calculate the component-wise minimum of two vectors

a
First operand
b
Second operand
result
The component-wise minimum
Multiply(Vector2, double, Vector2)

Multiplies a vector by a scalar.

vector
Left operand.
scale
Right operand.
result
Result of the operation.
Multiply(Vector2, Vector2) : Vector2

Multiplies a vector by the components a vector (scale).

vector
Left operand.
scale
Right operand.

Retorna: Result of the operation.

Multiply(Vector2, Vector2, Vector2)

Multiplies a vector by the components of a vector (scale).

vector
Left operand.
scale
Right operand.
result
Result of the operation.
Multiply(Vector2, double) : Vector2

Multiplies a vector by a scalar.

vector
Left operand.
scale
Right operand.

Retorna: Result of the operation.

Normalize(Vector2) : Vector2

Scale a vector to unit length

vec
The input vector

Retorna: The normalized vector

Normalize(Vector2, Vector2)

Scale a vector to unit length

vec
The input vector
result
The normalized vector
Normalize()

Scales the Vector2 to unit length.

NormalizeFast(Vector2) : Vector2

Scale a vector to approximately unit length

vec
The input vector

Retorna: The normalized vector

NormalizeFast(Vector2, Vector2)

Scale a vector to approximately unit length

vec
The input vector
result
The normalized vector
op_Addition(Vector2, Vector2) : Vector2

Adds two instances.

left
The left instance.
right
The right instance.

Retorna: The result of the operation.

op_Division(double, Vector2) : Vector2

Divides a scaler by an instance components wise.

vec
The scalar.
f
The instance.

Retorna: The result of the operation.

op_Division(Vector2, double) : Vector2

Divides an instance by a scalar.

vec
The instance.
f
The scalar.

Retorna: The result of the operation.

op_Equality(Vector2, Vector2) : bool

Compares two instances for equality.

left
The left instance.
right
The right instance.

Retorna: True, if both instances are equal; false otherwise.

op_Inequality(Vector2, Vector2) : bool

Compares two instances for ienquality.

left
The left instance.
right
The right instance.

Retorna: True, if the instances are not equal; false otherwise.

op_Multiply(double, Vector2) : Vector2

Multiply an instance by a scalar.

f
The scalar.
vec
The instance.

Retorna: The result of the operation.

op_Multiply(Vector2, double) : Vector2

Multiplies an instance by a scalar.

vec
The instance.
f
The scalar.

Retorna: The result of the operation.

op_Subtraction(Vector2, Vector2) : Vector2

Subtracts two instances.

left
The left instance.
right
The right instance.

Retorna: The result of the operation.

op_UnaryNegation(Vector2) : Vector2

Negates an instance.

vec
The instance.

Retorna: The result of the operation.

Subtract(Vector2, Vector2, Vector2)

Subtract one Vector from another

a
First operand
b
Second operand
result
Result of subtraction
Subtract(Vector2, Vector2) : Vector2

Subtract one Vector from another

a
First operand
b
Second operand

Retorna: Result of subtraction

ToString() : string

Returns a System.String that represents the current instance.

Transform(Vector2, Quaternion, Vector2)

Transforms a vector by a quaternion rotation.

vec
The vector to transform.
quat
The quaternion to rotate the vector by.
result
The result of the operation.
Transform(Vector2, Quaternion) : Vector2

Transforms a vector by a quaternion rotation.

vec
The vector to transform.
quat
The quaternion to rotate the vector by.

Retorna: The result of the operation.

Campos

One : Vector2

Defines an instance with all components set to 1.

SizeInBytes : int

Defines the size of the Vector2d struct in bytes.

UnitX : Vector2

Defines a unit-length Vector2d that points towards the X-axis.

UnitY : Vector2

Defines a unit-length Vector2d that points towards the Y-axis.

x : double

The X coordinate of this instance.

y : double

The Y coordinate of this instance.

Zero : Vector2

Defines a zero-length Vector2d.