with Ada.Text_IO; use Ada.Text_IO; with Ada.Numerics.Generic_Elementary_Functions; package body vector is package Math is new Ada.Numerics.Generic_Elementary_Functions (Float); function get_range (V : in vector2d) return range_type is begin return range_type(Math.Sqrt (V.X * V.X + V.Y * V.Y)); end get_range; function get_vect (X : in Float; Y : in Float) return vector2d is V : vector.vector2d; begin V.X := X; V.Y := Y; return V; end get_vect; procedure set_X (V : in out vector2d; X : in Float) is begin V.X := X; end set_X; procedure set_Y (V : in out vector2d; Y : in Float) is begin V.Y := Y; end set_Y; end vector;