getIntersect() + $this->getSlope() * log($xValue - $this->_Xoffset); } // function getValueOfYForX() public function getValueOfXForY($yValue) { return exp(($yValue - $this->getIntersect()) / $this->getSlope()); } // function getValueOfXForY() public function getEquation($dp=0) { $slope = $this->getSlope($dp); $intersect = $this->getIntersect($dp); return 'Y = '.$intersect.' + '.$slope.' * log(X)'; } // function getEquation() private function _logarithmic_regression($yValues, $xValues, $const) { foreach($xValues as &$value) { if ($value < 0.0) { $value = 0 - log(abs($value)); } elseif ($value > 0.0) { $value = log($value); } } unset($value); $this->_leastSquareFit($yValues, $xValues, $const); } // function _logarithmic_regression() function __construct($yValues, $xValues=array(), $const=True) { if (parent::__construct($yValues, $xValues) !== False) { $this->_logarithmic_regression($yValues, $xValues, $const); } } // function __construct() } // class logarithmicBestFit