geometry.adb (Источник)

WITH Ada.Numerics.Elementary_Functions;
WITH Ada.Float_Text_Io;
WITH Ada.Integer_Text_Io;
WITH Ada.Text_Io;
USE Ada.Numerics.Elementary_Functions;
PACKAGE BODY Geometry IS
   FUNCTION Get_Distance (M, N : POINT) RETURN FLOAT IS
   BEGIN
      RETURN Sqrt (FLOAT ((N.X - M.X)**2) + FLOAT ((N.Y - M.Y)**2));
   END Get_Distance;
   PROCEDURE Put (P : POINT) IS
   BEGIN
      Ada.Text_Io.Put ("Point");
      Ada.Integer_Text_Io.Put (P.Index);
      Ada.Text_Io.Put (": ");
      Ada.Text_Io.Put ("p.X is");
      Ada.Float_Text_Io.Put (P.X, Aft => 4, Exp => 0);
      Ada.Text_Io.Put (", p.Y is");
      Ada.Float_Text_Io.Put (P.Y, Aft => 4, Exp => 0);
      Ada.Text_Io.New_Line;
   END Put;
END Geometry;