Vector3D 구조체

정의

3차원 공간의 변위를 나타냅니다.

public value class Vector3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Vector3DConverter))]
[System.Serializable]
public struct Vector3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Vector3DConverter))]
public struct Vector3D : IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Vector3DConverter))>]
[<System.Serializable>]
type Vector3D = struct
    interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Vector3DConverter))>]
type Vector3D = struct
    interface IFormattable
Public Structure Vector3D
Implements IFormattable
상속
Vector3D
특성
구현

예제

이 예제에서는 오버로드된 빼기(-) 연산자와 정적 Subtract 메서드를 사용하여 구조를 빼 Vector3DVector3D 방법을 보여 줍니다.

다음 코드에서는 빼기 메서드를 Vector3D 사용하는 방법을 보여 줍니다. 먼저 구조체가 Vector3D 인스턴스화됩니다. 구조체는 Vector3D 오버로드된(-) 연산자를 사용하여 빼고 정적 Subtract 메서드를 사용하여 뺍니다.

// Subtracts two 3-D Vectors using the Subtract method and -

// Declaring vector1 and initializing x,y,z values
Vector3D vector1 = new Vector3D(20, 30, 40);

// Declaring vector2 without initializing x,y,z values
Vector3D vector2 = new Vector3D();

// Assigning values to vector2
vector2.X = 45;
vector2.Y = 70;
vector2.Z = 80;

// Subtracting vectors using overload - operator
Vector3D vectorResult1 = new Vector3D();
vectorResult1 = vector1 - vector2;
// vectorResult1 is equal to (-25, -40, -40)

// Subtracting vectors using static Subtract method
Vector3D vectorResult2 = new Vector3D();
vectorResult2 = Vector3D.Subtract(vector1, vector2);
// vector2 is equal to (-25, -40, -40)

설명

XAML 특성 사용

<object property="x,y,z"/>  
-or  
<object property="x y z"/>  

XAML 값

x
Vector3D 구조체의 X 구성 요소입니다.

y
Vector3D 구조체의 Y 구성 요소입니다.

z
Vector3D 구조체의 Z 구성 요소입니다.

생성자

Vector3D(Double, Double, Double)

Vector3D 구조체의 새 인스턴스를 초기화합니다.

속성

Length

Vector3D 구조체의 길이를 가져옵니다.

LengthSquared

Vector3D 구조체 길이의 제곱을 가져옵니다.

X

X 구조체의 Vector3D 구성 요소를 가져오거나 설정합니다.

Y

Y 구조체의 Vector3D 구성 요소를 가져오거나 설정합니다.

Z

Z 구조체의 Vector3D 구성 요소를 가져오거나 설정합니다.

메서드

Add(Vector3D, Point3D)

지정된 Point3D 구조체로 지정된 Vector3D 구조체를 변환하고 그 결과를 Point3D 구조체로 반환합니다.

Add(Vector3D, Vector3D)

Vector3D 구조체를 추가하고 그 결과를 Vector3D 구조체로 반환합니다.

AngleBetween(Vector3D, Vector3D)

첫 번째 지정된 Vector3D 구조체를 두 번째 지정된 Vector3D 구조체에 대해 회전하는 데 필요한 각도를 검색합니다.

CrossProduct(Vector3D, Vector3D)

Vector3D 구조체의 외적을 계산합니다.

Divide(Vector3D, Double)

지정된 Vector3D 구조체를 지정된 스칼라로 나누고 그 결과를 Vector3D로 반환합니다.

DotProduct(Vector3D, Vector3D)

Vector3D 구조체의 내적을 계산합니다.

Equals(Object)

지정된 개체가 Vector3D 구조체인지 확인하고, 지정된 XY, ZObject 속성이 이 X 구조체의 Y, ZVector3D 속성과 같은지 확인합니다.

Equals(Vector3D)

Vector3D 구조체가 같은지 여부를 비교합니다.

Equals(Vector3D, Vector3D)

Vector3D 구조체가 같은지 여부를 비교합니다.

GetHashCode()

Vector3D 구조체의 해시 코드를 가져옵니다.

Multiply(Double, Vector3D)

지정된 스칼라와 지정된 Vector3D 구조체를 곱하고 그 결과를 Vector3D로 반환합니다.

Multiply(Vector3D, Double)

지정된 Vector3D 구조체와 지정된 스칼라를 곱하고 그 결과를 Vector3D로 반환합니다.

Multiply(Vector3D, Matrix3D)

지정된 Vector3D 구조체를 사용하여 지정된 Matrix3D 구조체의 좌표 공간을 변환합니다.

Negate()

Vector3D 구조체를 부정합니다.

Normalize()

지정된 Vector3D 구조체를 정규화합니다.

Parse(String)

String 3차원 벡터의 표현을 해당 Vector3D 구조체로 변환합니다.

Subtract(Vector3D, Point3D)

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

Subtract(Vector3D, Vector3D)

Vector3D 구조체에서 Vector3D 구조체를 뺍니다.

ToString()

String 구조체의 Vector3D 표현을 만듭니다.

ToString(IFormatProvider)

String 구조체의 Vector3D 표현을 만듭니다.

연산자

Addition(Vector3D, Point3D)

지정된 Point3D 구조체로 지정된 Vector3D 구조체를 변환하고 그 결과를 Point3D 구조체로 반환합니다.

Addition(Vector3D, Vector3D)

Vector3D 구조체를 추가하고 그 결과를 Vector3D 구조체로 반환합니다.

Division(Vector3D, Double)

지정된 Vector3D 구조체를 지정된 스칼라로 나누고 그 결과를 Vector3D로 반환합니다.

Equality(Vector3D, Vector3D)

Vector3D 구조체가 같은지 여부를 비교합니다.

Explicit(Vector3D to Point3D)

Vector3D 구조체를 Point3D 구조체로 변환합니다.

Explicit(Vector3D to Size3D)

Vector3D 구조체를 Size3D 구조체로 변환합니다.

Inequality(Vector3D, Vector3D)

Vector3D 구조체가 다른지 여부를 비교합니다.

Multiply(Double, Vector3D)

지정된 스칼라와 지정된 Vector3D 구조체를 곱하고 그 결과를 Vector3D로 반환합니다.

Multiply(Vector3D, Double)

지정된 Vector3D 구조체와 지정된 스칼라를 곱하고 그 결과를 Vector3D로 반환합니다.

Multiply(Vector3D, Matrix3D)

지정된 Vector3D 구조체를 사용하여 지정된 Matrix3D 구조체의 좌표 공간을 변환합니다.

Subtraction(Vector3D, Point3D)

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

Subtraction(Vector3D, Vector3D)

Vector3D 구조체에서 Vector3D 구조체를 뺍니다.

UnaryNegation(Vector3D)

Vector3D 구조체를 부정합니다.

명시적 인터페이스 구현

IFormattable.ToString(String, IFormatProvider)

이 멤버는 WPF(Windows Presentation Foundation) 인프라의 일부이며 코드에서 직접 사용할 수 없습니다. 이 멤버에 대한 설명은 ToString(String, IFormatProvider)를 참조하세요.

적용 대상