SRL Archive - SRL Development and Help

Section: Math Question


Too Soon

2014-01-16 19:41:44

{edit: this might be in the wrong place actually… sorry}

http://docs.villavu.com/simba/scriptref/math.html#mine

this page no longer exists-404 error.
I know minE() is a math function, I would like to know what it does.

minE(a,b: extended): extended;

minE(wind,dist); //Found in Mouse.simba WindMouse() procedure

Brandon

2014-01-16 19:48:29

From: Too Soon
{edit: this might be in the wrong place actually… sorry}

http://docs.villavu.com/simba/scriptref/math.html#mine

this page no longer exists-404 error.
I know minE() is a math function, I would like to know what it does.

minE(a,b: extended): extended;

minE(wind,dist); //Found in Mouse.simba WindMouse() procedure


Determines the minimum between two floating point/decimal values and returns the smallest of the two.

Too Soon

2014-01-16 19:58:12

What about Max(a,b: integer): integer;
Radius := Max((x2-x1)div 2, (y2-y1)div 2);

Olly

2014-01-16 20:49:19

Returns the biggest number, between a and b.. same with min returns the smallest.

masterBB

2014-01-18 06:22:41

Radius := Max((x2-x1)div 2, (y2-y1)div 2);

can be written as:

Width := x2 - x1;
Height := y2 - y1;
Diameter := Max(width, height);
Radius := diameter div 2;

or even biggger as:

Width := x2 - x1;
Height := y2 - y1;
if(Width > Height) then
Diameter := Width
else
Diameter := Heigth;
Radius := diameter div 2;

It will get the radius of an oval. Picking the largest radius.

Good questions, keep 'm coming!