# Point3D 結構

## 定義

``public value class Point3D : IFormattable``
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Point3DConverter))]
[System.Serializable]
public struct Point3D : IFormattable``````
``````type Point3D = struct
interface IFormattable``````
``````Public Structure Point3D
Implements IFormattable``````

Point3D

## 範例

``````// 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 Attribute UsageXAML Attribute Usage

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

xx

yy

zz

## 建構函式

 初始化 Point3D 結構的新執行個體。Initializes a new instance of the Point3D structure.

## 屬性

 取得或設定這個 Point3D 結構的 X 座標。Gets or sets the x-coordinate of this Point3D structure. 取得或設定這個 Point3D 結構的 Y 座標。Gets or sets the y-coordinate of this Point3D structure. 取得或設定這個 Point3D 結構的 Z 座標。Gets or sets the z-coordinate of this Point3D structure.

## 方法

 將 Point3D 結構加入至 Vector3D，並傳回結果做為 Point3D 結構。Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure. 判斷指定的物件是否為 Point3D 結構，如果是則判斷指定之 X 的 Y、Z 和 Object 屬性是否等於這個 X 結構的 Y、Z 和 Point3D 屬性。Determines whether the specified object is a Point3D structure and if so, whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Point3D structure. 比較兩個 Point3D 結構是否相等。Compares two Point3D structures for equality. 比較兩個 Point3D 結構是否相等。Compares two Point3D structures for equality. 傳回這個 Point3D 結構的雜湊程式碼。Returns a hash code for this Point3D structure. 使用指定的 Point3D 結構轉換指定的 Matrix3D 結構。Transforms the specified Point3D structure by the specified Matrix3D structure. 根據指定的數量轉譯 Point3D 結構。Translates the Point3D structure by the specified amounts. 將 3-D 點的 String 表示轉換成對等的 Point3D 結構。Converts a String representation of a 3-D point into the equivalent Point3D structure. 從 Point3D 結構減去 Point3D 結構，並傳回 Vector3D 結構的結果。Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure. 從 Vector3D 結構減去 Point3D 結構，並傳回 Point3D 結構的結果。Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure. 建立這個 String 結構的 Point3D 表示。Creates a String representation of this Point3D structure. 建立這個 String 結構的 Point3D 表示。Creates a String representation of this Point3D structure.

## 運算子

 將 Point3D 結構加入至 Vector3D，並傳回結果做為 Point3D 結構。Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure. 比較兩個 Point3D 結構是否相等。Compares two Point3D structures for equality. 將 Point3D 結構轉換成 Point4D 結構。Converts a Point3D structure into a Point4D structure. 將 Point3D 結構轉換成 Vector3D 結構。Converts a Point3D structure into a Vector3D structure. 比較兩個 Point3D 結構是否相等。Compares two Point3D structures for inequality. 使用指定的 Point3D 結構轉換指定的 Matrix3D 結構。Transforms the specified Point3D structure by the specified Matrix3D structure. 從 Point3D 結構減去 Point3D 結構，並傳回 Vector3D 結構的結果。Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure. 從 Vector3D 結構減去 Point3D 結構，並傳回 Point3D 結構的結果。Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

## 明確介面實作

 這個成員支援 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基礎結構，但是您不可以從程式碼直接使用它。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. 如需這個成員的說明，請參閱 ToString(String, IFormatProvider)。For a description of this member, see ToString(String, IFormatProvider).