Vector.Divide(Vector, Double) 方法

定义

将指定向量除以指定标量,并将结果以 Vector 形式返回。Divides the specified vector by the specified scalar and returns the result as a Vector.

public:
 static System::Windows::Vector Divide(System::Windows::Vector vector, double scalar);
public static System.Windows.Vector Divide (System.Windows.Vector vector, double scalar);
static member Divide : System.Windows.Vector * double -> System.Windows.Vector

参数

vector
Vector

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

scalar
Double

vector 的被除量。The amount by which vector is divided.

返回

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

示例

下面的示例演示如何使用此方法除以Vector标量。The following example shows how to use this method to divide a Vector by a scalar.

private Vector divideExample()
{
    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 = Vector.Divide(vector1, scalar1);

    return vectorResult;

}

适用于

另请参阅