예제 #1
0
        static void Main(string[] args)
        {
            Punct3D P = new Punct3D(1, 1, 1);

            Console.WriteLine("x={0},y={1},z={2}", P.getx(), P.gety(), P.getz());
            Console.WriteLine(P.distanta(new Punct3D()));
            Console.WriteLine(P.pozitie());
            Console.ReadKey();
        }
예제 #2
0
 public double distanta(Punct3D P) //supraincarc functia distanta (semnatura diferita-paramtri diferiti ca tip si/sau numar)
 {
     return(Math.Sqrt(Math.Pow(this.getx() - P.getx(), 2) + Math.Pow(this.gety() - P.gety(), 2) + Math.Pow(this.z - P.z, 2)));
 }