Point3D.Subtraction Operator
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
Subtraction(Point3D, Point3D) | |
Subtraction(Point3D, Vector3D) |
Subtraction(Point3D, Point3D)
public:
static System::Windows::Media::Media3D::Vector3D operator -(System::Windows::Media::Media3D::Point3D point1, System::Windows::Media::Media3D::Point3D point2);
public static System.Windows.Media.Media3D.Vector3D operator - (System.Windows.Media.Media3D.Point3D point1, System.Windows.Media.Media3D.Point3D point2);
static member ( - ) : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Point3D -> System.Windows.Media.Media3D.Vector3D
Public Shared Operator - (point1 As Point3D, point2 As Point3D) As Vector3D
パラメーター
戻り値
point1
および point2
の差を表す Vector3D 構造体。
例
次の例は、オーバーロードされた減算演算子を使用して構造体から構造体を減算する Point3D 方法を Point3D 示しています。
// Subtracts a Point3D from a Point3D using the overloaded - operator.
// Returns a Vector3D.
Point3D point1 = new Point3D(10, 5, 1);
Point3D point2 = new Point3D(15, 40, 60);
Vector3D vectorResult = new Vector3D();
vectorResult = point1 - point2;
// vectorResult is equal to (-5, -35, -59)
// Displaying Results
syntaxString = " vectorResult = point1 - point2;";
resultType = "Vector3D";
operationString = "Subtracting a Point3D from a Point3D";
ShowResults(vectorResult.ToString(), syntaxString, resultType, operationString);
' Subtracts a Point3D from a Point3D using the overloaded - operator.
' Returns a Vector3D.
Dim point1 As New Point3D(10, 5, 1)
Dim point2 As New Point3D(15, 40, 60)
Dim vectorResult As New Vector3D()
vectorResult = point1 - point2
' vectorResult is equal to (-5, -35, -59)
' Displaying Results
syntaxString = " vectorResult = point1 - point2"
resultType = "Vector3D"
operationString = "Subtracting a Point3D from a Point3D"
ShowResults(vectorResult.ToString(), syntaxString, resultType, operationString)
こちらもご覧ください
適用対象
Subtraction(Point3D, Vector3D)
public:
static System::Windows::Media::Media3D::Point3D operator -(System::Windows::Media::Media3D::Point3D point, System::Windows::Media::Media3D::Vector3D vector);
public static System.Windows.Media.Media3D.Point3D operator - (System.Windows.Media.Media3D.Point3D point, System.Windows.Media.Media3D.Vector3D vector);
static member ( - ) : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Vector3D -> System.Windows.Media.Media3D.Point3D
Public Shared Operator - (point As Point3D, vector As Vector3D) As Point3D
パラメーター
戻り値
vector
から point
を減算した結果の、変更された Point3D 構造体。
例
次の例は、オーバーロードされた減算演算子を使用して構造体から構造体を減算する Vector3D 方法を Point3D 示しています。
// Subtracts a Vector3D from a Point3D using the overloaded - operator.
// Returns a Point3D.
Point3D point1 = new Point3D(10, 5, 1);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult = new Point3D();
pointResult = point1 - vector1;
// pointResult is equal to (-10, -25, -39)
// Displaying Results
syntaxString = "pointResult = point1 - vector1;";
resultType = "Point3D";
operationString = "Subtracting a Vector3D from a Point3D";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
' Subtracts a Vector3D from a Point3D using the overloaded - operator.
' Returns a Point3D.
Dim point1 As New Point3D(10, 5, 1)
Dim vector1 As New Vector3D(20, 30, 40)
Dim pointResult As New Point3D()
pointResult = point1 - vector1
' pointResult is equal to (-10, -25, -39)
' Displaying Results
syntaxString = "pointResult = point1 - vector1"
resultType = "Point3D"
operationString = "Subtracting a Vector3D from a Point3D"
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString)
こちらもご覧ください
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET