Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-howFarBetween

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  howFarBetween   Lines 1296-1318 (22 lines)Added: 2021-02-03 file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function howFarBetween $a$b$c )
        {
#-k     math
#-      find how far $b is between $a to $c
#-              $a      starting point
#-              $b      somewhere between
#-              $c      ending point
#-              returns $pc*100 - the % distance of $b from $a to $c (0 <= $pc <= 1)
#-              or      0 if outside the endpoints
#-      This is the inverse of goPartWayBetween
#-d     2/3/21 - Added
#-s     See also: goPartWayBetween

        
$pc 0;
        if (
$a <> $c)
                {
                if ((
$a <= $b)  &&  ($b <= $c)) { $pc = ($b-$a)/($c-$a); }
                if ((
$a >= $b)  &&  ($b >= $c)) { $pc = ($a-$b)/($a-$c); }
                }

        return 
$pc;
        }

?>