Is there Point3D?

本文关键字:Point3D there Is | 更新日期: 2023-09-27 18:07:46

在。net中是否有内置的类型Point3 ?这样的

public class Point3D
{
    public double X { get; set; }
    public double Y { get; set; }
    public double Z { get; set; }
}

,但内置。我自己实现它并不难,但是……

Is there Point3D?

System.Windows.Forms.DataVisualization.Charting有一个class Point3D

  • float X, Y, Z
  • System.Windows.Forms.DataVisualization.dll (WinForms)
  • 。. NET Framework>= 4.0

System.Windows.Media.Media3D有一个struct Point3D

  • double X, Y, Z
  • PresentationCore.dll (WPF)
  • 。. NET Framework>= 3.0
  • 。. NET Core>= 3.0

我知道Vector3D不是Point3D,但如果你只是想要一个struct与X, Y, Z:

System.Windows.Media.Media3D有一个struct Vector3D

  • double X, Y, Z
  • PresentationCore.dll (WPF)
  • 。. NET Framework>= 3.0
  • 。. NET Core>= 3.0

System.Numerics有一个struct Vector3

  • float X, Y, Z
  • System.Numerics.dll
  • 。. NET Framework>= 4.6
  • 。. NET Core>= 1.0

只有System.Numerics.Vector3 不依赖于在WinForms或WPF!

System.Windows.Forms.DataVisualization.ChartingPoint3D class

表示三维(3D)数据点的坐标。此类用于使用3D图表执行自定义绘图。

  • X获取或设置3D点的X坐标。
  • Y获取或设置3D点的Y坐标。
  • Z获取或设置3D点的Z坐标。

也有Point3D结构。

表示三维空间中的x、y、z坐标点。

  • DirectX有一个Microsoft.DirectX。Vector3结构,但是对于您的应用程序来说,它会不会过于繁琐?
  • XNA有类Microsoft.XNA.Framework.Vector3
  • Unity3D有一个Vector3类来表示3DOpenTK还使用三个单精度浮点数表示3D矢量。