Vector3D 構造体

定義

3-D 空間での変位を表します。

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
属性
実装

この例では、オーバーロードされた減算 (Vector3D) 演算子と-静的Vector3D メソッドを使用して、Subtract構造体を減算する方法を示します。

次のコードは、 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 このX構造体のVector3Dコンポーネント。

y このY構造体のVector3Dコンポーネント。

z このZ構造体のVector3Dコンポーネント。

コンストラクター

名前 説明
Vector3D(Double, Double, Double)

Vector3D構造体の新しいインスタンスを初期化します。

プロパティ

名前 説明
Length

この Vector3D 構造体の長さを取得します。

LengthSquared

この Vector3D 構造体の長さの 2 乗を取得します。

X

このX構造体のVector3D コンポーネントを取得または設定します。

Y

このY構造体のVector3D コンポーネントを取得または設定します。

Z

このZ構造体のVector3D コンポーネントを取得または設定します。

メソッド

名前 説明
Add(Vector3D, Point3D)

指定した Point3D 構造体を指定した Vector3D 構造体によって変換し、結果を Point3D 構造体として返します。

Add(Vector3D, Vector3D)

2 つの Vector3D 構造体を追加し、結果を Vector3D 構造体として返します。

AngleBetween(Vector3D, Vector3D)

最初に指定した Vector3D 構造体を、指定した 2 番目の Vector3D 構造体に回転するために必要な角度を取得します。

CrossProduct(Vector3D, Vector3D)

2 つの Vector3D 構造体のクロス積を計算します。

Divide(Vector3D, Double)

指定した Vector3D 構造体を指定したスカラーで除算し、結果を Vector3Dとして返します。

DotProduct(Vector3D, Vector3D)

2 つの Vector3D 構造体のドット積を計算します。

Equals(Object)

指定したオブジェクトがVector3D構造体であるかどうかを判断し、指定したXYZ、およびObjectプロパティがこのX構造体のYZ、およびVector3Dプロパティと等しいかどうかを判断します。

Equals(Vector3D, Vector3D)

2 つの Vector3D 構造体の等価性を比較します。

Equals(Vector3D)

2 つの Vector3D 構造体の等価性を比較します。

GetHashCode()

この Vector3D 構造体のハッシュ コードを取得します。

Multiply(Double, Vector3D)

指定したスカラーに指定した Vector3D 構造体を乗算し、結果を Vector3Dとして返します。

Multiply(Vector3D, Double)

指定した Vector3D 構造体に指定したスカラーを乗算し、結果を Vector3Dとして返します。

Multiply(Vector3D, Matrix3D)

指定したVector3D構造体を使用して、指定したMatrix3D構造体の座標空間を変換します。

Negate()

Vector3D構造体を否定します。

Normalize()

指定した Vector3D 構造体を正規化します。

Parse(String)

3-D ベクトルの String 表現を等価の 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)

2 つの Vector3D 構造体を追加し、結果を Vector3D 構造体として返します。

Division(Vector3D, Double)

指定した Vector3D 構造体を指定したスカラーで除算し、結果を Vector3Dとして返します。

Equality(Vector3D, Vector3D)

2 つの Vector3D 構造体の等価性を比較します。

Explicit(Vector3D to Point3D)

Vector3D構造体をPoint3D構造体に変換します。

Explicit(Vector3D to Size3D)

Vector3D構造体をSize3Dに変換します。

Inequality(Vector3D, Vector3D)

2 つの 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)

このメンバーは、Windows Presentation Foundation (WPF) インフラストラクチャの一部であり、コードによって直接使用されるものではありません。 このメンバーの説明については、 ToString(String, IFormatProvider)を参照してください。

適用対象