You are here

public function PHPExcel_Polynomial_Best_Fit::getSlope in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php \PHPExcel_Polynomial_Best_Fit::getSlope()

* Return the Slope of the line * *

Parameters

int $dp Number of places of decimal precision to display: * @return string *

Overrides PHPExcel_Best_Fit::getSlope

4 calls to PHPExcel_Polynomial_Best_Fit::getSlope()
PHPExcel_Polynomial_Best_Fit::getCoefficients in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php
PHPExcel_Polynomial_Best_Fit::getEquation in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php
* Return the Equation of the best-fit line * *
PHPExcel_Polynomial_Best_Fit::getValueOfXForY in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php
* Return the X-Value for a specified value of Y * *
PHPExcel_Polynomial_Best_Fit::getValueOfYForX in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php
* Return the Y-Value for a specified value of X * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/trend/polynomialBestFitClass.php, line 127

Class

PHPExcel_Polynomial_Best_Fit
PHPExcel_Polynomial_Best_Fit

Code

public function getSlope($dp = 0) {
  if ($dp != 0) {
    $coefficients = array();
    foreach ($this->_slope as $coefficient) {
      $coefficients[] = round($coefficient, $dp);
    }
    return $coefficients;
  }
  return $this->_slope;
}