Table of Contents

Struct VectorL

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

This struct defines a two-dimensional vector of long numbers. Operators \(a+b\), \(a-b\) and \(a|b\) (Scalar product) can be used. One operand on \(a*b\) and \(a/b\) can be an long too.

public struct VectorL
Inherited Members

Constructors

VectorL(long, long)

Creates a VectorL from two long values.

public VectorL(long x, long y)

Parameters

x long

x-value of new VectorL object.

y long

y-value of new VectorL object.

Properties

X

Gets and sets the x-value of this VectorL object.

public long X { get; set; }

Property Value

long

Y

Gets and sets the y-value of this VectorL object.

public long Y { get; set; }

Property Value

long

Methods

Equals(object)

This function compares the values of this vector with vector given as parameter.

public override bool Equals(object obj)

Parameters

obj object

VectorL to be compared.

Returns

bool

Returns true if both values are equal.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

ToString()

Converts a VectorL into a string of format “(X; Y)”.

public override string ToString()

Returns

string

String containing the VectorL information.

Operators

operator +(VectorL, VectorL)

Adds two VectorL objects.

public static VectorL operator +(VectorL a, VectorL b)

Parameters

a VectorL

The first VectorL object to add.

b VectorL

The second VectorL object to add.

Returns

VectorL

Returns the sum of the two VectorL objects.

operator |(VectorL, VectorL)

Calculates the scalar product of two VectorL objects.

public static long operator |(VectorL a, VectorL b)

Parameters

a VectorL

First VectorL object.

b VectorL

Second VectorL object.

Returns

long

Scalar product of the two VectorL objects.

operator /(long, VectorL)

Performs a component-wise division of a long value and a VectorL object. The result is defined as new Vector(number / vector.X, number / vector.Y).

public static VectorL operator /(long number, VectorL vector)

Parameters

number long

The long value to divide by the components of the VectorL object.

vector VectorL

The VectorL object used as divisor.

Returns

VectorL

Returns the quotient of the long value and the VectorL object.

operator /(VectorL, long)

Performs a component-wise division of a VectorL object and a long value.

public static VectorL operator /(VectorL vector, long divisor)

Parameters

vector VectorL

The VectorL object to divide by the long value.

divisor long

The long value used as divisor.

Returns

VectorL

Returns the quotient of the VectorL object and the long value.

operator /(VectorL, VectorL)

Performs a component-wise division of two VectorL objects.

public static VectorL operator /(VectorL a, VectorL b)

Parameters

a VectorL

The first VectorL object to divide by parameter b.

b VectorL

The second VectorL object used as divisor.

Returns

VectorL

Returns the quotient of the two VectorL objects.

operator ==(VectorL, VectorL)

Compares two VectorL for equality. The comparison will be done by comparing the values of the two x- and y-components, respectively.

public static bool operator ==(VectorL vector1, VectorL vector2)

Parameters

vector1 VectorL

First VectorL object to compare.

vector2 VectorL

Second VectorL object to compare.

Returns

bool

Returns true if the two objects are equal.

explicit operator VectorL(VectorD)

Converts a VectorD object to a VectorL object.

public static explicit operator VectorL(VectorD vector)

Parameters

vector VectorD

VectorD object to be converted.

Returns

VectorL

Converted VectorL.

explicit operator Vector(VectorL)

Converts a VectorL object to a Vector object.

public static explicit operator Vector(VectorL vector)

Parameters

vector VectorL

VectorL object to be converted.

Returns

Vector

Converted Vector.

implicit operator VectorL(Vector)

Implicitly converts a Vector object to a VectorL object.

public static implicit operator VectorL(Vector vector)

Parameters

vector Vector

Vector object to be converted.

Returns

VectorL

Converted VectorL.

operator !=(VectorL, VectorL)

Compares two VectorL for inequality. The comparison will be done by comparing the values of the two x- and y-components, respectively.

public static bool operator !=(VectorL vector1, VectorL vector2)

Parameters

vector1 VectorL

First VectorL object to compare.

vector2 VectorL

Second VectorL object to compare.

Returns

bool

Returns true if the two objects are unequal.

operator *(long, VectorL)

Multiplies a VectorL object with a long value.

public static VectorL operator *(long factor, VectorL vector)

Parameters

factor long

The long value to multiply.

vector VectorL

The VectorL object to multiply.

Returns

VectorL

Returns the product of the VectorL object and the long value.

operator *(VectorL, long)

Multiplies a VectorL object with a long value.

public static VectorL operator *(VectorL vector, long factor)

Parameters

vector VectorL

The VectorL object to multiply.

factor long

The long value to multiply.

Returns

VectorL

Returns the product of the VectorL object and the long value.

operator *(VectorL, VectorL)

Multiplies two VectorL objects.

public static VectorL operator *(VectorL a, VectorL b)

Parameters

a VectorL

The first VectorL object to multiply.

b VectorL

The second VectorL object to multiply.

Returns

VectorL

Returns the product of the two VectorL objects.

operator -(VectorL, VectorL)

Subtracts two VectorL objects.

public static VectorL operator -(VectorL a, VectorL b)

Parameters

a VectorL

The first VectorL object to subtract from.

b VectorL

The second VectorL object to subtract.

Returns

VectorL

Returns the difference of the two VectorL objects.