Class Vector3D
Represents a displacement in 3-D space.
Inheritance
Namespace: Telerik.Windows.Media.Media3D
Assembly: Telerik.Windows.Controls.Charting.dll
Syntax
public sealed class Vector3D : ValueType
Constructors
Vector3D(Double, Double, Double)
Initializes a new instance of the Vector3D structure.
Declaration
public Vector3D(double x, double y, double z)
Parameters
System.Double
x
The X value of the new Vector3D structure. |
System.Double
y
The Y value of the new Vector3D structure. |
System.Double
z
The Z value of the new Vector3D structure. |
Properties
Empty
Gets a value that represents an empty Vector3D structure.
Declaration
public static Vector3D Empty { get; }
Property Value
Vector3D
|
Remarks
A Vector3D structure with X, Y, and Z values set to 0 is not empty. An empty Vector3D structure has X, Y, and Z values set to negative infinity.
IsEmpty
Gets a value that indicates whether this Vector3D structure is empty.
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
|
Remarks
A Vector3D structure with X, Y, and Z values set to 0 is not empty. An empty Vector3D structure has X, Y, and Z values set to negative infinity.
Length
Gets the length of this Vector3D structure.
Declaration
public double Length { get; }
Property Value
System.Double
|
LengthSquared
Gets the square of the length of this Vector3D structure.
Declaration
public double LengthSquared { get; }
Property Value
System.Double
|
X
Gets or sets the x component of this Vector3D structure.
Declaration
public double X { get; set; }
Property Value
System.Double
|
Y
Gets or sets the y component of this Vector3D structure.
Declaration
public double Y { get; set; }
Property Value
System.Double
|
Z
Gets or sets the z component of this Vector3D structure.
Declaration
public double Z { get; set; }
Property Value
System.Double
|
Methods
Add(Vector3D, Point3D)
Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure.
Declaration
public static Point3D Add(Vector3D vector, Point3D point)
Parameters
Vector3D
vector
The Vector3D structure used to translate the specified Point3D structure. |
Point3D
point
The Point3D structure to be translated. |
Returns
Point3D
Returns the result of translating point by vector. |
Add(Vector3D, Vector3D)
Adds two Vector3D structures and returns the result as a Vector3D structure.
Declaration
public static Vector3D Add(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to add. |
Vector3D
vector2
The second Vector3D structure to add. |
Returns
Vector3D
Returns the sum of vector1 and vector2. |
AngleBetween(Vector3D, Vector3D)
Retrieves the angle required to rotate the first specified Vector3D structure into the second specified Vector3D structure.
Declaration
public static double AngleBetween(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to evaluate. |
Vector3D
vector2
The second Vector3D structure to evaluate. |
Returns
System.Double
Returns the angle in degrees needed to rotate vector1 into vector2. |
Remarks
Signed angles do not extend into 3-D space, so an angle between 0 and 180 degrees is returned.
CrossProduct(Vector3D, Vector3D)
Calculates the cross product of two Vector3D structures.
Declaration
public static Vector3D CrossProduct(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to evaluate. |
Vector3D
vector2
The second Vector3D structure to evaluate. |
Returns
Vector3D
Returns the cross product of vector1 and vector2. |
Divide(Vector3D, Double)
Divides the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.
Declaration
public static Vector3D Divide(Vector3D vector, double scalar)
Parameters
Vector3D
vector
The Vector3D structure to be divided. |
System.Double
scalar
The scalar to divide vector by. |
Returns
Vector3D
Returns the result of dividing vector by scalar. |
DotProduct(Vector3D, Vector3D)
Calculates the dot product of two Vector3D structures.
Declaration
public static double DotProduct(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to evaluate. |
Vector3D
vector2
The second Vector3D structure to evaluate. |
Returns
System.Double
Returns the dot product of vector1 and vector2. |
Equals(Object)
Determines whether the specified Object is a Vector3D structure and if so, whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Vector3D structure.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
The Object to compare. |
Returns
System.Boolean
true if o (the passed Object) is a Vector3D structure and if it is also identical to this Vector3D structure; otherwise, false. |
Equals(Vector3D)
Compares two Vector3D structures for equality.
Declaration
public bool Equals(Vector3D vector)
Parameters
Vector3D
vector
The instance of Vector3D to compare to this instance. |
Returns
System.Boolean
true if instances are equal; otherwise, false. |
Equals(Vector3D, Vector3D)
Compares two Vector3D structures for equality.
Declaration
public static bool Equals(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to compare. |
Vector3D
vector2
The second Vector3D structure to compare. |
Returns
System.Boolean
true if the X, Y, and Z values for vector1 and vector2 are equal; otherwise, false. |
Remarks
Two Vector3D structures are equal if the values of their X, Y, and Z properties are the same. Because the value of Doubles can lose precision when you perform arithmetic operations on them, a comparison between two Doubles that are logically equal might fail.
GetHashCode()
Gets a hash code for this Vector3D structure.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this Vector3D structure. |
Multiply(Double, Vector3D)
Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.
Declaration
public static Vector3D Multiply(double scalar, Vector3D vector)
Parameters
System.Double
scalar
The scalar to multiply. |
Vector3D
vector
The Vector3D structure to multiply. |
Returns
Vector3D
Returns the result of multiplying scalar and vector. |
Multiply(Vector3D, Double)
Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.
Declaration
public static Vector3D Multiply(Vector3D vector, double scalar)
Parameters
Vector3D
vector
The Vector3D structure to multiply. |
System.Double
scalar
The scalar to multiply. |
Returns
Vector3D
Returns the result of multiplying scalar and vector. |
Multiply(Vector3D, Matrix3D)
Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure.
Declaration
public static Vector3D Multiply(Vector3D vector, Matrix3D matrix)
Parameters
Vector3D
vector
The Vector3D structure to transform. |
Matrix3D
matrix
The transformation to apply to the Vector3D structure. |
Returns
Vector3D
Returns the result of transforming vector by matrix3D. |
Negate()
Negates a Vector3D structure.
Declaration
public void Negate()
Normalize()
Normalizes the specified Vector3D structure.
Declaration
public void Normalize()
Parse(String)
Converts a String representation of a 3-D vector into the equivalent Vector3D structure.
Declaration
public static Vector3D Parse(string source)
Parameters
System.String
source
The String representation of the 3-D vector. |
Returns
Vector3D
The equivalent Vector3D structure. |
Subtract(Vector3D, Point3D)
Subtracts a Point3D structure from a Vector3D structure.
Declaration
public static Point3D Subtract(Vector3D vector, Point3D point)
Parameters
Vector3D
vector
The Vector3D structure to be subtracted from. |
Point3D
point
The Point3D structure to subtract from vector. |
Returns
Point3D
Returns the result of subtracting point from vector. |
Subtract(Vector3D, Vector3D)
Subtracts a Vector3D structure from a Vector3D structure.
Declaration
public static Vector3D Subtract(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The Vector3D structure to be subtracted from. |
Vector3D
vector2
The Vector3D structure to subtract from vector1. |
Returns
Vector3D
Returns the result of subtracting vector2 from vector1. |
ToString()
Creates a String representation of this Vector3D structure.
Declaration
public override string ToString()
Returns
System.String
A String containing the X, Y, and Z values of this Vector3D structure. |
ToString(IFormatProvider)
Creates a String representation of this Vector3D structure.
Declaration
public string ToString(IFormatProvider provider)
Parameters
System.IFormatProvider
provider
The culture-specific formatting information. |
Returns
System.String
A String containing the X, Y, and Z values of this Vector3D structure. |
Operators
Addition(Vector3D, Point3D)
Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure.
Declaration
public static Point3D operator +(Vector3D vector, Point3D point)
Parameters
Vector3D
vector
The Vector3D structure used to translate the specified Point3D structure. |
Point3D
point
The Point3D structure to be translated. |
Returns
Point3D
Returns the result of translating point by vector. |
Addition(Vector3D, Vector3D)
Adds two Vector3D structures and returns the result as a Vector3D structure.
Declaration
public static Vector3D operator +(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to add. |
Vector3D
vector2
The second Vector3D structure to add. |
Returns
Vector3D
Returns the sum of vector1 and vector2. |
Division(Vector3D, Double)
Divides the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.
Declaration
public static Vector3D operator /(Vector3D vector, double scalar)
Parameters
Vector3D
vector
The Vector3D structure to be divided. |
System.Double
scalar
The scalar to divide vector by. |
Returns
Vector3D
Returns the result of dividing vector by scalar. |
Equality(Vector3D, Vector3D)
Compares two Vector3D structures for equality.
Declaration
public static bool operator ==(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to compare. |
Vector3D
vector2
The second Vector3D structure to compare. |
Returns
System.Boolean
True if the X, Y, and Z components of vector1 and vector2 are equal; false otherwise. |
Explicit(Vector3D to Point3D)
Converts a Vector3D structure into a Point3D structure.
Declaration
public static explicit operator Point3D(Vector3D vector)
Parameters
Vector3D
vector
The vector to convert. |
Returns
Point3D
The result of converting vector. |
Explicit(Vector3D to Size3D)
Converts a Vector3D structure into a Size3D.
Declaration
public static explicit operator Size3D(Vector3D vector)
Parameters
Vector3D
vector
The vector to convert. |
Returns
Size3D
The result of converting vector. |
Inequality(Vector3D, Vector3D)
Compares two Vector3D structures for inequality.
Declaration
public static bool operator !=(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The first Vector3D structure to compare. |
Vector3D
vector2
The second Vector3D structure to compare. |
Returns
System.Boolean
True if the X, Y, and Z components of vector1 and vector2 are different; false otherwise. |
Multiply(Double, Vector3D)
Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.
Declaration
public static Vector3D operator *(double scalar, Vector3D vector)
Parameters
System.Double
scalar
The scalar to multiply. |
Vector3D
vector
The Vector3D structure to multiply. |
Returns
Vector3D
Returns the result of multiplying scalar and vector. |
Multiply(Vector3D, Double)
Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.
Declaration
public static Vector3D operator *(Vector3D vector, double scalar)
Parameters
Vector3D
vector
The Vector3D structure to multiply. |
System.Double
scalar
The scalar to multiply. |
Returns
Vector3D
Returns the result of multiplying scalar and vector. |
Multiply(Vector3D, Matrix3D)
Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure.
Declaration
public static Vector3D operator *(Vector3D vector, Matrix3D matrix)
Parameters
Vector3D
vector
The Vector3D structure to transform. |
Matrix3D
matrix
The transformation to apply to the Vector3D structure. |
Returns
Vector3D
Returns the result of transforming vector by matrix3D. |
Subtraction(Vector3D, Point3D)
Subtracts a Point3D structure from a Vector3D structure.
Declaration
public static Point3D operator -(Vector3D vector, Point3D point)
Parameters
Vector3D
vector
The Vector3D structure to be subtracted from. |
Point3D
point
The Point3D structure to subtract from vector. |
Returns
Point3D
Returns the result of subtracting point from vector. |
Subtraction(Vector3D, Vector3D)
Subtracts a Vector3D structure from a Vector3D structure.
Declaration
public static Vector3D operator -(Vector3D vector1, Vector3D vector2)
Parameters
Vector3D
vector1
The Vector3D structure to be subtracted from. |
Vector3D
vector2
The Vector3D structure to subtract from vector1. |
Returns
Vector3D
Returns the result of subtracting vector2 from vector1. |
UnaryNegation(Vector3D)
Negates a Vector3D structure.
Declaration
public static Vector3D operator -(Vector3D vector)
Parameters
Vector3D
vector
The Vector3D structure to negate. |
Returns
Vector3D
Returns a Vector3D structure with X, Y, and Z values opposite of the X, Y, and Z values of vector. |