-
Notifications
You must be signed in to change notification settings - Fork 2
/
geometry.ads
64 lines (48 loc) · 1.5 KB
/
geometry.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package Geometry is
type Point is record
x : Float;
y : Float;
z : Float;
end record;
type Angle is new Float range -360.0 .. 360.0;
type Axes is record
yaw : Angle;
pitch : Angle;
roll : Angle;
end record;
type Shape is tagged record
position : Point;
rotation : Axes;
end record;
type Rectangle is new Shape with record
width : Float;
length : Float;
height : Float;
end record;
function volume(s : Rectangle) return Float;
function surface_area(s : Rectangle) return Float;
type Circle is new Shape with record
radius : Float;
end record;
function surface_area(s : Circle) return Float;
function circumference(s : Circle) return Float;
type Ellipse is new Shape with record
a : Float;
b : Float;
end record;
function surface_area(s : Ellipse) return Float;
function circumference(s : Ellipse) return Float;
type Cylinder is new Shape with record
radius : Float;
height : Float;
end record;
function volume(s : Cylinder) return Float;
function surface_area(s : Cylinder) return Float;
type Sphere is new Shape with record
radius : Float;
end record;
function volume(s : Sphere) return Float;
function surface_area(s : Sphere) return Float;
function distance(point1, point2 : Point) return Float;
function midpoint(point1, point2 : Point) return Point;
end Geometry;