Point3D 構造体

定義

3-D 空間の x 座標、y 座標、z 座標点を表します。

public value class Point3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Point3DConverter))]
[System.Serializable]
public struct Point3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Point3DConverter))]
public struct Point3D : IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Point3DConverter))>]
[<System.Serializable>]
type Point3D = struct
    interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Point3DConverter))>]
type Point3D = struct
    interface IFormattable
Public Structure Point3D
Implements IFormattable
継承
Point3D
属性
実装

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

次のコードは、 Point3D 減算メソッドの使用方法を示しています。 まず、 Point3D 構造体と Vector3D 構造体がインスタンス化されます。 Point3D構造体は、オーバーロードされた減算 (-) 演算子を使用して減算され、静的Subtractメソッドを使用して減算されます。 次に、静的Vector3Dメソッドを使用して、Point3D構造体を最初のSubtract構造体から減算し、最後に、オーバーロードされた減算 (Point3D) 演算子を使用してVector3Dから-構造体を減算します。

// instantiate variables
Point3D point1 = new Point3D();
Point3D point2 = new Point3D(15, 40, 60);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult1 = new Point3D();
Point3D pointResult2 = new Point3D();
Vector3D vectorResult1 = new Vector3D();
Vector3D vectorResult2 = new Vector3D();

// defining x,y,z of point1
point1.X = 10;
point1.Y = 5;
point1.Z = 1;

vectorResult1 = Point3D.Subtract(point1, point2);
// vectorResult1 is equal to (-5, -35, -59)

vectorResult2 = point2 - point1;
// vectorResult2 is equal to (5, 35, 59)

pointResult1 = Point3D.Subtract(point1, vector1);
//  pointResult1 is equal to (-10, -25, -39)

pointResult2 = vector1 - point1;
//  pointResult2 is equal to (10, 25, 39)

注釈

XAML では、 Point3D の値間の区切り記号にはコンマまたはスペースを指定できます。

カルチャによっては、ピリオド文字の代わりにコンマ文字を 10 進区切り記号として使用する場合があります。 インバリアント カルチャの XAML 処理は、ほとんどの XAML プロセッサ実装で既定で en-US され、ピリオドは 10 進区切り記号であると想定されます。 XAML で Point3D を指定する場合は、コンマ文字を 10 進区切り記号として使用しないでください。これは、 Point3D 属性値のコンポーネントへの文字列型変換と競合するためです。

XAML 属性の使用法

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

XAML 値

x この Point3Dの x 座標。

y この Point3Dの y 座標。

z この Point3Dの z 座標。

コンストラクター

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

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

プロパティ

名前 説明
X

この Point3D 構造体の x 座標を取得または設定します。

Y

この Point3D 構造体の y 座標を取得または設定します。

Z

この Point3D 構造体の z 座標を取得または設定します。

メソッド

名前 説明
Add(Point3D, Vector3D)

Point3D構造体をVector3Dに追加し、結果をPoint3D構造体として返します。

Equals(Object)

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

Equals(Point3D, Point3D)

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

Equals(Point3D)

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

GetHashCode()

この Point3D 構造体のハッシュ コードを返します。

Multiply(Point3D, Matrix3D)

指定したPoint3D構造体によって、指定したMatrix3D構造体を変換します。

Offset(Double, Double, Double)

指定した量で Point3D 構造を変換します。

Parse(String)

3-D ポイントの String 表現を等価の Point3D 構造体に変換します。

Subtract(Point3D, Point3D)

Point3D構造体からPoint3D構造体を減算し、結果をVector3D構造体として返します。

Subtract(Point3D, Vector3D)

Vector3D構造体からPoint3D構造体を減算し、結果をPoint3D構造体として返します。

ToString()

このString構造体のPoint3D表現を作成します。

ToString(IFormatProvider)

このString構造体のPoint3D表現を作成します。

演算子

名前 説明
Addition(Point3D, Vector3D)

Point3D構造体をVector3Dに追加し、結果をPoint3D構造体として返します。

Equality(Point3D, Point3D)

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

Explicit(Point3D to Point4D)

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

Explicit(Point3D to Vector3D)

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

Inequality(Point3D, Point3D)

2 つの Point3D 構造体の不等値を比較します。

Multiply(Point3D, Matrix3D)

指定したPoint3D構造体によって、指定したMatrix3D構造体を変換します。

Subtraction(Point3D, Point3D)

Point3D構造体からPoint3D構造体を減算し、結果をVector3D構造体として返します。

Subtraction(Point3D, Vector3D)

Vector3D構造体からPoint3D構造体を減算し、結果をPoint3D構造体として返します。

明示的なインターフェイスの実装

名前 説明
IFormattable.ToString(String, IFormatProvider)

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

適用対象