GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
Math Class Reference

Static Public Member Functions

static floorFloat ($n)
 
static ceilFloat ($n)
 
static clamp ($value, $low, $high)
 
static solveQuadratic ($a, $b, $c)
 

Member Function Documentation

◆ ceilFloat()

static ceilFloat (   $n)
static
Parameters
$n
Returns
int
46  {
47  $i = (int) ($n + 1);
48  return $n >= $i ? $i : $i - 1;
49  }

◆ clamp()

static clamp (   $value,
  $low,
  $high 
)
static
Parameters
$value
$low
$high
Returns
mixed
58  {
59  return min($high, max($low, $value));
60  }

◆ floorFloat()

static floorFloat (   $n)
static
Parameters
$n
Returns
int
36  {
37  $i = (int) $n;
38  return $n >= $i ? $i : $i - 1;
39  }

◆ solveQuadratic()

static solveQuadratic (   $a,
  $b,
  $c 
)
static
Parameters
$a
$b
$c
Returns
array
69  : array{
70  $x[0] = (-$b + sqrt($b ** 2 - 4 * $a * $c)) / (2 * $a);
71  $x[1] = (-$b - sqrt($b ** 2 - 4 * $a * $c)) / (2 * $a);
72  if($x[0] == $x[1]){
73  return [$x[0]];
74  }
75  return $x;
76  }

The documentation for this class was generated from the following file: