Add initial prototype.
This commit is contained in:
26
1-base/math/applet/demo/basic/basic_math_demo.gpr
Normal file
26
1-base/math/applet/demo/basic/basic_math_demo.gpr
Normal file
@@ -0,0 +1,26 @@
|
||||
with
|
||||
"math";
|
||||
|
||||
project Basic_Math_Demo
|
||||
is
|
||||
for Object_Dir use "build";
|
||||
for Exec_Dir use ".";
|
||||
for Main use ("launch_basic_math_demo.adb");
|
||||
|
||||
package Builder is
|
||||
for Default_Switches ("ada") use ("-g");
|
||||
end Builder;
|
||||
|
||||
package Compiler is
|
||||
for Default_Switches ("ada") use ("-gnat2022");
|
||||
end Compiler;
|
||||
|
||||
package Binder is
|
||||
for Default_Switches ("ada") use ("-E");
|
||||
end Binder;
|
||||
|
||||
package Linker is
|
||||
for Default_Switches ("ada") use ("-g");
|
||||
end Linker;
|
||||
|
||||
end Basic_Math_Demo;
|
||||
36
1-base/math/applet/demo/basic/launch_basic_math_demo.adb
Normal file
36
1-base/math/applet/demo/basic/launch_basic_math_demo.adb
Normal file
@@ -0,0 +1,36 @@
|
||||
with
|
||||
short_Math,
|
||||
float_Math.Geometry,
|
||||
long_Math,
|
||||
|
||||
ada.text_IO;
|
||||
|
||||
|
||||
procedure launch_basic_math_Demo
|
||||
--
|
||||
-- A simple demonstration of the Math packages.
|
||||
--
|
||||
is
|
||||
package Math renames float_Math;
|
||||
use Math, math.Geometry;
|
||||
|
||||
procedure log (Message : in String) renames ada.text_IO.put_Line;
|
||||
|
||||
begin
|
||||
declare
|
||||
Value : Real := 0.0;
|
||||
begin
|
||||
log (Image (Value, 5));
|
||||
Value := Value + 1.0;
|
||||
log (Image (Value, 5));
|
||||
end;
|
||||
|
||||
declare
|
||||
use Vectors;
|
||||
Value : Vector_3 := math.Origin_3d;
|
||||
begin
|
||||
log (Image (Value));
|
||||
Value := Value + (1.0, 1.0, 1.0);
|
||||
log (Image (Value));
|
||||
end;
|
||||
end launch_basic_math_Demo;
|
||||
Reference in New Issue
Block a user