![]() |
SystemEX
Lacking
Additional generic collection types missing in .net
|
Public Member Functions | |
| Vec2d () | |
| Initializes a zero vector (0,0). | |
| Vec2d (double _x, double _y) | |
| Initializes a vector with explicit X and Y values. | |
| Vec2d (double _f) | |
| Initializes both components with the same value. | |
| Vec2d (Vec2d vec) | |
| Copy constructor. | |
| Vec2d (double[] lpvec) | |
| Initializes the vector from a double array. | |
| double | Get (int index) |
| Gets a component by index (0 = X, 1 = Y). | |
| override int | GetHashCode () |
| Computes a hash code for this vector. | |
| int | CompareTo (object? obj) |
| Compares this vector to another object. | |
| CompareResult | CompareTo (Vec2d a) |
| Compares two vectors lexicographically. | |
| bool | Equals (Vec2d other) |
| Determines whether this instance is equal to another Vec2d value, using the same semantics as the operator ==(Vec2d,Vec2d). | |
| override bool | Equals (object? obj) |
| Determines whether this instance is equal to another object. | |
| int IComparable< Vec2d >. | CompareTo (Vec2d other) |
| FixedVector< byte > | ToBytes () |
| Converts the vector into a deterministic byte sequence. | |
| Public Member Functions inherited from SystemEx.IComparableEx< T > | |
| CompareResult | CompareTo (T a) |
| Compares this instance with the specified value and returns a CompareResult describing the relationship between them. | |
Static Public Member Functions | |
| static double | Lenght (Vec2d v) |
| Computes the squared length of the vector. | |
| static double | LenghtSqrt (Vec2d v) |
| Computes the Euclidean length of the vector. | |
| static double | Dot (Vec2d v1, Vec2d v2) |
| Computes the dot product of two vectors. | |
| static double | Angle (Vec2d v1, Vec2d v2) |
| Computes the angle between two vectors. | |
| static Vec2d | InterpolateCoords (Vec2d v1, Vec2d v2, double p) |
| Linearly interpolates between two vectors. | |
| static Vec2d | InterpolateNormal (Vec2d v1, Vec2d v2, double p) |
| Interpolates and normalizes the result. | |
| static bool | NearEqual (Vec2d v1, Vec2d v2, double epsilon) |
| Checks whether two vectors are approximately equal. | |
| static Vec2d | Normalize (Vec2d v, bool ex=false) |
| Normalizes the vector. | |
| static Vec2d | operator+ (Vec2d a, Vec2d b) |
| Adds two vectors component‑wise. | |
| static Vec2d | operator- (Vec2d a, Vec2d b) |
| Subtracts two vectors component‑wise. | |
| static Vec2d | operator/ (Vec2d a, Vec2d b) |
| Divides two vectors component‑wise. | |
| static Vec2d | operator* (Vec2d a, Vec2d b) |
| Multiplies two vectors component‑wise. | |
| static Vec2d | operator+ (Vec2d a, double b) |
| Adds a scalar to both components of the vector. | |
| static Vec2d | operator- (Vec2d a, double b) |
| Subtracts a scalar from both components of the vector. | |
| static Vec2d | operator/ (Vec2d a, double b) |
| Divides both components of the vector by a scalar. | |
| static Vec2d | operator* (Vec2d a, double b) |
| static Vec2d | operator- (double a, Vec2d b) |
| Subtracts each component of the vector from a scalar. | |
| static Vec2d | operator/ (double a, Vec2d b) |
| static Vec2d | operator* (double a, Vec2d b) |
| Multiplies a scalar with each component of the vector. | |
| static Vec2d | operator+ (double a, Vec2d b) |
| Adds a scalar to each component of the vector. | |
| static bool | operator== (Vec2d a, Vec2d b) |
| Determines whether two vectors are equal component‑wise. | |
| static bool | operator!= (Vec2d a, Vec2d b) |
| Determines whether two vectors differ in any component. | |
| static bool | operator<= (Vec2d a, Vec2d b) |
| Determines whether all components of a are less than or equal to those of b . | |
| static bool | operator>= (Vec2d a, Vec2d b) |
| Determines whether all components of a are greater than or equal to those of b . | |
| static bool | operator< (Vec2d a, Vec2d b) |
| Determines whether all components of a are strictly less than those of b . | |
| static bool | operator> (Vec2d a, Vec2d b) |
| Determines whether all components of a are strictly greater than those of b . | |
| static bool | operator== (double a, Vec2d b) |
| Determines whether a scalar equals both components of the vector. | |
| static bool | operator!= (double a, Vec2d b) |
| Determines whether a scalar differs from any component of the vector. | |
| static bool | operator<= (double a, Vec2d b) |
| Determines whether a scalar is less than or equal to both vector components. | |
| static bool | operator>= (double a, Vec2d b) |
| Determines whether a scalar is greater than or equal to both vector components. | |
| static bool | operator< (double a, Vec2d b) |
| Determines whether a scalar is strictly less than both vector components. | |
| static bool | operator> (double a, Vec2d b) |
| Determines whether a scalar is strictly greater than both vector components. | |
| static bool | operator== (Vec2d a, double b) |
| Determines whether both vector components equal the scalar. | |
| static bool | operator!= (Vec2d a, double b) |
| Determines whether any vector component differs from the scalar. | |
| static bool | operator<= (Vec2d a, double b) |
| Determines whether both vector components are less than or equal to the scalar. | |
| static bool | operator>= (Vec2d a, double b) |
| Determines whether both vector components are greater than or equal to the scalar. | |
| static bool | operator< (Vec2d a, double b) |
| Determines whether both vector components are strictly less than the scalar. | |
| static bool | operator> (Vec2d a, double b) |
| Determines whether both vector components are strictly greater than the scalar. | |
Static Public Attributes | |
| static readonly Vec2d | Zero = new Vec2d(0) |
| Represents Vector(0,0). | |
| static readonly Vec2d | One = new Vec2d(1f) |
| Represents Vector(1,1). | |
| static readonly Vec2d | NegativeOne = new Vec2d(-1f) |
| Represents Vector(-1,-1). | |
| static readonly Vec2d | Min = new Vec2d(int.MinValue) |
| Represents Vector(MIN,MIN). | |
| static readonly Vec2d | Max = new Vec2d(int.MaxValue) |
| Represents Vector(MAX,MAX). | |
Properties | |
| int | Count [get] |
| Gets the number of components in this vector (always 2). | |
| double | X [get, set] |
| Gets or sets the X component. | |
| double | Y [get, set] |
| Gets or sets the Y component. | |
| SystemEx.Numeric.Vec2d.Vec2d | ( | ) |
Initializes a zero vector (0,0).
| SystemEx.Numeric.Vec2d.Vec2d | ( | double | _x, |
| double | _y ) |
Initializes a vector with explicit X and Y values.
| SystemEx.Numeric.Vec2d.Vec2d | ( | double | _f | ) |
Initializes both components with the same value.
| SystemEx.Numeric.Vec2d.Vec2d | ( | Vec2d | vec | ) |
Copy constructor.
| SystemEx.Numeric.Vec2d.Vec2d | ( | double[] | lpvec | ) |
Initializes the vector from a double array.
Computes the angle between two vectors.
| int SystemEx.Numeric.Vec2d.CompareTo | ( | object? | obj | ) |
Compares this vector to another object.
| CompareResult SystemEx.Numeric.Vec2d.CompareTo | ( | Vec2d | a | ) |
Compares two vectors lexicographically.
Computes the dot product of two vectors.
| override bool SystemEx.Numeric.Vec2d.Equals | ( | object? | obj | ) |
Determines whether this instance is equal to another object.
The object is considered equal if it is a Vec2d and compares equal using Equals(Vec2d).
| obj | The object to compare with. |
true if obj is a Vec2d and equal to this instance; otherwise false. | bool SystemEx.Numeric.Vec2d.Equals | ( | Vec2d | other | ) |
Determines whether this instance is equal to another Vec2d value, using the same semantics as the operator ==(Vec2d,Vec2d).
| other | The value to compare with. |
true if the values are equal; otherwise false. | double SystemEx.Numeric.Vec2d.Get | ( | int | index | ) |
Gets a component by index (0 = X, 1 = Y).
| override int SystemEx.Numeric.Vec2d.GetHashCode | ( | ) |
Computes a hash code for this vector.
The primary hash is generated using HashFactory and the HashAlgorithmAttribute applied to this struct.
If hashing fails (rare), a fallback XOR‑based hash is used.
Linearly interpolates between two vectors.
Interpolates and normalizes the result.
|
static |
Computes the squared length of the vector.
|
static |
Computes the Euclidean length of the vector.
Normalizes the vector.
|
static |
Determines whether a scalar differs from any component of the vector.
|
static |
Determines whether any vector component differs from the scalar.
Determines whether two vectors differ in any component.
Multiplies a scalar with each component of the vector.
Multiplies both components of the vector by a scalar.
Multiplies two vectors component‑wise.
Adds a scalar to each component of the vector.
Adds a scalar to both components of the vector.
Adds two vectors component‑wise.
Subtracts each component of the vector from a scalar.
Subtracts a scalar from both components of the vector.
Subtracts two vectors component‑wise.
Divides a scalar by each component of the vector.
Divides both components of the vector by a scalar.
Divides two vectors component‑wise.
|
static |
Determines whether a scalar is strictly less than both vector components.
|
static |
Determines whether both vector components are strictly less than the scalar.
Determines whether all components of a are strictly less than those of b .
|
static |
Determines whether a scalar is less than or equal to both vector components.
|
static |
Determines whether both vector components are less than or equal to the scalar.
Determines whether all components of a are less than or equal to those of b .
|
static |
Determines whether a scalar equals both components of the vector.
|
static |
Determines whether both vector components equal the scalar.
Determines whether two vectors are equal component‑wise.
|
static |
Determines whether a scalar is strictly greater than both vector components.
|
static |
Determines whether both vector components are strictly greater than the scalar.
Determines whether all components of a are strictly greater than those of b .
|
static |
Determines whether a scalar is greater than or equal to both vector components.
|
static |
Determines whether both vector components are greater than or equal to the scalar.
Determines whether all components of a are greater than or equal to those of b .
| FixedVector< byte > SystemEx.Numeric.Vec2d.ToBytes | ( | ) |
Converts the vector into a deterministic byte sequence.
This method is used by HashFactory to compute attribute‑driven hashes. The byte layout is stable and platform‑safe, ensuring consistent hashing across devices and backends.
Implements SystemEx.Hash.IHashable< T >.
Represents Vector(MAX,MAX).
Represents Vector(MIN,MIN).
|
get |
Gets the number of components in this vector (always 2).
|
getset |
Gets or sets the X component.
|
getset |
Gets or sets the Y component.