Redigeeri

Jagamisviis:


Vector.Division(Vector, Double) Operator

Definition

Divides the specified vector by the specified scalar and returns the resulting vector.

public:
 static System::Windows::Vector operator /(System::Windows::Vector vector, double scalar);
public static System.Windows.Vector operator / (System.Windows.Vector vector, double scalar);
static member ( / ) : System.Windows.Vector * double -> System.Windows.Vector
Public Shared Operator / (vector As Vector, scalar As Double) As Vector

Parameters

vector
Vector

The vector to divide.

scalar
Double

The scalar by which vector will be divided.

Returns

The result of dividing vector by scalar.

Examples

The following example shows how to use this operator (/) to divide a Vector structure by a scalar.

private Vector overloadedDivisionOperatorExample()
{
    Vector vector1 = new Vector(20, 30);
    Vector vectorResult = new Vector();
    Double scalar1 = 75;

    // Divide vector by scalar.
    // vectorResult is approximately equal to (0.26667,0.4)
    vectorResult = vector1 / scalar1;

    return vectorResult;
}
Private Function overloadedDivisionOperatorExample() As Vector
    Dim vector1 As New Vector(20, 30)
    Dim vectorResult As New Vector()
    Dim scalar1 As Double = 75

    ' Divide vector by scalar.
    ' vectorResult is approximately equal to (0.26667,0.4)
    vectorResult = vector1 / scalar1

    Return vectorResult

End Function

Applies to

See also