Beispiel #1
0
        static void Main(string[] args)
        {
            _3DPoint point1 = new _3DPoint(1, 2, 3);
            _3DPoint point2 = new _3DPoint(0, 0, 0);
            _3DPoint point3 = new _3DPoint(4, 5, 6);

            point1.Print();
            point2.Print();
            point3.Print();

            Console.WriteLine(point1.DistanceFromOrigin());
            Console.WriteLine(point1.DistanceBetween2Points(point2));
            Console.WriteLine(point1.DistanceBetween2Points(point3));
            Console.WriteLine(point3.ScalarProduct(point1));

            Console.ReadKey();
        }
Beispiel #2
0
 public double ScalarProduct(_3DPoint point)
 {
     return(x * point.x + y * point.y + z * point.z);
 }
Beispiel #3
0
 public double DistanceBetween2Points(_3DPoint point)
 {
     return(Math.Pow((x - point.x) ^ 2 + (y - point.y) ^ 2 + (z - point.z) ^ 2, 1 / 2));
 }