/// <summary> /// 坐标变换 /// </summary> /// <param name="p">原坐标</param> /// <returns>新坐标</returns> public _3D_Point Change(_3D_Point p) { _3D_Point dxyz = new _3D_Point(X0, Y0, Z0); Matrix newp = dxyz.ToColumnMatrix() + (1 + M) * GetR() * p.ToColumnMatrix(); return(new _3D_Point(newp[0, 0], newp[1, 0], newp[2, 0])); }
/// <summary> /// 坐标变换 /// </summary> /// <param name="p">原坐标</param> /// <returns>新坐标</returns> public _3D_Point Change(_3D_Point p) { _3D_Point dxyz = new _3D_Point(para.X0, para.Y0, para.Z0); Matrix newp = dxyz.ToColumnMatrix() + para.lambda * GetR() * p.ToColumnMatrix(); return(new _3D_Point(newp[0, 0], newp[1, 0], newp[2, 0])); }
/// <summary> /// 取整,四舍五入 /// </summary> /// <returns></returns> public _3D_Point ChangeToInt() { _3D_Point t = new _3D_Point(); t.X = (int)(X + 0.5); t.Y = (int)(Y + 0.5); t.Z = (int)(Y + 0.5); return(t); }
/// <summary> /// 数乘 /// </summary> /// <param name="p"></param> /// <param name="f"></param> /// <returns></returns> public static _3D_Point operator *(double f, _3D_Point p) { _3D_Point t = new _3D_Point(); t.X = p.X * f; t.Y = p.Y * f; t.Z = p.Z * f; return(t); }
/// <summary> /// 返回绝对值 /// </summary> /// <returns></returns> public _3D_Point Abs() { _3D_Point t = new _3D_Point(); t.X = Math.Abs(X); t.Y = Math.Abs(Y); t.Z = Math.Abs(Z); return(t); }
/// <summary> /// 坐标分量除以同一个数 /// </summary> /// <param name="p"></param> /// <param name="f"></param> /// <returns></returns> public static _3D_Point operator /(_3D_Point p, double f) { _3D_Point t = new _3D_Point(); t.X = p.X / f; t.Y = p.Y / f; t.Z = p.Z / f; return(t); }
/// <summary> /// 对应相减 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static _3D_Point operator -(_3D_Point p1, _3D_Point p2) { _3D_Point t = new _3D_Point(); t.X = p1.X - p2.X; t.Y = p1.Y - p2.Y; t.Z = p1.Z - p2.Z; return(t); }
/// <summary> /// 均取相反数 /// </summary> /// <param name="p"></param> /// <returns></returns> public static _3D_Point operator -(_3D_Point p) { _3D_Point t = new _3D_Point(); t.X = -p.X; t.Y = -p.Y; t.Z = -p.Z; return(t); }
/// <summary> /// 对应相加 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static _3D_Point operator +(_3D_Point p1, _3D_Point p2) { _3D_Point t = new _3D_Point(); t.X = p1.X + p2.X; t.Y = p2.Y + p1.Y; t.Z = p1.Z + p2.Z; return(t); }
/// <summary> /// 取整,四舍五入 /// </summary> /// <returns></returns> public _3D_Point ChangeToInt() { _3D_Point t = new _3D_Point(); t.X = (int)(X + 0.5); t.Y = (int)(Y + 0.5); t.Z = (int)(Y+0.5); return t; }
/// <summary> /// 两点间距离或向量模 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static double Get_Norm(_3D_Point p1, _3D_Point p2) { return(Math.Sqrt((p1 - p2).X * (p1 - p2).X + (p1 - p2).Y * (p1 - p2).Y + (p1 - p2).Z * (p1 - p2).Z)); }
/// <summary> /// 坐标变换 /// </summary> /// <param name="p">原坐标</param> /// <returns>新坐标</returns> public _3D_Point Change(_3D_Point p) { _3D_Point dxyz=new _3D_Point(X0,Y0,Z0); Matrix newp = dxyz.ToColumnMatrix() + (1 + M) * GetR() * p.ToColumnMatrix(); return new _3D_Point(newp[0,0],newp[1,0],newp[2,0]); }
/// <summary> /// 返回绝对值 /// </summary> /// <returns></returns> public _3D_Point Abs() { _3D_Point t = new _3D_Point(); t.X = Math.Abs(X); t.Y = Math.Abs(Y); t.Z = Math.Abs(Z); return t; }
/// <summary> /// 数乘 /// </summary> /// <param name="p"></param> /// <param name="f"></param> /// <returns></returns> public static _3D_Point operator *(double f,_3D_Point p ) { _3D_Point t = new _3D_Point(); t.X = p.X * f; t.Y = p.Y * f; t.Z = p.Z * f; return t; }
/// <summary> /// 两点间距离或向量模 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static double Get_Norm(_3D_Point p1, _3D_Point p2) { return Math.Sqrt((p1 - p2).X * (p1 - p2).X + (p1 - p2).Y * (p1 - p2).Y + (p1 - p2).Z * (p1 - p2).Z); }
/// <summary> /// 坐标分量除以同一个数 /// </summary> /// <param name="p"></param> /// <param name="f"></param> /// <returns></returns> public static _3D_Point operator /(_3D_Point p,double f) { _3D_Point t = new _3D_Point(); t.X = p.X / f; t.Y = p.Y / f; t.Z = p.Z / f; return t; }
/// <summary> /// 均取相反数 /// </summary> /// <param name="p"></param> /// <returns></returns> public static _3D_Point operator -(_3D_Point p) { _3D_Point t = new _3D_Point(); t.X = -p.X; t.Y = -p.Y; t.Z = -p.Z; return t; }
/// <summary> /// 对应相减 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static _3D_Point operator -(_3D_Point p1, _3D_Point p2) { _3D_Point t = new _3D_Point(); t.X = p1.X - p2.X; t.Y = p1.Y - p2.Y; t.Z = p1.Z - p2.Z; return t; }
/// <summary> /// 对应相加 /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static _3D_Point operator +(_3D_Point p1, _3D_Point p2) { _3D_Point t = new _3D_Point(); t.X = p1.X + p2.X; t.Y = p2.Y + p1.Y; t.Z = p1.Z + p2.Z; return t; }