PHP code example of fyre / math

1. Go to this page and download the library: Download fyre/math library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fyre / math example snippets


use Fyre\Utility\Math;

$abs = Math::abs($number);

$acos = Math::acos($number);

$acosh = Math::acosh($number);

$asin = Math::asin($number);

$asinh = Math::asinh($number);

$atan = Math::atan($number);

$atan2 = Math::atan2($x, $y);

$atanh = Math::atanh($number);

$decimal = Math::binaryToDecimal($binaryString);

$rounded = Math::ceil($number);

$clamped = Math::clamp($number, $min, $max);

$clamped = Math::clampPercent($number);

$newNumber = Math::convertBase($number, $fromBase, $toBase);

$cos = Math::cos($number);

$cosh = Math::cosh($number);

$binary = Math::decimalToBinary($number);

$hex = Math::decimalToHex($number);

$octal = Math::decimalToOctal($number);

$radians = Math::degreesToRadians($number);

$distance = Math::dist($x1, $y1, $x2, $y2);

$exp = Math::exp($number);

$expMinus1 = Math::expMinus1($number);

$rounded = Math::floor($number);

$modulo = Math::fmod($number, $divisor);

$decimal = Math::hexToDecimal($hexString);

$length = Math::hypot($x, $y);

$amount = Math::inverseLerp($v1, $v2, $value);

$isNumeric = Math::isNumeric($value);

$value = Math::lerp($v1, $v2, $amount);

$log = Math::log($number, $base);

$log = Math::log10($number);

$log = Math::logPlus1($number);

$mapped = Math::map($number, $fromMin, $fromMax, $toMin, $toMax);

$highest = Math::max(...$numbers);

$lowest = Math::min(...$numbers);

$decimal = Math::octalToDecimal($octalString);

$pow = Math::pow($number, $exponent);

$product = Math::product(...$numbers);

$degrees = Math::radiansToDegrees($number);

$random = Math::random($a, $b);

$randomInt = Math::randomInt($a, $b);

$rounded = Math::round($number, $precision, $mode);

$sin = Math::sin($number);

$sinh = Math::sinh($number);

$sqrt = Math::sqrt($number);

$sum = Math::sum(...$numbers);

$tan = Math::tan($number);

$tanh = Math::tanh($number);

$toStep = Math::toStep($number, $step);