Beispiel #1
0
        public static double CaclDisance(Point3D pointOne, Point3D pointTwo)
        {
            double distance = 0;
            distance = Math.Sqrt(Math.Pow(pointOne.x - pointTwo.x, 2)
                + Math.Pow(pointOne.y - pointTwo.y, 2) + Math.Pow(pointOne.z - pointTwo.z, 2));

            return distance;
        }
Beispiel #2
0
        public static Path LoadPath(string fullFileName)
        {
            Path points = new Path();

            using (StreamReader fileReader = new StreamReader(fullFileName))
            {
                string line;
                while ((line = fileReader.ReadLine()) != null)
                {
                    string[] coordinates = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    int x, y, z;

                    x = int.Parse(coordinates[0]);
                    y = int.Parse(coordinates[1]);
                    z = int.Parse(coordinates[2]);

                    Point3D point = new Point3D(x, y, z);
                    points.AddPoint(point);
                }
                return points;
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Point3D point = new Point3D(3,5,2);

            Console.WriteLine(point);
        }