Vector3D.Multiply Method (Vector3D, Matrix3D)


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 Multiply(
	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

Returns the result of transforming vector by matrix3D.

The following example shows how to use the Multiply method to transform a Vector3D structure by a Matrix3D structure.

// Multiplies a Vector3D by a Matrix3D using the static Multiply method.  
// 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 = Vector3D.Multiply(vector1,matrix1);
// vector Result is equal to (2000, 2000, 2000)

.NET Framework
Available since 3.0
Return to top