Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
VectorL Struct Reference

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. More...

Public Member Functions

override string ToString ()
 Converts a VectorL into a string of format "(X; Y).
 
 VectorL (long x, long y)
 Creates a VectorL from two long values.
 
 VectorL (Vector v)
 Copy constructor for vector object.
 
 VectorL (VectorL v)
 Copy constructor.
 

Static Public Member Functions

static long Max (Vector a)
 Returns the maximal component of a VectorL.
 
static operator Vector (VectorL vector)
 Converts a VectorL object to a Vector object.
 
static implicit operator VectorL (Vector vector)
 Implicitly converts a Vector object to a VectorL object.
 
static operator VectorL (VectorD vector)
 Converts a VectorD object to a VectorL object.
 
static bool operator!= (VectorL vector1, VectorL vector2)
 Compares two VectorL for inequality. The comparison will be done by comparing the values of the two x- and y-components respectively.
 
static VectorL operator* (long factor, VectorL vector)
 Multiplies a VectorL object by a long value.
 
static VectorL operator* (VectorL a, VectorL b)
 Multiplies two VectorL objects.
 
static VectorL operator* (VectorL vector, long factor)
 Multiplies a VectorL object by a long value.
 
static VectorL operator+ (VectorL a, VectorL b)
 Adds two VectorL objects.
 
static VectorL operator- (VectorL a, VectorL b)
 Subtracts two VectorL objects.
 
static VectorL operator/ (long number, VectorL vector)
 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).
 
static VectorL operator/ (VectorL a, VectorL b)
 Performs a component-wise division of two VectorL objects.
 
static VectorL operator/ (VectorL vector, long divisor)
 Performs a component-wise division of a VectorL object and a long value.
 
static bool operator== (VectorL vector1, VectorL vector2)
 Compares two VectorL for equality. The comparison will be done by comparing the values of the two x- and y-components respectively.
 
static long operator| (VectorL a, VectorL b)
 Calculates the scalar product of two VectorL objects.
 

Properties

long X [get, set]
 public property to set and get the X value of the Vector object.
 
long Y [get, set]
 public property to set and get the Y value of the Vector object.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VectorL() [1/3]

VectorL ( long  x,
long  y 
)

Creates a VectorL from two long values.

Parameters
xX value of new VectorL object.
yY value of new VectorL object.

◆ VectorL() [2/3]

VectorL ( VectorL  v)

Copy constructor.

Parameters
vvectorL to be copied

◆ VectorL() [3/3]

VectorL ( Vector  v)

Copy constructor for vector object.

Parameters
vvector to be copied

Member Function Documentation

◆ Max()

static long Max ( Vector  a)
static

Returns the maximal component of a VectorL.

Parameters
athe VectorL to investigate
Returns
the maximum of x and y

◆ operator Vector()

static operator Vector ( VectorL  vector)
explicitstatic

Converts a VectorL object to a Vector object.

Parameters
vectorVectorL object to be converted.
Returns
Converted Vector.

◆ operator VectorL() [1/2]

static implicit operator VectorL ( Vector  vector)
static

Implicitly converts a Vector object to a VectorL object.

Parameters
vectorVector object to be converted.
Returns
Converted VectorL.

◆ operator VectorL() [2/2]

static operator VectorL ( VectorD  vector)
explicitstatic

Converts a VectorD object to a VectorL object.

Parameters
vectorVectorD object to be converted.
Returns
Converted VectorL.

◆ operator!=()

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

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

Parameters
vector1First VectorL object to compare.
vector2Second VectorL object to compare.
Returns
Returns true if the two objects are unequal.

◆ operator*() [1/3]

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

Multiplies a VectorL object by a long value.

///

Parameters
factorThe long value to multiply.
vectorThe VectorL object to multiply.
Returns
Returns the product of the VectorL object and the long value.

◆ operator*() [2/3]

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

Multiplies two VectorL objects.

Parameters
aThe first VectorL object to multiply.
bThe second VectorL object to multiply.
Returns
Returns the product of the two VectorL objects.

◆ operator*() [3/3]

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

Multiplies a VectorL object by a long value.

Parameters
vectorThe VectorL object to multiply.
factorThe long value to multiply.
Returns
Returns the product of the VectorL object and the long value.

◆ operator+()

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

Adds two VectorL objects.

Parameters
aThe first VectorL object to add.
bThe second VectorL object to add.
Returns
Returns the sum of the two VectorL objects.

◆ operator-()

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

Subtracts two VectorL objects.

Parameters
aThe first VectorL object to substract from.
bThe second VectorL object to substract.
Returns
Returns the difference of the two VectorL objects.

◆ operator/() [1/3]

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

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).

Parameters
numberThe long value to divide by the components of the VectorL object.
vectorThe VectorL object used as divisor.
Returns
Returns the quotient of the long value and the VectorL object.

◆ operator/() [2/3]

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

Performs a component-wise division of two VectorL objects.

Parameters
aThe first VectorL object to divide by parameter b.
bThe second VectorL object used as divisor.
Returns
Returns the quotient of the two VectorL objects.

◆ operator/() [3/3]

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

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

Parameters
vectorThe VectorL object to divide by the long value.
divisorThe long value used as divisor.
Returns
Returns the quotient of the VectorL object and the long value.

◆ operator==()

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

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

Parameters
vector1First VectorL object to compare.
vector2Second VectorL object to compare.
Returns
Returns true if the two objects are equal.

◆ operator|()

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

Calculates the scalar product of two VectorL objects.

Parameters
aFirst VectorL object.
bSecond VectorL object.
Returns
Scalar product of the two VectorL objects.

◆ ToString()

override string ToString ( )

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

Returns
String containing the VectorL information.