PDA

View Full Version : Section: Math Question



Too Soon
01-17-2014, 12:41 AM
{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
01-17-2014, 12:48 AM
{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
01-17-2014, 12:58 AM
What about Max(a,b: integer): integer;
Radius := Max((x2-x1)div 2, (y2-y1)div 2);

Olly
01-17-2014, 01:49 AM
Returns the biggest number, between a and b.. same with min returns the smallest.

masterBB
01-18-2014, 11:22 AM
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!