summaryrefslogtreecommitdiff
path: root/mathunit.pas
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2014-09-23 16:12:24 +0200
committerErich Eckner <git@eckner.net>2014-09-23 16:12:24 +0200
commit17ec74a07cacd08b0904b29a390d3b7f26ba7b1b (patch)
treeaeea32b00bf5d45b554e62c75cb59881b2594915 /mathunit.pas
downloadROM-17ec74a07cacd08b0904b29a390d3b7f26ba7b1b.tar.xz
Initialer Commit
Diffstat (limited to 'mathunit.pas')
-rw-r--r--mathunit.pas46
1 files changed, 46 insertions, 0 deletions
diff --git a/mathunit.pas b/mathunit.pas
new file mode 100644
index 0000000..3d5e111
--- /dev/null
+++ b/mathunit.pas
@@ -0,0 +1,46 @@
+unit mathunit;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils;
+
+type
+ tExtPoint = record
+ x,y: extended;
+ end;
+ tExtPointArray = array of tExtPoint;
+ pTExtPointArray = ^tExtPointArray;
+ tLongintArray = array of longint;
+ pTLongintArray = ^tLongintArray;
+ tExtendedArray = array of extended;
+
+function Plus(a,b: tExtPoint): tExtPoint;
+function Durch(a: tExtPoint; b: extended): tExtPoint;
+function myFrac(x: extended): extended;
+
+implementation
+
+function Plus(a,b: tExtPoint): tExtPoint;
+begin
+ result.x:=a.x+b.x;
+ result.y:=a.y+b.y;
+end;
+
+function Durch(a: tExtPoint; b: extended): tExtPoint;
+begin
+ result.x:=a.x/b;
+ result.y:=a.y/b;
+end;
+
+function myFrac(x: extended): extended;
+begin
+ result:=frac(x);
+ while result<0 do
+ result:=result+1;
+end;
+
+end.
+