static void Main()
        {
            Point3D point = new Point3D(1, 12, 5.55);

            Console.WriteLine(point);
            Console.WriteLine(Point3D.StartingPoint);
        }
Esempio n. 2
0
 public static void AddPoints(Point3D[] points)
 {
     foreach (var item in points)
     {
         Path.points.Add(item);
     }
 }
        public static void Main(string[] args)
        {
            var point = new Point3D(15.6, 18.2, 3);
            Console.WriteLine(point);

            Console.WriteLine(Point3D.StartingPoint);
        }
        public static double Calculate3DPointDistance(Point3D point1, Point3D point2)
        {
            double xd = point2.X - point1.X;
            double yd = point2.Y - point1.Y;
            double zd = point2.Z - point1.Z;

            double distance = Math.Sqrt(Math.Pow(xd, 2) + Math.Pow(yd, 2) + Math.Pow(zd, 2));

            return double.Parse(String.Format("{0:F4}", distance));
        }
Esempio n. 5
0
        private static void Main()
        {
            Point3D pointA = new Point3D(5, 3, 3.4);
            Point3D pointB = new Point3D(1, 2.4, 4.4);

            Console.WriteLine(pointA.ToString());
            Console.WriteLine(pointB.ToString());

            Console.WriteLine("Starting point:" + Point3D.StartingPoint.ToString());
        }
Esempio n. 6
0
        public static void Main()
        {
            Point3D point1 = new Point3D(1.5, 2, 4);
            Console.WriteLine(point1);

            Point3D point2 = new Point3D(3, 2);
            Console.WriteLine(point2);

            Console.WriteLine("Starting point is: " + Point3D.StartingPoint);

            //Point3D invalidPoint = new Point3D(-1.5, 0, 2);
        }
        public static void Main()
        {
            Console.Title = "Problem 1.	Point3D";

            Console.WriteLine("Starting point -> {0}", Point3D.StartingPoint);

            Point3D firstPoint = new Point3D(5, 10, 2.5);
            Console.WriteLine("First 3D point -> " + firstPoint.ToString());

            Point3D secondPoint = new Point3D(-2, -3, -10);
            Console.WriteLine("Second 3D point -> " + secondPoint.ToString());
        }
        static void Main()
        {
            // creating two points
            var point1 = new Point3D(1, 1, 1);
            var point2 = new Point3D(2.4, 2.4, 2.4);
            Console.WriteLine(point1);
            Console.WriteLine(point2);

            // setting the third point to be equal to the starting point constant
            var x = Point3D.StartingPoint;
            Console.WriteLine(x);
        }
        static void Main(string[] args)
        {

            Console.WriteLine("Enter the cordinates of your fist point separated by a space: ");
            int[] pointA =
                Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).
                    Select(int.Parse).ToArray();

            Console.WriteLine("Enter the cordinates of your second point separated by a space: ");
            int[] pointB =
                Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).
                    Select(int.Parse).ToArray();

            Point3D point1 = new Point3D(pointA[0], pointA[1], pointA[2]);
            Point3D point2 = new Point3D(pointB[0], pointB[1], pointB[2]);

            Console.WriteLine("The distance between your points is {0}", DistanceCalculator.Calculate3DPointDistance
                (point1, point2));

            
        }
Esempio n. 10
0
 static Point3D()
 {
     StartingPointCoordinates = new Point3D(0, 0, 0);
 }
Esempio n. 11
0
 public void AddPointToPath(Point3D point)
 {
     var currentPath = path;
     currentPath.Add(point);
     this.path = currentPath;
 }
Esempio n. 12
0
 static Point3D()
 {
     start = new Point3D(0, 0, 0);
 }
Esempio n. 13
0
        static void Main(string[] args)
        {
            Point3D[] pointsToAdd = new Point3D[5];
            Random rng = new Random();

            for (int i = 0; i < pointsToAdd.Length; i++)
            {
                pointsToAdd[i] = new Point3D(rng.Next(1, 200), rng.Next(1, 200), rng.Next(1, 200));
            }

            Path.AddPoints(pointsToAdd);

            PathStorage.SavePath("paths.txt");
            PathStorage.LoadPath("paths.txt", 1);

            foreach (var item in Path.GetPoints())
            {
                Console.WriteLine(item);
            }
        }
Esempio n. 14
0
 static void Main(string[] args)
 {
     Point3D myPoint = new Point3D(11.1, 22.2, 33.3);
     Console.WriteLine(myPoint);
     Console.WriteLine(Point3D.StartingPoint);
 }
Esempio n. 15
0
        public static double DistanceBetween2Points(Point3D a, Point3D b)
        {
            double dist = Math.Sqrt(Math.Pow(a.x - b.x, 2) + Math.Pow(a.y - b.y, 2) + Math.Pow(a.z - b.z, 2));

            return dist;
        }
Esempio n. 16
0
        static void Main(string[] args)
        {
            Point3D point = new Point3D(1, 2, 3);

            Console.WriteLine(point.ToString());
        }
 static void Main(string[] args)
 {
     Point3D point = new Point3D(2, 4, 6);
     Console.WriteLine(Point3D.StartingPoint);
     Console.WriteLine(point);
 }
Esempio n. 18
0
        static void Main()
        {
            Point3D point = new Point3D(1.3919023f, 6.12837912f, 10.391283f);

            Console.WriteLine(point.ToString());
        }
Esempio n. 19
0
 static void Main()
 {
     Point3D point = new Point3D(1, 2, 3);
     Console.WriteLine(point);
 }
 static void Main(string[] args)
 {
     var point = new Point3D(1.6, 6.9, 8);
     Console.WriteLine(point);
 }
Esempio n. 21
0
 static void Main(string[] args)
 {
     Point3D firstPoint= new Point3D(1, 1, 1);
     Point3D secondPoint = new Point3D(3, 3, 3);
     Console.WriteLine(Distance.DistanceBetween2Points(firstPoint, secondPoint));
 }
Esempio n. 22
0
        static void Main(string[] args)
        {
            Point3D point = new Point3D(1, 2, 3);

            Console.WriteLine(point.ToString());
        }
Esempio n. 23
0
 public static void AddPoint(Point3D point)
 {
     points.Add(point);
 }