public
class Punkt
{
   private double modul, sinalfa;
   public Punkt ()
   {
      modul = Math.sqrt (Math.pow(320, 2) + Math.pow(200, 2));
      sinalfa = (double) 200 / modul;
   }
   public Punkt (int x, int y)
   {
      ustawWspolrzedne(x, y);
   }
   void ustawWspolrzedne(int wspX, int wspY)
   {
      modul = Math.sqrt (Math.pow(wspX, 2) + Math.pow(wspY, 2));
      sinalfa  = (double) wspY / modul;      
   }
   Punkt pobierzWspolrzedne()
   {
      Punkt punkt = new Punkt();
      punkt.sinalfa = sinalfa;
      punkt.modul = modul;
      return punkt;
   }
   void pobierzWspolrzedne(Punkt punkt)
   {
      punkt.sinalfa = sinalfa;
      punkt.modul = modul;
   }
   void ustawX (int wspX)
   {
      ustawWspolrzedne (wspX, pobierzY());
   }
   void ustawY (int wspY)
   {
      ustawWspolrzedne (pobierzX(), wspY);
   }
   int pobierzX ()
   {
      double x;
      x = modul * Math.sqrt(1 - Math.pow(sinalfa, 2));
      return (int)Math.round(x);
   }
   int pobierzY ()
   {
      double y;
      y = modul * sinalfa;
      return (int)Math.round(y);
   }
}
