다음을 통해 공유


Point3D.Subtraction 연산자

정의

Point3D 구조체에서 Vector3D 구조체 또는 Point3D 구조체를 뺍니다.

오버로드

Subtraction(Point3D, Point3D)

Point3D 구조체에서 Point3D 구조체를 빼고 그 결과를 Vector3D 구조체로 반환합니다.

Subtraction(Point3D, Vector3D)

Vector3D 구조체에서 Point3D 구조체를 빼고 그 결과를 Point3D 구조체로 반환합니다.

Subtraction(Point3D, Point3D)

Point3D 구조체에서 Point3D 구조체를 빼고 그 결과를 Vector3D 구조체로 반환합니다.

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
Point3D

뺄셈을 수행할 Point3D 구조체입니다.

point2
Point3D

point1에서 뺄 Point3D 구조체입니다.

반환

Vector3D

point1point2 간의 차를 나타내는 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)

Vector3D 구조체에서 Point3D 구조체를 빼고 그 결과를 Point3D 구조체로 반환합니다.

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

매개 변수

point
Point3D

벡터를 뺄 Point3D 구조체입니다.

vector
Vector3D

점에서 뺄 Vector3D 구조체입니다.

반환

Point3D

vector에서 point를 뺀 결과인 변경된 Point3D 구조체입니다.

예제

다음 예제에서는 오버로드된 빼기 연산자를 사용하여 구조체에서 Point3D 구조를 빼는 Vector3D 방법을 보여줍니다.

// 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)

추가 정보

적용 대상