Vector3D.Multiply Method

Definition

Multiplies the specified Vector3D structure by the specified Double or Matrix and returns the result.

Overloads

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.

Multiply(Double, Vector3D)

Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.

C#
public static System.Windows.Media.Media3D.Vector3D Multiply(double scalar, System.Windows.Media.Media3D.Vector3D vector);

Parameters

scalar
Double

The scalar to multiply.

vector
Vector3D

The Vector3D structure to multiply.

Returns

The result of multiplying scalar and vector.

Examples

The following example shows how to multiply a scalar by a Vector3D structure.

C#
// Multiplies a Vector3D by a Scalar using the static Multiply method.  
// Returns a Vector3D.

Vector3D vector1 = new Vector3D(20, 30, 40);
Double scalar1 = 75;
Vector3D vectorResult = new Vector3D();

vectorResult = Vector3D.Multiply(vector1, scalar1);
// vectorResult is equal to (1500, 2250, 3000)

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Multiply(Vector3D, Double)

Multiplies the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.

C#
public static System.Windows.Media.Media3D.Vector3D Multiply(System.Windows.Media.Media3D.Vector3D vector, double scalar);

Parameters

vector
Vector3D

The Vector3D structure to multiply.

scalar
Double

The scalar to multiply.

Returns

The result of multiplying vector and scalar.

Examples

The following example shows how to multiply a Vector3D structure by a scalar.

C#
// Multiplies a Vector3D by a Scalar using the static Multiply method.  
// Returns a Vector3D.

Vector3D vector1 = new Vector3D(20, 30, 40);
Double scalar1 = 75;
Vector3D vectorResult = new Vector3D();

vectorResult = Vector3D.Multiply(vector1, scalar1);
// vectorResult is equal to (1500, 2250, 3000)

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Multiply(Vector3D, Matrix3D)

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

C#
public static System.Windows.Media.Media3D.Vector3D Multiply(System.Windows.Media.Media3D.Vector3D vector, System.Windows.Media.Media3D.Matrix3D matrix);

Parameters

vector
Vector3D

The Vector3D structure to transform.

matrix
Matrix3D

The transformation to apply to the Vector3D structure.

Returns

Returns the result of transforming vector by matrix3D.

Examples

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

C#
// 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)

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10