共用方式為


Vector.Division(Vector, Double) 運算子

定義

將指定的向量除以指定的純量,並傳回產生的向量。

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

參數

vector
Vector

要被除的向量。

scalar
Double

vector 要除以的純量。

傳回

vector 除以 scalar 的結果。

範例

下列範例示範如何使用這個運算子 (/) ,將結構除 Vector 以純量。

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

適用於

另請參閱