Vector3D(Double, Double, Double) 建構函式

定義

初始化 Vector3D 結構的新執行個體。

C#
public Vector3D (double x, double y, double z);

參數

x
Double

Vector3D 結構的 X 值。

y
Double

Vector3D 結構的 Y 值。

z
Double

Vector3D 結構的 Z 值。

範例

C#
// Translates a Point3D by a Vector3D using the overloaded + operator.  
// Returns a Point3D.

Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D point1 = new Point3D(10, 5, 1);
Point3D pointResult = new Point3D();

pointResult = point1 + vector1;
// vectorResult is equal to (30, 35, 41)

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7