Vector.Divide(Vector, Double) 方法

定义

将指定向量除以指定标量,并将结果以 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
Public Shared Function Divide (vector As Vector, scalar As Double) As Vector

参数

vector
Vector

作为除数的向量结构。

scalar
Double

vector 的被除量。

返回

Vector

vector 除以 scalar 的结果。

示例

以下示例演示如何使用此方法除 Vector 以标量。

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;
}

适用于

另请参阅