Vector.Divide(Vector, Double) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的向量除以指定的純量,並傳回結果做為 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
除以 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;
}