using System; namespace Science.Mathematics.VectorCalculus { public class Distance { public double FromPointToPoint(Point from, Point to) { Vector v = new Vector(from, to); return v.Norm; } public double FromPointToPlane(Point from, Plane to) { double A = to.Normal[0]; double B = to.Normal[1]; double C = to.Normal[2]; double D = -(to.ThroughTip * to.Normal); double res = Math.Abs(A*from[0]+B*from[1]+C*from[2]+D) / Math.Sqrt(A*A+B*B+C*C); return res; } } }