Vector3D.Division(Vector3D, Double) 运算符

定义

将指定的 Vector3D 结构除以指定的标量,并以 Vector3D 的形式返回结果。

public:
 static System::Windows::Media::Media3D::Vector3D operator /(System::Windows::Media::Media3D::Vector3D vector, double scalar);
public static System.Windows.Media.Media3D.Vector3D operator / (System.Windows.Media.Media3D.Vector3D vector, double scalar);
static member ( / ) : System.Windows.Media.Media3D.Vector3D * double -> System.Windows.Media.Media3D.Vector3D
Public Shared Operator / (vector As Vector3D, scalar As Double) As Vector3D

参数

vector
Vector3D

要被除的 Vector3D 结构。

scalar
Double

vector 要除以的标量。

返回

Vector3D

vector 除以 scalar 的结果。

示例

以下示例演示如何使用重载加法运算符将结构除 Vector3D 以标量。

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

适用于

另请参阅