Class Vector3d
Represents a 3D Vector entity.
Inherited Members
Namespace: Paramdigma.Core.Geometry
Assembly: Paramdigma.Core.dll
Syntax
public class Vector3d : BasePoint
Constructors
| Improve this Doc View SourceVector3d()
Initializes a new instance of the Vector3d class.
Declaration
public Vector3d()
Vector3d(Point3d)
Initializes a new instance of the Vector3d class from a v.
Declaration
public Vector3d(Point3d point)
Parameters
Type | Name | Description |
---|---|---|
Point3d | point | Point to copy values from. |
Vector3d(Vector3d)
Initializes a new instance of the Vector3d class with the same values as the provided vector.
Declaration
public Vector3d(Vector3d vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | vector | Vector to copy values from. |
Vector3d(Double, Double, Double)
Initializes a new instance of the Vector3d class given it's 3 coordinates.
Declaration
public Vector3d(double xCoord, double yCoord, double zCoord)
Parameters
Type | Name | Description |
---|---|---|
System.Double | xCoord | X coordinate. |
System.Double | yCoord | Y coordinate. |
System.Double | zCoord | Z coordinate. |
Properties
| Improve this Doc View SourceLength
Gets the Euclidean length of this vector.
Declaration
public double Length { get; }
Property Value
Type | Description |
---|---|
System.Double | Length of the vector. |
LengthSquared
Gets the Euclidean length squared of this vector.
Declaration
public double LengthSquared { get; }
Property Value
Type | Description |
---|---|
System.Double | Squared Length of the vector. |
UnitX
Gets a vector of unit length in the X direction.
Declaration
public static Vector3d UnitX { get; }
Property Value
Type | Description |
---|---|
Vector3d | Vector {1,0,0}. |
UnitY
Gets a vector of unit length in the Y direction.
Declaration
public static Vector3d UnitY { get; }
Property Value
Type | Description |
---|---|
Vector3d | Vector {0,1,0}. |
UnitZ
Gets a vector of unit length in the Z direction.
Declaration
public static Vector3d UnitZ { get; }
Property Value
Type | Description |
---|---|
Vector3d | Vector {0,1,0}. |
Methods
| Improve this Doc View SourceAngle(Vector3d, Vector3d)
Computes the angle in Radians between two given vectors Angle = Arcosine of the CrossProduct of UxV divided with their multiplied lengths.
Declaration
public static double Angle(Vector3d u, Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | u | First vector. |
Vector3d | v | Second vector. |
Returns
Type | Description |
---|---|
System.Double | Angle formed between u and v. |
Cross(Vector3d)
Returns the cross product of this vector and v.
Declaration
public Vector3d Cross(Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | Vector. |
Returns
Type | Description |
---|---|
Vector3d | Cross product vector. |
CrossProduct(Vector3d, Vector3d)
Computes the vector product (cross product) of two given vectors Cross product = { u2 * v3 - u3 * v2; u3 * v1 - u1 * v3; u1 * v2 - u2 * v1 }.
Declaration
public static Vector3d CrossProduct(Vector3d u, Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | u | First vector. |
Vector3d | v | Second vector. |
Returns
Type | Description |
---|---|
Vector3d | Vector result of the cross product. |
Dot(Vector3d)
Computes the dot product of this vector and v.
Declaration
public double Dot(Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | Vector. |
Returns
Type | Description |
---|---|
System.Double | Dot product. |
DotProduct(Vector3d, Vector3d)
Gets the scalar product (dot product) of two given vectors Dot product = u1v1 + u2v2 + u3*v3.
Declaration
public static double DotProduct(Vector3d u, Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | u | First vector. |
Vector3d | v | Second vector. |
Returns
Type | Description |
---|---|
System.Double | Numerical value of the dot product. |
ToString()
Converts a vector into a string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Returns a string representation of this vector. |
Overrides
| Improve this Doc View SourceUnit()
Returns a normalized copy of this vector.
Declaration
public Vector3d Unit()
Returns
Type | Description |
---|---|
Vector3d | A copy of this vector unitized. |
Unitize()
Divides this vector by it's euclidean length.
Declaration
public void Unitize()
Operators
| Improve this Doc View SourceAddition(Vector3d, Vector3d)
Adds one vector to another.
Declaration
public static Vector3d operator +(Vector3d v, Vector3d v2)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | First vector to add. |
Vector3d | v2 | Second vector to add. |
Returns
Type | Description |
---|---|
Vector3d | New vector entity with the result of the addition. |
Division(Vector3d, Double)
Divide a vector by a number.
Declaration
public static Vector3d operator /(Vector3d v, double scalar)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | Vector to be divided. |
System.Double | scalar | Number to be divided by. |
Returns
Type | Description |
---|---|
Vector3d | New vector entity with the result of the division. |
Equality(Vector3d, Vector3d)
Checks if two vectors are equal.
Declaration
public static bool operator ==(Vector3d v, Vector3d w)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | First vector. |
Vector3d | w | Second vector. |
Returns
Type | Description |
---|---|
System.Boolean | Result of the comparison between v and w. |
Inequality(Vector3d, Vector3d)
Checks if two vectors are not equal.
Declaration
public static bool operator !=(Vector3d v, Vector3d w)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | First vector. |
Vector3d | w | Second vector. |
Returns
Type | Description |
---|---|
System.Boolean | Result of the comparison between v and w. |
Multiply(Vector3d, Double)
Multiply one vector by a number.
Declaration
public static Vector3d operator *(Vector3d v, double scalar)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | Vector to multiply. |
System.Double | scalar | Number to multiply with. |
Returns
Type | Description |
---|---|
Vector3d | New vector entity with the result of the multiplication. |
Multiply(Double, Vector3d)
Multiply one vector by a number.
Declaration
public static Vector3d operator *(double scalar, Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
System.Double | scalar | Number to multiply with. |
Vector3d | v | Vector to multiply. |
Returns
Type | Description |
---|---|
Vector3d | New vector entity with the result of the multiplication. |
Subtraction(Vector3d, Vector3d)
Substracts one vector from another.
Declaration
public static Vector3d operator -(Vector3d v, Vector3d v2)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | Vector to substract from. |
Vector3d | v2 | Vector to be substracted. |
Returns
Type | Description |
---|---|
Vector3d | New vector entity with the result of the substraction. |
UnaryNegation(Vector3d)
Negate a vector.
Declaration
public static Vector3d operator -(Vector3d v)
Parameters
Type | Name | Description |
---|---|---|
Vector3d | v | Vector to negate. |
Returns
Type | Description |
---|---|
Vector3d | New vector entity with all the values negated. |