View Source
Class Vector3
This is a temporary class until .NET 4.6 is released with Vector3 support. Borrowed from my Cardan.Math library
Inheritance
System.Object
Vector3
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace:EvilDICOM.Core.Helpers
Assembly:EvilDICOM.dll
Syntax
Constructors
View Source
Vector3(Double, Double, Double)
Declaration
public Vector3(double x = 0, double y = 0, double z = 0)
Parameters
| Type |
Name |
Description |
| System.Double |
x |
|
| System.Double |
y |
|
| System.Double |
z |
|
View Source
Vector3(Double[])
Declaration
public Vector3(double[] values)
Parameters
| Type |
Name |
Description |
| System.Double[] |
values |
|
Properties
View Source
Infinite
A static infinite value vector creator. Returns a vector3 containing positive infinite value elements.
Declaration
public static Vector3 Infinite { get; }
Property Value
View Source
Item[Int64]
Allows the vector class elements to be accessed by index
Declaration
public double this[long index] { get; set; }
Parameters
| Type |
Name |
Description |
| System.Int64 |
index |
the index of the element to return
|
Property Value
| Type |
Description |
| System.Double |
the element at the specified index
|
View Source
Length
Declaration
public int Length { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
View Source
NaN
A static infinite value vector creator. Returns a vector3 containing NaN value elements.
Declaration
public static Vector3 NaN { get; }
Property Value
View Source
Values
Declaration
public double[] Values { get; set; }
Property Value
| Type |
Description |
| System.Double[] |
|
View Source
X
Declaration
public double X { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
View Source
Y
Declaration
public double Y { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
View Source
Z
Declaration
public double Z { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
View Source
Zeroes
A static zero value vector creator. Returns a vector3 containing only zero value elements.
Declaration
public static Vector3 Zeroes { get; }
Property Value
Methods
View Source
Copy()
Creates a copy of this vector
Declaration
Returns
View Source
CrossMultiply(Vector3)
Computes the cross product of this vector and another input vector
Declaration
public Vector3 CrossMultiply(Vector3 v)
Parameters
| Type |
Name |
Description |
| Vector3 |
v |
the input vector
|
Returns
| Type |
Description |
| Vector3 |
a new vector that is the cross product of the two vectors
|
View Source
DistanceTo(Vector3)
Declaration
public float DistanceTo(Vector3 v)
Parameters
Returns
| Type |
Description |
| System.Single |
|
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.Object.GetHashCode()
View Source
Norm()
Finds the magnitude of this vector
Declaration
Returns
| Type |
Description |
| System.Double |
a double representing the magnitude of the vector
|
View Source
ToArray()
Declaration
public double[] ToArray()
Returns
| Type |
Description |
| System.Double[] |
|
View Source
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.Object.ToString()
Operators
View Source
Addition(Vector3, Vector3)
Declaration
public static Vector3 operator +(Vector3 v1, Vector3 v2)
Parameters
Returns
View Source
Division(Vector3, Double)
Declaration
public static Vector3 operator /(Vector3 v1, double s)
Parameters
| Type |
Name |
Description |
| Vector3 |
v1 |
|
| System.Double |
s |
|
Returns
View Source
Equality(Vector3, Vector3)
Declaration
public static bool operator ==(Vector3 v1, Vector3 v2)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
View Source
Inequality(Vector3, Vector3)
Declaration
public static bool operator !=(Vector3 v1, Vector3 v2)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
View Source
Multiply(Vector3, Vector3)
Computes the scalar (dot) product of two vectors
Declaration
public static double operator *(Vector3 v1, Vector3 v2)
Parameters
| Type |
Name |
Description |
| Vector3 |
v1 |
the first vector
|
| Vector3 |
v2 |
the second vector
|
Returns
| Type |
Description |
| System.Double |
The scalar product of two vectors
|
View Source
Multiply(Vector3, Double)
Declaration
public static Vector3 operator *(Vector3 v1, double s)
Parameters
| Type |
Name |
Description |
| Vector3 |
v1 |
|
| System.Double |
s |
|
Returns
View Source
Multiply(Double, Vector3)
Declaration
public static Vector3 operator *(double s, Vector3 v1)
Parameters
| Type |
Name |
Description |
| System.Double |
s |
|
| Vector3 |
v1 |
|
Returns
View Source
Subtraction(Vector3, Vector3)
Declaration
public static Vector3 operator -(Vector3 v1, Vector3 v2)
Parameters
Returns