From 5826ca19f005c1fdda1dc9e6d6df5c2411342ca4 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 31 Jul 2010 19:18:57 +0200 Subject: [PATCH] Fix hypot part 2... ;-) --- Projects/Simba/simbaunit.pas | 3 ++- Units/MMLAddon/PSInc/Wrappers/math.inc | 5 +++++ Units/MMLAddon/PSInc/psexportedmethods.inc | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Projects/Simba/simbaunit.pas b/Projects/Simba/simbaunit.pas index 626dfab..85edb6e 100644 --- a/Projects/Simba/simbaunit.pas +++ b/Projects/Simba/simbaunit.pas @@ -48,7 +48,7 @@ uses CastaliaSimplePasPar, v_AutoCompleteForm, PSDump, settings; const - SimbaVersion = 706; + SimbaVersion = 707; type @@ -3150,3 +3150,4 @@ initialization end. + diff --git a/Units/MMLAddon/PSInc/Wrappers/math.inc b/Units/MMLAddon/PSInc/Wrappers/math.inc index b7c4e85..f2e4385 100644 --- a/Units/MMLAddon/PSInc/Wrappers/math.inc +++ b/Units/MMLAddon/PSInc/Wrappers/math.inc @@ -77,6 +77,11 @@ begin Result := Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1))); end; +function ps_Hypot(X, Y: Extended): Extended;extdecl; +begin + result := hypot(x,y); +end; + function ps_RandomRange(const aFrom, aTo: Integer): Integer; extdecl; begin Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom); diff --git a/Units/MMLAddon/PSInc/psexportedmethods.inc b/Units/MMLAddon/PSInc/psexportedmethods.inc index 172ed37..ac7ec16 100644 --- a/Units/MMLAddon/PSInc/psexportedmethods.inc +++ b/Units/MMLAddon/PSInc/psexportedmethods.inc @@ -69,6 +69,7 @@ AddFunction(@ps_PointInBox,'function PointInBox(PT : TPoint; Box: TBox): Boolean AddFunction(@ps_sqr,'function Sqr(e : extended) : extended;'); AddFunction(@ps_point,'function Point(x,y:integer) : TPoint;'); AddFunction(@ps_Distance,'function Distance(xs,ys,xe,ye : integer) : integer;'); +AddFunction(@ps_hypot,'function Hypot(X, Y: Extended): Extended;'); AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;'); AddFunction(@ps_incex,'procedure IncEx(var x : integer; increase : integer);'); AddFunction(@ps_DecEx,'procedure DecEx(var x : integer; Decrease : integer);'); @@ -91,7 +92,6 @@ AddFunction(@ps_ArcTan, 'function ArcTan(e: extended): extended;'); AddFunction(@ps_Cotan, 'function Cotan(e: extended): extended;'); AddFunction(@ps_Secant, 'function Secant(e: extended): extended;'); AddFunction(@ps_Cosecant, 'function Cosecant(e: extended): extended;'); -//AddFunction(@ps_Hypot, 'function Hypot(e: extended): extended;'); AddFunction(@ps_Cot, 'function Cot(e: extended): extended;'); AddFunction(@ps_Sec, 'function Sec(e: extended): extended;'); AddFunction(@ps_Csc, 'function Csc(e: extended): extended;');