summaryrefslogtreecommitdiff
path: root/mathunit.pas
diff options
context:
space:
mode:
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.
+