/* ###########################################################################
   This function returns the brightness ratio between any two given stellar
   magnitudes (m1, m2), where (m1) is the brighter of the two stars.

   NO DEPENDENCIES

   ERRORS:
   FALSE is returned if either magnitude argument is non-numeric.
   ###########################################################################
*/

   function Brightness_Ratio_m1_m2 ($Mag1, $Mag2)
{
   $m1 = trim($Mag1);
   $m2 = trim($Mag2);

   if (!Is_Numeric($m1) or !Is_Numeric($m2)) {return FALSE;}

// --------------------------------------------------
// Ensure that (m1) is the brighter of the two stars
// and internally swap them if otherwise.

   if ($m2 < $m1) {$w=$m1;  $m1=$m2;  $m2=$w;}

// ------------------------------------------------
// Compute brightness ratio between the magnitudes.

   return pow(pow(100, 1/5), $m2-$m1);

} // End of  Brightness_Ratio_m1_m2 (...)