getIntersect() * pow($this->getSlope(),($xValue - $this->_Xoffset)); } // function getValueOfYForX() public function getValueOfXForY($yValue) { return log(($yValue + $this->_Yoffset) / $this->getIntersect()) / log($this->getSlope()); } // function getValueOfXForY() public function getEquation($dp=0) { $slope = $this->getSlope($dp); $intersect = $this->getIntersect($dp); return 'Y = '.$intersect.' * '.$slope.'^X'; } // function getEquation() public function getSlope($dp=0) { if ($dp != 0) { return round(exp($this->_slope),$dp); } return exp($this->_slope); } // function getSlope() public function getIntersect($dp=0) { if ($dp != 0) { return round(exp($this->_intersect),$dp); } return exp($this->_intersect); } // function getIntersect() private function _exponential_regression($yValues, $xValues, $const) { foreach($yValues 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 _exponential_regression() function __construct($yValues, $xValues=array(), $const=True) { if (parent::__construct($yValues, $xValues) !== False) { $this->_exponential_regression($yValues, $xValues, $const); } } // function __construct() } // class exponentialBestFit