Struct
Vector

2D displacement with X and Y components used for geometry, layout, and transformations.

Definition

Namespace:Telerik.Documents.Primitives

Assembly:Telerik.Windows.Documents.Core.dll

Syntax:

cs-api-definition
public struct Vector

Inherited Members ValueType.Equals(object)ValueType.GetHashCode()ValueType.ToString()

Constructors

Vector(double, double)

Initialize a vector with the specified X and Y components.

Declaration

cs-api-definition
public Vector(double x, double y)

Parameters

x

double

double - The initial X

y

double

double - THe initial Y

Properties

Length

Gets the Euclidean length (magnitude) of this vector.

Declaration

cs-api-definition
public double Length { get; }

Property Value

double

LengthSquared

Gets the squared length of this vector (avoids a square root for faster comparisons).

Declaration

cs-api-definition
public double LengthSquared { get; }

Property Value

double

X

Gets or sets the X component of the vector.

Declaration

cs-api-definition
public double X { readonly get; set; }

Property Value

double

Y

Gets or sets the Y component of the vector.

Declaration

cs-api-definition
public double Y { readonly get; set; }

Property Value

double

Operators

operator *(Vector, double)

Scale a vector by a scalar value.

Declaration

cs-api-definition
public static Vector operator *(Vector vector, double scalar)

Parameters

vector

Vector

scalar

double

Returns

Vector

operator /(Vector, double)

Scale a vector by the reciprocal of a scalar value.

Declaration

cs-api-definition
public static Vector operator /(Vector vector, double scalar)

Parameters

vector

Vector

scalar

double

Returns

Vector