|
Programming Reference for VirtualLab Fusion
2022.1
|
This struct defines a two-dimensional vector of double numbers. Operators \(a+b\), \(a-b\) and \(a|b\) (Scalar product) can be used. One operand on \(a*b\), \(a/b\) (applied separate on components) can be also a double. It is also possible to raise a VectorD to a given power ( \(a^b\)). Implicit casting from Vector is supported. More...
Public Member Functions | |
| double | Abs () |
| Calculates the absolute value of this VectorD object. The absolute value corresponds with the length of the vector. More... | |
| VectorD | Ceil () |
| Calculates smallest integers less than X and Y component and creates new VectorD using them. More... | |
| VectorD | ComponentAbs () |
| Calculates the absolute values of both elements of the current VectorD and creates new one using them. More... | |
| VectorD | Floor () |
| Calculates smallest integers greater than X and Y component and creates new VectorD using them. More... | |
| double | Max () |
| returns the maximal component value More... | |
| double | Min () |
| returns the minimal component value More... | |
| double | Norm () |
| Calculates the norm (squared absolute value) of the present VectorD object. More... | |
| void | Normalize () |
| Normalizes the present VectorD object. More... | |
| VectorD | Reziprocal () |
| Calculates the reciprocals of both components of current VectorD object and returns the result as new object. More... | |
| VectorD | Round () |
| Rounds both X and Y coordinate of a VectorD to an integer and creates new VectorD using them. More... | |
| Vector | RoundToVector () |
| Round both X and Y to int and returns a Vector. More... | |
| VectorD | Sqrt () |
| Calculates the square roots of the components of the present VectorD object and returns a new object. More... | |
| override string | ToString () |
| Converts this VectorD into a string of format (X; Y). More... | |
| string | ToString (int numberOfDigits) |
| Converts this VectorD into a string of format (X; Y). More... | |
| VectorD (double x, double y) | |
| Creates a VectorD from two double values. More... | |
| VectorD (Tuple< double, double > values) | |
| Initializes a new instance of the VectorD struct. from a tuple of two doubles. More... | |
| VectorD (Vector vector) | |
| Creates a new VectorD object from an existing Vector. More... | |
| VectorD (VectorD vector) | |
| Creates a new VectorD object from an existing object. More... | |
Static Public Member Functions | |
| static double | AngleBetweenVectors (VectorD vector1, VectorD vector2) |
| Calculates the angle between two vectors. More... | |
| static bool | AreCollinear (VectorD v1, VectorD v2) |
| Checks whether two VectorD objects are collinear, i.e. they are parallel or anti-parallel More... | |
| static VectorD | Max (VectorD v1, VectorD v2) |
| Gets the component-wise maximum of two double vectors. More... | |
| static VectorD | Min (VectorD v1, VectorD v2) |
| Gets the component-wise minimum of two double vectors. More... | |
| static implicit | operator PointF (VectorD vector) |
| Converts a VectorD object into a System.Drawing.PointF object. More... | |
| static implicit | operator SizeF (VectorD vector) |
| Converts a VectorD object into a System.Drawing.SizeF object. More... | |
| static implicit | operator VectorD (PointF size) |
| Converts a System.Drawing.PointF object into a VectorD object. More... | |
| static implicit | operator VectorD (SizeF size) |
| Converts a System.Drawing.SizeF object into a VectorD object. More... | |
| static implicit | operator VectorD (Vector vector) |
| Converts a Vector object to a VectorD object. More... | |
| static implicit | operator VectorD (VectorL vector) |
| Converts a VectorL object to a VectorD object. More... | |
| static bool | operator!= (VectorD vector1, VectorD vector2) |
| Compares two VectorD for inequality. The comparison will be done by comparing the values of the two x- and y- components respectively. More... | |
| static VectorD | operator* (double factor, VectorD vector) |
| Multiplies a VectorD objects by a double value. More... | |
| static VectorD | operator* (VectorD a, VectorD b) |
| Multiplies two VectorD objects. More... | |
| static VectorD | operator* (VectorD vector, double factor) |
| Multiplies a VectorD objects by a double value. More... | |
| static VectorD | operator+ (VectorD a, VectorD b) |
| Adds two VectorD objects. More... | |
| static VectorD | operator- (VectorD a) |
| Returns the negated argument. () More... | |
| static VectorD | operator- (VectorD a, VectorD b) |
| Subtracts two VectorD objects. More... | |
| static VectorD | operator/ (double number, VectorD vector) |
| Performs a component wise division of a double value and a VectorD object. The result is defined as new VectorD(number / vector.X, number / vector.Y). More... | |
| static VectorD | operator/ (VectorD a, VectorD b) |
| Performs a component wise division of two VectorD objects. More... | |
| static VectorD | operator/ (VectorD vector, double divisor) |
| Performs a component wise division of a VectorD object and a double value. More... | |
| static bool | operator== (VectorD vector1, VectorD vector2) |
| Compares two VectorD for equality. The comparison will be done by comparing the values of the two x- and y- components respectively. More... | |
| static double | operator| (VectorD a, VectorD b) |
| Calculates the scalar product of two VectorD objects. More... | |
| static VectorD | Parse (string vectorDAsString) |
| parse function of the VectorD class More... | |
| static VectorD | Power (VectorD vector, double exp) |
| Raises both components of current VectorD to the power of exp and creates new one using them. More... | |
Public Attributes | |
| double | X |
| X value of the VectorD object. | |
| double | Y |
| Y value of the VectorD object. | |
Static Public Attributes | |
| static VectorD | coords |
| Method which calculates the intersection of two line segments that are collinear. More... | |
| static readonly VectorD | DummyVector |
| A constant showing the absence of any useful direction | |
| static readonly VectorD | UndefinedVector |
| A constant vector containing 2 Double.NaNs. Property IsUndefined can be used to check for being undefined. | |
| static readonly VectorD | UnitVectorX |
| A constant containing the unit vector in x-direction. | |
| static readonly VectorD | UnitVectorY |
| A constant containing the unit vector in y-direction. | |
| static readonly VectorD | ZeroVector |
| A constant containing the zero vector (0, 0). | |
Properties | |
| bool | IsUndefined [get] |
| Gets whether a least one component of the vector is undefined. More... | |
This struct defines a two-dimensional vector of double numbers. Operators \(a+b\), \(a-b\) and \(a|b\) (Scalar product) can be used. One operand on \(a*b\), \(a/b\) (applied separate on components) can be also a double. It is also possible to raise a VectorD to a given power ( \(a^b\)). Implicit casting from Vector is supported.
| VectorD | ( | double | x, |
| double | y | ||
| ) |
| VectorD | ( | Tuple< double, double > | values | ) |
Initializes a new instance of the VectorD struct. from a tuple of two doubles.
| values | The tuple with the values. |
| double Abs | ( | ) |
Calculates the angle between two vectors.
| vector1 | The first vector. |
| vector2 | The second vector. |
Checks whether two VectorD objects are collinear, i.e. they are parallel or anti-parallel
| v1 | First vector to be checked for collinearity to second vector. |
| v2 | Second vector to be checked for collinearity to first vector. |
true if v1 and v2 are collinear or a zero vector is given, otherwise false.| VectorD Ceil | ( | ) |
Calculates smallest integers less than X and Y component and creates new VectorD using them.
| VectorD ComponentAbs | ( | ) |
Calculates the absolute values of both elements of the current VectorD and creates new one using them.
| VectorD Floor | ( | ) |
Calculates smallest integers greater than X and Y component and creates new VectorD using them.
| double Max | ( | ) |
returns the maximal component value
| double Min | ( | ) |
returns the minimal component value
| double Norm | ( | ) |
| void Normalize | ( | ) |
|
static |
|
static |
|
static |
|
static |
Performs a component wise division of a double value and a VectorD object. The result is defined as new VectorD(number / vector.X, number / vector.Y).
| number | The double value to divide by the components of the VectorD object. |
| vector | The VectorD object used as divisor. |
|
static |
Raises both components of current VectorD to the power of exp and creates new one using them.
| vector | Base. |
| exp | Exponent. |
| VectorD Reziprocal | ( | ) |
| VectorD Round | ( | ) |
| VectorD Sqrt | ( | ) |
| override string ToString | ( | ) |
| string ToString | ( | int | numberOfDigits | ) |
Converts this VectorD into a string of format (X; Y).
| numberOfDigits | The number of significant digits returned for the vector components. |
|
static |
Method which calculates the intersection of two line segments that are collinear.
| firstSegment | First line segment. |
| secondSegment | Second line segment. |
|
get |
Gets whether a least one component of the vector is undefined.
true iff at least one component of the vector is NaN.