Vector3D.Multiply Operator (Vector3D, Matrix3D)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public static Vector3D operator *(
	Vector3D vector,
	Matrix3D matrix


Type: System.Windows.Media.Media3D.Vector3D

The Vector3D structure to transform.

Type: System.Windows.Media.Media3D.Matrix3D

The transformation to apply to the Vector3D structure.

Return Value

Type: System.Windows.Media.Media3D.Vector3D

The result of transforming vector by matrix.

The following example shows how to use the overloaded multiplication operator to transform a Vector3D structure by a Matrix3D structure.

// Multiplies a Vector3D by a Matrix3D using the overloaded * operator.  
// Returns a Vector3D.

Vector3D vector1 = new Vector3D(20, 30, 40);
Matrix3D matrix1 = new Matrix3D(10, 10, 10, 0, 20, 20, 20, 0, 30, 30, 30, 0, 5, 10, 15, 1);
Vector3D vectorResult = new Vector3D();

vectorResult = vector1 * matrix1;
// vector Result is equal to (2000, 2000, 2000)

.NET Framework
Available since 3.0
Return to top