Programming Reference for VirtualLab Fusion
2025.1
|
This struct defines a two-dimensional vector of integer 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 integer too. Implicit casting to System.Drawing.Point and System.Drawing.Size is supported. More...
Public Member Functions | |
override string | ToString () |
Converts a Vector into a string of format (X; Y). | |
Vector (int x, int y) | |
Creates a Vector from two int values. | |
Vector (Vector v) | |
Copy constructor. | |
Static Public Member Functions | |
static int | Max (Vector a) |
Returns the maximal component of a Vector. | |
static implicit | operator Point (Vector vector) |
Converts a Vector object into System.Drawing.Point object. | |
static implicit | operator Size (Vector vector) |
Converts a Vector object into System.Drawing.Size object. | |
static implicit | operator Vector (Point point) |
Converts a System.Drawing.Point object into a Vector object. | |
static implicit | operator Vector (Size size) |
Converts a System.Drawing.Size object into a Vector object. | |
static | operator Vector (VectorD vector) |
Converts a VectorD object to a Vector object. | |
static bool | operator!= (Vector vector1, Vector vector2) |
Compares two Vector for inequality. The comparison will be done by comparing the values of the two x- and y-components respectively. | |
static Vector | operator% (Vector vector, int divisor) |
Performs a component-wise modulo operation of a Vector object and a int value. | |
static Vector | operator* (int factor, Vector vector) |
Multiplies a Vector object by a int value. | |
static Vector | operator* (Vector a, Vector b) |
Multiplies two Vector objects. | |
static Vector | operator* (Vector vector, int factor) |
Multiplies a Vector object by a int value. | |
static Vector | operator+ (Vector a, Vector b) |
Adds two Vector objects. | |
static Vector | operator- (Vector a, Vector b) |
Subtracts two Vector objects. | |
static Vector | operator/ (int number, Vector vector) |
Performs a component-wise division of a int value and a Vector object. The result is defined as new Vector(number / vector.X, number / vector.Y). | |
static Vector | operator/ (Vector a, Vector b) |
Performs a component-wise division of two Vector objects. | |
static Vector | operator/ (Vector vector, int divisor) |
Performs a component-wise division of a Vector object and a int value. | |
static bool | operator== (Vector vector1, Vector vector2) |
Compares two Vector for equality. The comparison will be done by comparing the values of the two x- and y-components respectively. | |
static int | operator| (Vector a, Vector b) |
Calculates the scalar product of two Vector objects. | |
static Vector | Parse (string stringToParse) |
Converts a string generated by the ToString method back into a Vector object. | |
Public Attributes | |
int | X |
X value of the Vector object. | |
int | Y |
Y value of the Vector object. | |
Static Public Attributes | |
static readonly Vector | MaxValue |
A constant containing the minimum allowed vector. | |
static readonly Vector | MinValue |
A constant containing the minimum allowed vector. | |
static readonly Vector | UnitVectorX |
A constant containing the unit vector in x-direction. | |
static readonly Vector | UnitVectorY |
A constant containing the unit vector in y-direction. | |
static readonly Vector | ZeroVector |
A constant containing the zero vector (0, 0). | |
This struct defines a two-dimensional vector of integer 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 integer too. Implicit casting to System.Drawing.Point and System.Drawing.Size is supported.
Vector | ( | int | x, |
int | y | ||
) |
Creates a Vector from two int values.
x | X value of new Vector object. |
y | Y value of new Vector object. |
|
static |
Returns the maximal component of a Vector.
a |
inheritdoc/>
|
static |
Converts a Vector object into System.Drawing.Point object.
vector | Vector objectto to convert into a System.Drawing.Point object. |
|
static |
Converts a Vector object into System.Drawing.Size object.
vector | Vector objectto to convert into a System.Drawing.Size object. |
|
static |
Converts a System.Drawing.Point object into a Vector object.
point | The System.Drawing.Point object to convert into a Vector object. |
|
static |
Converts a System.Drawing.Size object into a Vector object.
size | The System.Drawing.Size object to convert into a Vector object. |
Converts a VectorD object to a Vector object.
vector | VectorD object to be converted. |
Compares two Vector for inequality. The comparison will be done by comparing the values of the two x- and y-components respectively.
vector1 | First Vector object to compare. |
vector2 | Second Vector object to compare. |
Performs a component-wise modulo operation of a Vector object and a int value.
vector | The Vector object (dividend). |
divisor | The int value used as divisor of the modulo operation. |
Multiplies a Vector object by a int value.
///
factor | The int value to multiply. |
vector | The Vector object to multiply. |
Multiplies two Vector objects.
a | The first Vector object to multiply. |
b | The second Vector object to multiply. |
Multiplies a Vector object by a int value.
vector | The Vector object to multiply. |
factor | The int value to multiply. |
Adds two Vector objects.
a | The first Vector object to add. |
b | The second Vector object to add. |
Subtracts two Vector objects.
a | The first Vector object to subtract from. |
b | The second Vector object to subtract. |
Performs a component-wise division of a int value and a Vector object. The result is defined as new Vector(number / vector.X, number / vector.Y).
number | The int value to divide by the components of the Vector object. |
vector | The Vector object used as divisor. |
Performs a component-wise division of two Vector objects.
a | The first Vector object to divide by parameter b. |
b | The second Vector object used as divisor. |
Performs a component-wise division of a Vector object and a int value.
vector | The Vector object to divide by the int value. |
divisor | The int value used as divisor. |
Compares two Vector for equality. The comparison will be done by comparing the values of the two x- and y-components respectively.
vector1 | First Vector object to compare. |
vector2 | Second Vector object to compare. |
Calculates the scalar product of two Vector objects.
a | First Vector object. |
b | Second Vector object. |
|
static |
Converts a string generated by the ToString method back into a Vector object.
stringToParse | The string to be parsed. |
override string ToString | ( | ) |
Converts a Vector into a string of format (X; Y).