Exemple #1
0
        static void Main()
        {
            Point3D first3DPoint = new Point3D(1.3919023f, 6.12837912f, 10.391283f);
            Point3D second3DPoint = new Point3D(48.3818f, 38.38182f, 318.381823f);

            Console.WriteLine(first3DPoint.ToString());
            Console.WriteLine(second3DPoint.ToString());

            DistanceCalculator.DistanceCalculation(first3DPoint, second3DPoint);

        }
Exemple #2
0
        public static float DistanceCalculation(Point3D first3dPoint, Point3D second3dPoint)
        {
            float deltaX = second3dPoint.X - first3dPoint.X;
            float deltaY = second3dPoint.Y - second3dPoint.Y;
            float deltaZ = second3dPoint.Z - second3dPoint.Z;

            float distance = (float) Math.Sqrt(deltaX*deltaX + deltaY*deltaY + deltaZ*deltaZ);

            Console.WriteLine("Distance between first point and second point is: " + distance);
            return distance;
        }