You are here

function hypo in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/utils/Maths.php \hypo()

@package JAMA

Pythagorean Theorem:

a = 3 b = 4 r = sqrt(square(a) + square(b)) r = 5

r = sqrt(a^2 + b^2) without under/overflow.

3 calls to hypo()
EigenvalueDecomposition::tql2 in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php
* Symmetric tridiagonal QL algorithm. * * This is derived from the Algol procedures tql2, by * Bowdler, Martin, Reinsch, and Wilkinson, Handbook for * Auto. Comp., Vol.ii-Linear Algebra, and the corresponding * Fortran subroutine in…
PHPExcel_Shared_JAMA_QRDecomposition::__construct in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/QRDecomposition.php
* QR Decomposition computed by Householder reflections. * *
SingularValueDecomposition::__construct in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/SingularValueDecomposition.php
* Construct the singular value decomposition * * Derived from LINPACK code. * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/utils/Maths.php, line 14

Code

function hypo($a, $b) {
  if (abs($a) > abs($b)) {
    $r = $b / $a;
    $r = abs($a) * sqrt(1 + $r * $r);
  }
  elseif ($b != 0) {
    $r = $a / $b;
    $r = abs($b) * sqrt(1 + $r * $r);
  }
  else {
    $r = 0.0;
  }
  return $r;
}