首先我们定义Point3D类,包含xyz字段,属性,各构造函数。定义Color3D类,包含xyz字段,属性,各构造函数。
Point3D类的属性和构造函数:
double _x;
double _y;
double _z;
public double X {
get => _x; set => _x = value; }
public double Y {
get => _y; set => _y = value; }
public double Z {
get => _z; set => _z = value; }
public Point3D()
{
_x = 0;
_y = 0;
_z = 0;
}
public Point3D(double x, double y, double z)
{
_x = x;
_y = y;
_z = z;
}
Color3D类的属性和构造函数:
double _r;
double _g;
double _b;
public double R {
get => _r; set => _r = value; }
public double G {
get => _g