# Vector3D Structure

**.NET Framework 4**

Represents a displacement in 3-D space.

**Namespace:**System.Windows.Media.Media3D

**Assembly:**PresentationCore (in PresentationCore.dll)

**XMLNS for XAML:**http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

The Vector3D type exposes the following members.

Name | Description | |
---|---|---|

Length | Gets the length of this Vector3D structure. | |

LengthSquared | Gets the square of the length of this Vector3D structure. | |

X | Gets or sets the X component of this Vector3D structure. | |

Y | Gets or sets the Y component of this Vector3D structure. | |

Z | Gets or sets the Z component of this Vector3D structure. |

Name | Description | |
---|---|---|

Add(Vector3D, Point3D) | Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure. | |

Add(Vector3D, Vector3D) | Adds two Vector3D structures and returns the result as a Vector3D structure. | |

AngleBetween | Retrieves the angle required to rotate the first specified Vector3D structure into the second specified Vector3D structure. | |

CrossProduct | Calculates the cross product of two Vector3D structures. | |

Divide | Divides the specified Vector3D structure by the specified scalar and returns the result as a Vector3D. | |

DotProduct | Calculates the dot product of two Vector3D structures. | |

Equals(Object) | Determines whether the specified object is a Vector3D structure and whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Vector3D structure. (Overrides ValueType.Equals(Object).) | |

Equals(Vector3D) | Compares two Vector3D structures for equality. | |

Equals(Vector3D, Vector3D) | Compares two Vector3D structures for equality. | |

Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |

GetHashCode | Gets a hash code for this Vector3D structure. (Overrides ValueType.GetHashCode().) | |

GetType | Gets the Type of the current instance. (Inherited from Object.) | |

MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |

Multiply(Double, Vector3D) | Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D. | |

Multiply(Vector3D, Double) | Multiplies the specified Vector3D structure by the specified scalar and returns the result as a Vector3D. | |

Multiply(Vector3D, Matrix3D) | Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure. | |

Negate | Negates a Vector3D structure. | |

Normalize | Normalizes the specified Vector3D structure. | |

Parse | Converts a String representation of a 3-D vector into the equivalent Vector3D structure. | |

Subtract(Vector3D, Point3D) | Subtracts a Point3D structure from a Vector3D structure. | |

Subtract(Vector3D, Vector3D) | Subtracts a Vector3D structure from a Vector3D structure. | |

ToString() | Creates a String representation of this Vector3D structure. (Overrides ValueType.ToString().) | |

ToString(IFormatProvider) | Creates a String representation of this Vector3D structure. |

Name | Description | |
---|---|---|

Addition(Vector3D, Point3D) | Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure. | |

Addition(Vector3D, Vector3D) | Adds two Vector3D structures and returns the result as a Vector3D structure. | |

Division | Divides the specified Vector3D structure by the specified scalar and returns the result as a Vector3D. | |

Equality | Compares two Vector3D structures for equality. | |

Explicit(Vector3D to Size3D) | Converts a Vector3D structure into a Size3D. | |

Explicit(Vector3D to Point3D) | Converts a Vector3D structure into a Point3D structure. | |

Inequality | Compares two Vector3D structures for inequality. | |

Multiply(Double, Vector3D) | Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D. | |

Multiply(Vector3D, Double) | Multiplies the specified Vector3D structure by the specified scalar and returns the result as a Vector3D. | |

Multiply(Vector3D, Matrix3D) | Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure. | |

Subtraction(Vector3D, Point3D) | Subtracts a Point3D structure from a Vector3D structure. | |

Subtraction(Vector3D, Vector3D) | Subtracts a Vector3D structure from a Vector3D structure. | |

UnaryNegation | Negates a Vector3D structure. |

Name | Description | |
---|---|---|

IFormattable.ToString | This member is part of the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly by your code. For a description of this member, see ToString. |

This example shows how to subtract Vector3D structures using the overloaded subtraction (-) operator and the Vector3D static Subtract method.

The following code shows how to use the Vector3D subtraction methods. First, the Vector3D structures are instantiated. The Vector3D structures are subtracted using the overloaded (-) operator, and then they are subtracted using the static Subtract method.

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

## Community Additions

ADD
Show: