diff options
author | Erich Eckner <git@eckner.net> | 2017-07-11 12:58:59 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-07-11 13:00:04 +0200 |
commit | 56422ae1ea38a09a6cafc78715cbe1436fc4bd5e (patch) | |
tree | 7ff8e24a51aa161d509ecf096e1684c9182da205 | |
parent | 1c76b3b38f6f3eaf15ceface8a99d64c3085f081 (diff) | |
download | units-56422ae1ea38a09a6cafc78715cbe1436fc4bd5e.tar.xz |
lowlevelunit: add some point- and matrix-functions
-rw-r--r-- | lowlevelunit.pas | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas index 17ce8c9..09fc555 100644 --- a/lowlevelunit.pas +++ b/lowlevelunit.pas @@ -84,9 +84,14 @@ function umbrechen(s,trenner: string; klammernBeachten: boolean = false; zeilena function unEscape(s: string): string; function mydatetimetostr(t: tDateTime): string; function t2x2ExtendedToStr(p: t2x2Extended): string; +function t2x2LongintToStr(p: t2x2Longint): string; function tExtPointToStr(p: tExtPoint): string; function tIntPointToStr(p: tIntPoint): string; procedure fehler(s: string); +function intPoint(x,y: longint): tIntPoint; +function extPoint(x,y: extended): tExtPoint; +function _2x2Longint(xx,xy,yx,yy: longint): t2x2Longint; +function _2x2Extended(xx,xy,yx,yy: extended): t2x2Extended; function hexDump(p: pointer; cnt: longint): string; function base64ToBin(var s: string): boolean; @@ -683,6 +688,13 @@ begin floattostr(p['y','x'])+' .. '+floattostr(p['y','y']); end; +function t2x2LongintToStr(p: t2x2Longint): string; +begin + result:= + inttostr(p['x','x'])+' .. '+inttostr(p['x','y'])+' x '+ + inttostr(p['y','x'])+' .. '+inttostr(p['y','y']); +end; + function tExtPointToStr(p: tExtPoint): string; begin result:=floattostr(p['x'])+';'+floattostr(p['y']); @@ -699,6 +711,34 @@ begin raise exception.create(s); end; +function intPoint(x,y: longint): tIntPoint; +begin + result['x']:=x; + result['y']:=y; +end; + +function extPoint(x,y: extended): tExtPoint; +begin + result['x']:=x; + result['y']:=y; +end; + +function _2x2Longint(xx,xy,yx,yy: longint): t2x2Longint; +begin + result['x','x']:=xx; + result['x','y']:=xy; + result['y','x']:=yx; + result['y','y']:=yy; +end; + +function _2x2Extended(xx,xy,yx,yy: extended): t2x2Extended; +begin + result['x','x']:=xx; + result['x','y']:=xy; + result['y','x']:=yx; + result['y','y']:=yy; +end; + function hexDump(p: pointer; cnt: longint): string; var i: longint; |