Vector.Division(Vector, Double) 操作员

定义

将指定向量除以指定标量,并返回结果向量。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

参数

vector
Vector

作为除数的向量。The vector to divide.

scalar
Double

vector 将除以的标量。The scalar by which vector will be divided.

返回

vector 除以 scalar 的结果。The result of dividing vector by scalar.

示例

下面的示例演示如何使用此运算符 (/) 将Vector结构除以标量。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

适用于

另请参阅