Esempio n. 1
0
        static void Main(string[] args)
        {
            Point3D point1 = new Point3D(2, 3, 2);
            Point3D point2 = Point3D.PrintStartingPoint();

            double distance = DistanceCalculator.CalculateDistance3DPoint(point1, point2);
            Console.WriteLine(distance);
        }
        public static double CalculateDistance3DPoint(Point3D firstPoint, Point3D secondPoint) 
        {
            float x = firstPoint.X - secondPoint.X;
            float y = firstPoint.Y - secondPoint.Y;
            float z = firstPoint.Z - secondPoint.Z;

            double calcDis = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2) + Math.Pow(z, 2));

            return calcDis;
        }