ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Calculation_Engineering Class Reference
+ Collaboration diagram for PHPExcel_Calculation_Engineering:

Static Public Member Functions

static _parseComplex ($complexNumber)
static BESSELI ($x, $n)
 BESSELI.
static BESSELJ ($x, $n)
 BESSELJ.
static BESSELK ($x, $ord)
 BESSELK.
static BESSELY ($x, $ord)
 BESSELY.
static BINTODEC ($x)
 BINTODEC.
static BINTOHEX ($x, $places=null)
 BINTOHEX.
static BINTOOCT ($x, $places=null)
 BINTOOCT.
static DECTOBIN ($x, $places=null)
 DECTOBIN.
static DECTOHEX ($x, $places=null)
 DECTOHEX.
static DECTOOCT ($x, $places=null)
 DECTOOCT.
static HEXTOBIN ($x, $places=null)
 HEXTOBIN.
static HEXTODEC ($x)
 HEXTODEC.
static HEXTOOCT ($x, $places=null)
 HEXTOOCT.
static OCTTOBIN ($x, $places=null)
 OCTTOBIN.
static OCTTODEC ($x)
 OCTTODEC.
static OCTTOHEX ($x, $places=null)
 OCTTOHEX.
static COMPLEX ($realNumber=0.0, $imaginary=0.0, $suffix='i')
 COMPLEX.
static IMAGINARY ($complexNumber)
 IMAGINARY.
static IMREAL ($complexNumber)
 IMREAL.
static IMABS ($complexNumber)
 IMABS.
static IMARGUMENT ($complexNumber)
 IMARGUMENT.
static IMCONJUGATE ($complexNumber)
 IMCONJUGATE.
static IMCOS ($complexNumber)
 IMCOS.
static IMSIN ($complexNumber)
 IMSIN.
static IMSQRT ($complexNumber)
 IMSQRT.
static IMLN ($complexNumber)
 IMLN.
static IMLOG10 ($complexNumber)
 IMLOG10.
static IMLOG2 ($complexNumber)
 IMLOG2.
static IMEXP ($complexNumber)
 IMEXP.
static IMPOWER ($complexNumber, $realNumber)
 IMPOWER.
static IMDIV ($complexDividend, $complexDivisor)
 IMDIV.
static IMSUB ($complexNumber1, $complexNumber2)
 IMSUB.
static IMSUM ()
 IMSUM.
static IMPRODUCT ()
 IMPRODUCT.
static DELTA ($a, $b=0)
 DELTA.
static GESTEP ($number, $step=0)
 GESTEP.
static _erfVal ($x)
static ERF ($lower, $upper=null)
 ERF.
static ERFC ($x)
 ERFC.
static getConversionGroups ()
 getConversionGroups
static getConversionGroupUnits ($group=NULL)
 getConversionGroupUnits
static getConversionGroupUnitDetails ($group=NULL)
 getConversionGroupUnitDetails
static getConversionMultipliers ()
 getConversionGroups
static CONVERTUOM ($value, $fromUOM, $toUOM)
 CONVERTUOM.

Static Private Member Functions

static _cleanComplex ($complexNumber)
static _nbrConversionFormat ($xVal, $places)
static _Besselk0 ($fNum)
static _Besselk1 ($fNum)
static _Bessely0 ($fNum)
static _Bessely1 ($fNum)
static _erfcVal ($x)

Static Private Attributes

static $_conversionUnits
static $_conversionMultipliers
static $_unitConversions
static $_two_sqrtpi = 1.128379167095512574
static $_one_sqrtpi = 0.564189583547756287

Detailed Description

Definition at line 50 of file Engineering.php.

Member Function Documentation

static PHPExcel_Calculation_Engineering::_Besselk0 (   $fNum)
staticprivate

Definition at line 830 of file Engineering.php.

References $y, and BESSELI().

Referenced by BESSELK().

{
if ($fNum <= 2) {
$fNum2 = $fNum * 0.5;
$y = ($fNum2 * $fNum2);
$fRet = -log($fNum2) * self::BESSELI($fNum, 0) +
(-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y *
(0.10750e-3 + $y * 0.74e-5))))));
} else {
$y = 2 / $fNum;
$fRet = exp(-$fNum) / sqrt($fNum) *
(1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y *
(0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3))))));
}
return $fRet;
} // function _Besselk0()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_Besselk1 (   $fNum)
staticprivate

Definition at line 847 of file Engineering.php.

References $y, and BESSELI().

Referenced by BESSELK().

{
if ($fNum <= 2) {
$fNum2 = $fNum * 0.5;
$y = ($fNum2 * $fNum2);
$fRet = log($fNum2) * self::BESSELI($fNum, 1) +
(1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y *
(-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum;
} else {
$y = 2 / $fNum;
$fRet = exp(-$fNum) / sqrt($fNum) *
(1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y *
(0.325614e-2 + $y * (-0.68245e-3)))))));
}
return $fRet;
} // function _Besselk1()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_Bessely0 (   $fNum)
staticprivate

Definition at line 902 of file Engineering.php.

References $y, BESSELJ(), and M_2DIVPI.

Referenced by BESSELY().

{
if ($fNum < 8.0) {
$y = ($fNum * $fNum);
$f1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y * (-86327.92757 + $y * 228.4622733))));
$f2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y))));
$fRet = $f1 / $f2 + M_2DIVPI * self::BESSELJ($fNum, 0) * log($fNum);
} else {
$z = 8.0 / $fNum;
$y = ($z * $z);
$xx = $fNum - 0.785398164;
$f1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6)));
$f2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y * (-0.934945152e-7))));
$fRet = sqrt(M_2DIVPI / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2);
}
return $fRet;
} // function _Bessely0()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_Bessely1 (   $fNum)
staticprivate

Definition at line 920 of file Engineering.php.

References $y, BESSELJ(), and M_2DIVPI.

Referenced by BESSELY().

{
if ($fNum < 8.0) {
$y = ($fNum * $fNum);
$f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y *
(-0.4237922726e7 + $y * 0.8511937935e4)))));
$f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y *
(0.1020426050e6 + $y * (0.3549632885e3 + $y)))));
$fRet = $f1 / $f2 + M_2DIVPI * ( self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum);
} else {
$z = 8.0 / $fNum;
$y = ($z * $z);
$xx = $fNum - 2.356194491;
$f1 = 1 + $y * (0.183105e-2 + $y * (-0.3516396496e-4 + $y * (0.2457520174e-5 + $y * (-0.240337019e6))));
$f2 = 0.04687499995 + $y * (-0.2002690873e-3 + $y * (0.8449199096e-5 + $y * (-0.88228987e-6 + $y * 0.105787412e-6)));
$fRet = sqrt(M_2DIVPI / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2);
#i12430# ...but this seems to work much better.
// $fRet = sqrt(M_2DIVPI / $fNum) * sin($fNum - 2.356194491);
}
return $fRet;
} // function _Bessely1()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_cleanComplex (   $complexNumber)
staticprivate

Definition at line 720 of file Engineering.php.

Referenced by IMCONJUGATE(), and IMDIV().

{
if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1);
if ($complexNumber{0} == '0') $complexNumber = substr($complexNumber,1);
if ($complexNumber{0} == '.') $complexNumber = '0'.$complexNumber;
if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1);
return $complexNumber;
}

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_erfcVal (   $x)
staticprivate

Definition at line 1978 of file Engineering.php.

References $d, $t, $x, _erfVal(), ERFC(), and PRECISION.

Referenced by _erfVal(), and ERFC().

{
if (abs($x) < 2.2) {
return 1 - self::_erfVal($x);
}
if ($x < 0) {
return 2 - self::ERFC(-$x);
}
$a = $n = 1;
$b = $c = $x;
$d = ($x * $x) + 0.5;
$q1 = $q2 = $b / $d;
$t = 0;
do {
$t = $a * $n + $b * $x;
$a = $b;
$b = $t;
$t = $c * $n + $d * $x;
$c = $d;
$d = $t;
$n += 0.5;
$q1 = $q2;
$q2 = $b / $d;
} while ((abs($q1 - $q2) / $q2) > PRECISION);
return self::$_one_sqrtpi * exp(-$x * $x) * $q2;
} // function _erfcVal()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_erfVal (   $x)
static

Definition at line 1919 of file Engineering.php.

References $x, _erfcVal(), and PRECISION.

Referenced by _erfcVal(), ERF(), and PHPExcel_Calculation_Statistical\NORMDIST().

{
if (abs($x) > 2.2) {
return 1 - self::_erfcVal($x);
}
$sum = $term = $x;
$xsqr = ($x * $x);
$j = 1;
do {
$term *= $xsqr / $j;
$sum -= $term / (2 * $j + 1);
++$j;
$term *= $xsqr / $j;
$sum += $term / (2 * $j + 1);
++$j;
if ($sum == 0.0) {
break;
}
} while (abs($term / $sum) > PRECISION);
return self::$_two_sqrtpi * $sum;
} // function _erfVal()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_nbrConversionFormat (   $xVal,
  $places 
)
staticprivate

Definition at line 729 of file Engineering.php.

References PHPExcel_Calculation_Functions\NaN().

Referenced by BINTOHEX(), BINTOOCT(), DECTOBIN(), DECTOHEX(), DECTOOCT(), HEXTOOCT(), OCTTOBIN(), and OCTTOHEX().

{
if (!is_null($places)) {
if (strlen($xVal) <= $places) {
return substr(str_pad($xVal,$places,'0',STR_PAD_LEFT),-10);
} else {
}
}
return substr($xVal,-10);
} // function _nbrConversionFormat()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::_parseComplex (   $complexNumber)
static

Definition at line 673 of file Engineering.php.

Referenced by IMABS(), IMAGINARY(), IMARGUMENT(), IMCONJUGATE(), IMCOS(), IMDIV(), IMEXP(), IMLN(), IMLOG10(), IMLOG2(), IMPOWER(), IMPRODUCT(), IMREAL(), IMSIN(), IMSQRT(), IMSUB(), and IMSUM().

{
$workString = (string) $complexNumber;
$realNumber = $imaginary = 0;
// Extract the suffix, if there is one
$suffix = substr($workString,-1);
if (!is_numeric($suffix)) {
$workString = substr($workString,0,-1);
} else {
$suffix = '';
}
// Split the input into its Real and Imaginary components
$leadingSign = 0;
if (strlen($workString) > 0) {
$leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0;
}
$power = '';
$realNumber = strtok($workString, '+-');
if (strtoupper(substr($realNumber,-1)) == 'E') {
$power = strtok('+-');
++$leadingSign;
}
$realNumber = substr($workString,0,strlen($realNumber)+strlen($power)+$leadingSign);
if ($suffix != '') {
$imaginary = substr($workString,strlen($realNumber));
if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) {
$imaginary = $realNumber.'1';
$realNumber = '0';
} else if ($imaginary == '') {
$imaginary = $realNumber;
$realNumber = '0';
} elseif (($imaginary == '+') || ($imaginary == '-')) {
$imaginary .= '1';
}
}
return array( 'real' => $realNumber,
'imaginary' => $imaginary,
'suffix' => $suffix
);
} // function _parseComplex()

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::BESSELI (   $x,
  $n 
)
static

BESSELI.

Returns the modified Bessel function, which is equivalent to the Bessel function evaluated for purely imaginary arguments

Parameters
float$x
float$n
Returns
int

Definition at line 751 of file Engineering.php.

References $x, PHPExcel_Calculation_MathTrig\FACT(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

Referenced by _Besselk0(), and _Besselk1().

{
if ((is_numeric($x)) && (is_numeric($n))) {
$n = floor($n);
if ($n < 0) {
}
$f_2_PI = 2 * M_PI;
if (abs($x) <= 30) {
$fTerm = pow($x / 2, $n) / PHPExcel_Calculation_MathTrig::FACT($n);
$nK = 1;
$fResult = $fTerm;
$fSqrX = ($x * $x) / 4;
do {
$fTerm *= $fSqrX;
$fTerm /= ($nK * ($nK + $n));
$fResult += $fTerm;
} while ((abs($fTerm) > 1e-10) && (++$nK < 100));
} else {
$fXAbs = abs($x);
$fResult = exp($fXAbs) / sqrt($f_2_PI * $fXAbs);
if (($n && 1) && ($x < 0)) {
$fResult = -$fResult;
}
}
return $fResult;
}
} // function BESSELI()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::BESSELJ (   $x,
  $n 
)
static

BESSELJ.

Returns the Bessel function

Parameters
float$x
float$n
Returns
int

Definition at line 794 of file Engineering.php.

References $x, PHPExcel_Calculation_MathTrig\FACT(), PHPExcel_Calculation_Functions\flattenSingleValue(), M_2DIVPI, PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

Referenced by _Bessely0(), and _Bessely1().

{
if ((is_numeric($x)) && (is_numeric($n))) {
$n = floor($n);
if ($n < 0) {
}
$f_PI_DIV_2 = M_PI / 2;
$f_PI_DIV_4 = M_PI / 4;
$fResult = 0;
if (abs($x) <= 30) {
$fTerm = pow($x / 2, $n) / PHPExcel_Calculation_MathTrig::FACT($n);
$nK = 1;
$fResult = $fTerm;
$fSqrX = ($x * $x) / -4;
do {
$fTerm *= $fSqrX;
$fTerm /= ($nK * ($nK + $n));
$fResult += $fTerm;
} while ((abs($fTerm) > 1e-10) && (++$nK < 100));
} else {
$fXAbs = abs($x);
$fResult = sqrt(M_2DIVPI / $fXAbs) * cos($fXAbs - $n * $f_PI_DIV_2 - $f_PI_DIV_4);
if (($n && 1) && ($x < 0)) {
$fResult = -$fResult;
}
}
return $fResult;
}
} // function BESSELJ()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::BESSELK (   $x,
  $ord 
)
static

BESSELK.

Returns the modified Bessel function, which is equivalent to the Bessel functions evaluated for purely imaginary arguments.

Parameters
float$x
float$ord
Returns
float

Definition at line 873 of file Engineering.php.

References $x, _Besselk0(), _Besselk1(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
$ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord);
if ((is_numeric($x)) && (is_numeric($ord))) {
if (($ord < 0) || ($x == 0.0)) {
}
switch(floor($ord)) {
case 0 : return self::_Besselk0($x);
break;
case 1 : return self::_Besselk1($x);
break;
default : $fTox = 2 / $x;
$fBkm = self::_Besselk0($x);
for ($n = 1; $n < $ord; ++$n) {
$fBkp = $fBkm + $n * $fTox * $fBk;
$fBkm = $fBk;
$fBk = $fBkp;
}
}
return $fBk;
}
} // function BESSELK()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::BESSELY (   $x,
  $ord 
)
static

BESSELY.

Returns the Bessel function, which is also called the Weber function or the Neumann function.

Parameters
float$x
float$n
Returns
int

Definition at line 951 of file Engineering.php.

References $x, _Bessely0(), _Bessely1(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
$ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord);
if ((is_numeric($x)) && (is_numeric($ord))) {
if (($ord < 0) || ($x == 0.0)) {
}
switch(floor($ord)) {
case 0 : return self::_Bessely0($x);
break;
case 1 : return self::_Bessely1($x);
break;
default: $fTox = 2 / $x;
$fBym = self::_Bessely0($x);
for ($n = 1; $n < $ord; ++$n) {
$fByp = $n * $fTox * $fBy - $fBym;
$fBym = $fBy;
$fBy = $fByp;
}
}
return $fBy;
}
} // function BESSELY()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::BINTODEC (   $x)
static

BINTODEC.

Return a binary value as Decimal.

Parameters
string$x
Returns
string

Definition at line 988 of file Engineering.php.

References $out, $x, PHPExcel_Calculation_Functions\COMPATIBILITY_GNUMERIC, PHPExcel_Calculation_Functions\COMPATIBILITY_OPENOFFICE, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\getCompatibilityMode(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
$x = (int) $x;
} else {
}
}
$x = floor($x);
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[01]/',$x,$out)) {
}
if (strlen($x) > 10) {
} elseif (strlen($x) == 10) {
// Two's Complement
$x = substr($x,-9);
return '-'.(512-bindec($x));
}
return bindec($x);
} // function BINTODEC()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::BINTOHEX (   $x,
  $places = null 
)
static

BINTOHEX.

Return a binary value as Hex.

Parameters
string$x
Returns
string

Definition at line 1024 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\COMPATIBILITY_GNUMERIC, PHPExcel_Calculation_Functions\COMPATIBILITY_OPENOFFICE, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\getCompatibilityMode(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
$x = (int) $x;
} else {
}
}
$x = floor($x);
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[01]/',$x,$out)) {
}
if (strlen($x) > 10) {
} elseif (strlen($x) == 10) {
// Two's Complement
return str_repeat('F',8).substr(strtoupper(dechex(bindec(substr($x,-9)))),-2);
}
$hexVal = (string) strtoupper(dechex(bindec($x)));
return self::_nbrConversionFormat($hexVal,$places);
} // function BINTOHEX()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::BINTOOCT (   $x,
  $places = null 
)
static

BINTOOCT.

Return a binary value as Octal.

Parameters
string$x
Returns
string

Definition at line 1062 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\COMPATIBILITY_GNUMERIC, PHPExcel_Calculation_Functions\COMPATIBILITY_OPENOFFICE, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\getCompatibilityMode(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
$x = (int) $x;
} else {
}
}
$x = floor($x);
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[01]/',$x,$out)) {
}
if (strlen($x) > 10) {
} elseif (strlen($x) == 10) {
// Two's Complement
return str_repeat('7',7).substr(strtoupper(decoct(bindec(substr($x,-9)))),-3);
}
$octVal = (string) decoct(bindec($x));
return self::_nbrConversionFormat($octVal,$places);
} // function BINTOOCT()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::COMPLEX (   $realNumber = 0.0,
  $imaginary = 0.0,
  $suffix = 'i' 
)
static

COMPLEX.

returns a complex number of the form x + yi or x + yj.

Parameters
float$realNumber
float$imaginary
string$suffix
Returns
string

Definition at line 1350 of file Engineering.php.

References PHPExcel_Calculation_Functions\flattenSingleValue(), and PHPExcel_Calculation_Functions\VALUE().

Referenced by IMEXP(), IMLN(), IMPOWER(), IMPRODUCT(), IMSIN(), IMSQRT(), IMSUB(), and IMSUM().

{
$realNumber = (is_null($realNumber)) ? 0.0 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($realNumber);
$imaginary = (is_null($imaginary)) ? 0.0 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($imaginary);
$suffix = (is_null($suffix)) ? 'i' : PHPExcel_Calculation_Functions::flattenSingleValue($suffix);
if (((is_numeric($realNumber)) && (is_numeric($imaginary))) &&
(($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))) {
if ($suffix == '') $suffix = 'i';
if ($realNumber == 0.0) {
if ($imaginary == 0.0) {
return (string) '0';
} elseif ($imaginary == 1.0) {
return (string) $suffix;
} elseif ($imaginary == -1.0) {
return (string) '-'.$suffix;
}
return (string) $imaginary.$suffix;
} elseif ($imaginary == 0.0) {
return (string) $realNumber;
} elseif ($imaginary == 1.0) {
return (string) $realNumber.'+'.$suffix;
} elseif ($imaginary == -1.0) {
return (string) $realNumber.'-'.$suffix;
}
if ($imaginary > 0) { $imaginary = (string) '+'.$imaginary; }
return (string) $realNumber.$imaginary.$suffix;
}
} // function COMPLEX()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::CONVERTUOM (   $value,
  $fromUOM,
  $toUOM 
)
static

CONVERTUOM.

Parameters
float$value
string$fromUOM
string$toUOM
Returns
float

Definition at line 2092 of file Engineering.php.

References PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NA(), and PHPExcel_Calculation_Functions\VALUE().

{
if (!is_numeric($value)) {
}
$fromMultiplier = 1;
if (isset(self::$_conversionUnits[$fromUOM])) {
$unitGroup1 = self::$_conversionUnits[$fromUOM]['Group'];
} else {
$fromMultiplier = substr($fromUOM,0,1);
$fromUOM = substr($fromUOM,1);
if (isset(self::$_conversionMultipliers[$fromMultiplier])) {
$fromMultiplier = self::$_conversionMultipliers[$fromMultiplier]['multiplier'];
} else {
}
if ((isset(self::$_conversionUnits[$fromUOM])) && (self::$_conversionUnits[$fromUOM]['AllowPrefix'])) {
$unitGroup1 = self::$_conversionUnits[$fromUOM]['Group'];
} else {
}
}
$value *= $fromMultiplier;
$toMultiplier = 1;
if (isset(self::$_conversionUnits[$toUOM])) {
$unitGroup2 = self::$_conversionUnits[$toUOM]['Group'];
} else {
$toMultiplier = substr($toUOM,0,1);
$toUOM = substr($toUOM,1);
if (isset(self::$_conversionMultipliers[$toMultiplier])) {
$toMultiplier = self::$_conversionMultipliers[$toMultiplier]['multiplier'];
} else {
}
if ((isset(self::$_conversionUnits[$toUOM])) && (self::$_conversionUnits[$toUOM]['AllowPrefix'])) {
$unitGroup2 = self::$_conversionUnits[$toUOM]['Group'];
} else {
}
}
if ($unitGroup1 != $unitGroup2) {
}
if ($fromUOM == $toUOM) {
return 1.0;
} elseif ($unitGroup1 == 'Temperature') {
if (($fromUOM == 'F') || ($fromUOM == 'fah')) {
if (($toUOM == 'F') || ($toUOM == 'fah')) {
return 1.0;
} else {
$value = (($value - 32) / 1.8);
if (($toUOM == 'K') || ($toUOM == 'kel')) {
$value += 273.15;
}
return $value;
}
} elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) &&
(($toUOM == 'K') || ($toUOM == 'kel'))) {
return 1.0;
} elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) &&
(($toUOM == 'C') || ($toUOM == 'cel'))) {
return 1.0;
}
if (($toUOM == 'F') || ($toUOM == 'fah')) {
if (($fromUOM == 'K') || ($fromUOM == 'kel')) {
$value -= 273.15;
}
return ($value * 1.8) + 32;
}
if (($toUOM == 'C') || ($toUOM == 'cel')) {
return $value - 273.15;
}
return $value + 273.15;
}
return ($value * self::$_unitConversions[$unitGroup1][$fromUOM][$toUOM]) / $toMultiplier;
} // function CONVERTUOM()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::DECTOBIN (   $x,
  $places = null 
)
static

DECTOBIN.

Return an octal value as binary.

Parameters
string$x
Returns
string

Definition at line 1100 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\COMPATIBILITY_OPENOFFICE, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\getCompatibilityMode(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
$x = (int) $x;
} else {
}
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) {
}
$x = (string) floor($x);
$r = decbin($x);
if (strlen($r) == 32) {
// Two's Complement
$r = substr($r,-10);
} elseif (strlen($r) > 11) {
}
return self::_nbrConversionFormat($r,$places);
} // function DECTOBIN()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::DECTOHEX (   $x,
  $places = null 
)
static

DECTOHEX.

Return an octal value as binary.

Parameters
string$x
Returns
string

Definition at line 1136 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\COMPATIBILITY_OPENOFFICE, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\getCompatibilityMode(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
$x = (int) $x;
} else {
}
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) {
}
$x = (string) floor($x);
$r = strtoupper(dechex($x));
if (strlen($r) == 8) {
// Two's Complement
$r = 'FF'.$r;
}
return self::_nbrConversionFormat($r,$places);
} // function DECTOHEX()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::DECTOOCT (   $x,
  $places = null 
)
static

DECTOOCT.

Return an octal value as binary.

Parameters
string$x
Returns
string

Definition at line 1170 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\COMPATIBILITY_OPENOFFICE, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\getCompatibilityMode(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
$x = (int) $x;
} else {
}
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) {
}
$x = (string) floor($x);
$r = decoct($x);
if (strlen($r) == 11) {
// Two's Complement
$r = substr($r,-10);
}
return self::_nbrConversionFormat($r,$places);
} // function DECTOOCT()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::DELTA (   $a,
  $b = 0 
)
static

DELTA.

Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise.

Parameters
float$a
float$b
Returns
int

Definition at line 1889 of file Engineering.php.

References PHPExcel_Calculation_Functions\flattenSingleValue().

{
return (int) ($a == $b);
} // function DELTA()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::ERF (   $lower,
  $upper = null 
)
static

ERF.

Returns the error function integrated between lower_limit and upper_limit

Parameters
float$lowerlower bound for integrating ERF
float$upperupper bound for integrating ERF. If omitted, ERF integrates between zero and lower_limit
Returns
int

Definition at line 1951 of file Engineering.php.

References _erfVal(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_numeric($lower)) {
if ($lower < 0) {
}
if (is_null($upper)) {
return self::_erfVal($lower);
}
if (is_numeric($upper)) {
if ($upper < 0) {
}
return self::_erfVal($upper) - self::_erfVal($lower);
}
}
} // function ERF()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::ERFC (   $x)
static

ERFC.

Returns the complementary ERF function integrated between x and infinity

Parameters
float$xThe lower bound for integrating ERF
Returns
int

Definition at line 2013 of file Engineering.php.

References $x, _erfcVal(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

Referenced by _erfcVal().

{
if (is_numeric($x)) {
if ($x < 0) {
}
return self::_erfcVal($x);
}
} // function ERFC()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::GESTEP (   $number,
  $step = 0 
)
static

GESTEP.

Returns 1 if number = step; returns 0 (zero) otherwise

Parameters
float$number
float$step
Returns
int

Definition at line 1906 of file Engineering.php.

References PHPExcel_Calculation_Functions\flattenSingleValue().

{
return (int) ($number >= $step);
} // function GESTEP()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::getConversionGroups ( )
static

getConversionGroups

Returns
array

Definition at line 2031 of file Engineering.php.

{
$conversionGroups = array();
foreach(self::$_conversionUnits as $conversionUnit) {
$conversionGroups[] = $conversionUnit['Group'];
}
return array_merge(array_unique($conversionGroups));
} // function getConversionGroups()
static PHPExcel_Calculation_Engineering::getConversionGroupUnitDetails (   $group = NULL)
static

getConversionGroupUnitDetails

Returns
array

Definition at line 2061 of file Engineering.php.

{
$conversionGroups = array();
foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) {
if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
$conversionGroups[$conversionGroup['Group']][] = array( 'unit' => $conversionUnit,
'description' => $conversionGroup['Unit Name']
);
}
}
return $conversionGroups;
} // function getConversionGroupUnitDetails()
static PHPExcel_Calculation_Engineering::getConversionGroupUnits (   $group = NULL)
static

getConversionGroupUnits

Returns
array

Definition at line 2045 of file Engineering.php.

{
$conversionGroups = array();
foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) {
if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
$conversionGroups[$conversionGroup['Group']][] = $conversionUnit;
}
}
return $conversionGroups;
} // function getConversionGroupUnits()
static PHPExcel_Calculation_Engineering::getConversionMultipliers ( )
static

getConversionGroups

Returns
array

Definition at line 2079 of file Engineering.php.

References $_conversionMultipliers.

{
} // function getConversionGroups()
static PHPExcel_Calculation_Engineering::HEXTOBIN (   $x,
  $places = null 
)
static

HEXTOBIN.

Return a hex value as binary.

Parameters
string$x
Returns
string

Definition at line 1204 of file Engineering.php.

References $out, $x, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) {
}
$binVal = decbin(hexdec($x));
return substr(self::_nbrConversionFormat($binVal,$places),-10);
} // function HEXTOBIN()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::HEXTODEC (   $x)
static

HEXTODEC.

Return a hex value as octal.

Parameters
string$x
Returns
string

Definition at line 1229 of file Engineering.php.

References $out, $x, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) {
}
return hexdec($x);
} // function HEXTODEC()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::HEXTOOCT (   $x,
  $places = null 
)
static

HEXTOOCT.

Return a hex value as octal.

Parameters
string$x
Returns
string

Definition at line 1251 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
}
$x = (string) $x;
if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) {
}
$octVal = decoct(hexdec($x));
return self::_nbrConversionFormat($octVal,$places);
} // function HEXTOOCT()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMABS (   $complexNumber)
static

IMABS.

Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
real

Definition at line 1428 of file Engineering.php.

References _parseComplex(), and PHPExcel_Calculation_Functions\flattenSingleValue().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
return sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']));
} // function IMABS()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMAGINARY (   $complexNumber)
static

IMAGINARY.

Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
real

Definition at line 1390 of file Engineering.php.

References _parseComplex(), and PHPExcel_Calculation_Functions\flattenSingleValue().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
return $parsedComplex['imaginary'];
} // function IMAGINARY()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMARGUMENT (   $complexNumber)
static

IMARGUMENT.

Returns the argument theta of a complex number, i.e. the angle in radians from the real axis to the representation of the number in polar coordinates.

Parameters
string$complexNumber
Returns
string

Definition at line 1447 of file Engineering.php.

References _parseComplex(), and PHPExcel_Calculation_Functions\flattenSingleValue().

Referenced by IMLN(), IMPOWER(), and IMSQRT().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if ($parsedComplex['real'] == 0.0) {
if ($parsedComplex['imaginary'] == 0.0) {
return 0.0;
} elseif($parsedComplex['imaginary'] < 0.0) {
return M_PI / -2;
} else {
return M_PI / 2;
}
} elseif ($parsedComplex['real'] > 0.0) {
return atan($parsedComplex['imaginary'] / $parsedComplex['real']);
} elseif ($parsedComplex['imaginary'] < 0.0) {
return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real'])));
} else {
return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
}
} // function IMARGUMENT()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::IMCONJUGATE (   $complexNumber)
static

IMCONJUGATE.

Returns the complex conjugate of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1481 of file Engineering.php.

References _cleanComplex(), _parseComplex(), and PHPExcel_Calculation_Functions\flattenSingleValue().

Referenced by IMCOS().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if ($parsedComplex['imaginary'] == 0.0) {
return $parsedComplex['real'];
} else {
return self::_cleanComplex(self::COMPLEX($parsedComplex['real'], 0 - $parsedComplex['imaginary'], $parsedComplex['suffix']));
}
} // function IMCONJUGATE()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::IMCOS (   $complexNumber)
static

IMCOS.

Returns the cosine of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1506 of file Engineering.php.

References _parseComplex(), PHPExcel_Calculation_Functions\flattenSingleValue(), and IMCONJUGATE().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if ($parsedComplex['imaginary'] == 0.0) {
return cos($parsedComplex['real']);
} else {
return self::IMCONJUGATE(self::COMPLEX(cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix']));
}
} // function IMCOS()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMDIV (   $complexDividend,
  $complexDivisor 
)
static

IMDIV.

Returns the quotient of two complex numbers in x + yi or x + yj text format.

Parameters
string$complexDividend
string$complexDivisor
Returns
real

Definition at line 1733 of file Engineering.php.

References _cleanComplex(), _parseComplex(), PHPExcel_Calculation_Functions\flattenSingleValue(), and PHPExcel_Calculation_Functions\NaN().

{
$complexDividend = PHPExcel_Calculation_Functions::flattenSingleValue($complexDividend);
$complexDivisor = PHPExcel_Calculation_Functions::flattenSingleValue($complexDivisor);
$parsedComplexDividend = self::_parseComplex($complexDividend);
if (!is_array($parsedComplexDividend)) {
return $parsedComplexDividend;
}
$parsedComplexDivisor = self::_parseComplex($complexDivisor);
if (!is_array($parsedComplexDivisor)) {
return $parsedComplexDividend;
}
if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') &&
($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])) {
}
if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) {
$parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix'];
}
$d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']);
$d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']);
$d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']);
$r = $d1/$d3;
$i = $d2/$d3;
if ($i > 0.0) {
return self::_cleanComplex($r.'+'.$i.$parsedComplexDivisor['suffix']);
} elseif ($i < 0.0) {
return self::_cleanComplex($r.$i.$parsedComplexDivisor['suffix']);
} else {
return $r;
}
} // function IMDIV()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMEXP (   $complexNumber)
static

IMEXP.

Returns the exponential of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1666 of file Engineering.php.

References _parseComplex(), COMPLEX(), and PHPExcel_Calculation_Functions\flattenSingleValue().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
return '1';
}
$e = exp($parsedComplex['real']);
$eX = $e * cos($parsedComplex['imaginary']);
$eY = $e * sin($parsedComplex['imaginary']);
if ($parsedComplex['suffix'] == '') {
return self::COMPLEX($eX,$eY);
} else {
return self::COMPLEX($eX,$eY,$parsedComplex['suffix']);
}
} // function IMEXP()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMLN (   $complexNumber)
static

IMLN.

Returns the natural logarithm of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1583 of file Engineering.php.

References $t, _parseComplex(), COMPLEX(), PHPExcel_Calculation_Functions\flattenSingleValue(), IMARGUMENT(), and PHPExcel_Calculation_Functions\NaN().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
}
$logR = log(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])));
$t = self::IMARGUMENT($complexNumber);
if ($parsedComplex['suffix'] == '') {
return self::COMPLEX($logR,$t);
} else {
return self::COMPLEX($logR,$t,$parsedComplex['suffix']);
}
} // function IMLN()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMLOG10 (   $complexNumber)
static

IMLOG10.

Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1614 of file Engineering.php.

References _parseComplex(), EULER, PHPExcel_Calculation_Functions\flattenSingleValue(), IMPRODUCT(), and PHPExcel_Calculation_Functions\NaN().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
} elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
return log10($parsedComplex['real']);
}
return self::IMPRODUCT(log10(EULER),self::IMLN($complexNumber));
} // function IMLOG10()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMLOG2 (   $complexNumber)
static

IMLOG2.

Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1640 of file Engineering.php.

References _parseComplex(), EULER, PHPExcel_Calculation_Functions\flattenSingleValue(), IMPRODUCT(), and PHPExcel_Calculation_Functions\NaN().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
} elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
return log($parsedComplex['real'],2);
}
return self::IMPRODUCT(log(EULER,2),self::IMLN($complexNumber));
} // function IMLOG2()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMPOWER (   $complexNumber,
  $realNumber 
)
static

IMPOWER.

Returns a complex number in x + yi or x + yj text format raised to a power.

Parameters
string$complexNumber
Returns
string

Definition at line 1698 of file Engineering.php.

References _parseComplex(), COMPLEX(), PHPExcel_Calculation_Functions\flattenSingleValue(), IMARGUMENT(), and PHPExcel_Calculation_Functions\VALUE().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
if (!is_numeric($realNumber)) {
}
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
$r = sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']));
$rPower = pow($r,$realNumber);
$theta = self::IMARGUMENT($complexNumber) * $realNumber;
if ($theta == 0) {
return 1;
} elseif ($parsedComplex['imaginary'] == 0.0) {
return self::COMPLEX($rPower * cos($theta),$rPower * sin($theta),$parsedComplex['suffix']);
} else {
return self::COMPLEX($rPower * cos($theta),$rPower * sin($theta),$parsedComplex['suffix']);
}
} // function IMPOWER()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMPRODUCT ( )
static

IMPRODUCT.

Returns the product of two or more complex numbers in x + yi or x + yj text format.

Parameters
arrayof mixed Data Series
Returns
real

Definition at line 1853 of file Engineering.php.

References $arg, _parseComplex(), COMPLEX(), PHPExcel_Calculation_Functions\flattenArray(), and PHPExcel_Calculation_Functions\NaN().

Referenced by IMLOG10(), and IMLOG2().

{
// Return value
$returnValue = self::_parseComplex('1');
$activeSuffix = '';
// Loop through the arguments
foreach ($aArgs as $arg) {
$parsedComplex = self::_parseComplex($arg);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
$workValue = $returnValue;
if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) {
$activeSuffix = $parsedComplex['suffix'];
} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
}
$returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']);
$returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']);
}
if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
} // function IMPRODUCT()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static PHPExcel_Calculation_Engineering::IMREAL (   $complexNumber)
static

IMREAL.

Returns the real coefficient of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
real

Definition at line 1409 of file Engineering.php.

References _parseComplex(), and PHPExcel_Calculation_Functions\flattenSingleValue().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
return $parsedComplex['real'];
} // function IMREAL()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMSIN (   $complexNumber)
static

IMSIN.

Returns the sine of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1530 of file Engineering.php.

References _parseComplex(), COMPLEX(), and PHPExcel_Calculation_Functions\flattenSingleValue().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if ($parsedComplex['imaginary'] == 0.0) {
return sin($parsedComplex['real']);
} else {
return self::COMPLEX(sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix']);
}
} // function IMSIN()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMSQRT (   $complexNumber)
static

IMSQRT.

Returns the square root of a complex number in x + yi or x + yj text format.

Parameters
string$complexNumber
Returns
string

Definition at line 1554 of file Engineering.php.

References _parseComplex(), COMPLEX(), PHPExcel_Calculation_Functions\flattenSingleValue(), and IMARGUMENT().

{
$complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
$parsedComplex = self::_parseComplex($complexNumber);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
$theta = self::IMARGUMENT($complexNumber);
$d1 = cos($theta / 2);
$d2 = sin($theta / 2);
$r = sqrt(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])));
if ($parsedComplex['suffix'] == '') {
return self::COMPLEX($d1 * $r,$d2 * $r);
} else {
return self::COMPLEX($d1 * $r,$d2 * $r,$parsedComplex['suffix']);
}
} // function IMSQRT()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMSUB (   $complexNumber1,
  $complexNumber2 
)
static

IMSUB.

Returns the difference of two complex numbers in x + yi or x + yj text format.

Parameters
string$complexNumber1
string$complexNumber2
Returns
real

Definition at line 1781 of file Engineering.php.

References _parseComplex(), COMPLEX(), PHPExcel_Calculation_Functions\flattenSingleValue(), and PHPExcel_Calculation_Functions\NaN().

{
$complexNumber1 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber1);
$complexNumber2 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber2);
$parsedComplex1 = self::_parseComplex($complexNumber1);
if (!is_array($parsedComplex1)) {
return $parsedComplex1;
}
$parsedComplex2 = self::_parseComplex($complexNumber2);
if (!is_array($parsedComplex2)) {
return $parsedComplex2;
}
if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) &&
($parsedComplex1['suffix'] != $parsedComplex2['suffix'])) {
} elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) {
$parsedComplex1['suffix'] = $parsedComplex2['suffix'];
}
$d1 = $parsedComplex1['real'] - $parsedComplex2['real'];
$d2 = $parsedComplex1['imaginary'] - $parsedComplex2['imaginary'];
return self::COMPLEX($d1,$d2,$parsedComplex1['suffix']);
} // function IMSUB()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::IMSUM ( )
static

IMSUM.

Returns the sum of two or more complex numbers in x + yi or x + yj text format.

Parameters
arrayof mixed Data Series
Returns
real

Definition at line 1817 of file Engineering.php.

References $arg, _parseComplex(), COMPLEX(), PHPExcel_Calculation_Functions\flattenArray(), and PHPExcel_Calculation_Functions\VALUE().

{
// Return value
$returnValue = self::_parseComplex('0');
$activeSuffix = '';
// Loop through the arguments
foreach ($aArgs as $arg) {
$parsedComplex = self::_parseComplex($arg);
if (!is_array($parsedComplex)) {
return $parsedComplex;
}
if ($activeSuffix == '') {
$activeSuffix = $parsedComplex['suffix'];
} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
}
$returnValue['real'] += $parsedComplex['real'];
$returnValue['imaginary'] += $parsedComplex['imaginary'];
}
if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
} // function IMSUM()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::OCTTOBIN (   $x,
  $places = null 
)
static

OCTTOBIN.

Return an octal value as binary.

Parameters
string$x
Returns
string

Definition at line 1276 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
}
$x = (string) $x;
if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) {
}
$r = decbin(octdec($x));
return self::_nbrConversionFormat($r,$places);
} // function OCTTOBIN()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::OCTTODEC (   $x)
static

OCTTODEC.

Return an octal value as binary.

Parameters
string$x
Returns
string

Definition at line 1301 of file Engineering.php.

References $out, $x, PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
}
$x = (string) $x;
if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) {
}
return octdec($x);
} // function OCTTODEC()

+ Here is the call graph for this function:

static PHPExcel_Calculation_Engineering::OCTTOHEX (   $x,
  $places = null 
)
static

OCTTOHEX.

Return an octal value as hex.

Parameters
string$x
Returns
string

Definition at line 1323 of file Engineering.php.

References $out, $x, _nbrConversionFormat(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\NaN(), and PHPExcel_Calculation_Functions\VALUE().

{
if (is_bool($x)) {
}
$x = (string) $x;
if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) {
}
$hexVal = strtoupper(dechex(octdec($x)));
return self::_nbrConversionFormat($hexVal,$places);
} // function OCTTOHEX()

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Calculation_Engineering::$_conversionMultipliers
staticprivate
Initial value:
array( 'Y' => array( 'multiplier' => 1E24, 'name' => 'yotta' ),
'Z' => array( 'multiplier' => 1E21, 'name' => 'zetta' ),
'E' => array( 'multiplier' => 1E18, 'name' => 'exa' ),
'P' => array( 'multiplier' => 1E15, 'name' => 'peta' ),
'T' => array( 'multiplier' => 1E12, 'name' => 'tera' ),
'G' => array( 'multiplier' => 1E9, 'name' => 'giga' ),
'M' => array( 'multiplier' => 1E6, 'name' => 'mega' ),
'k' => array( 'multiplier' => 1E3, 'name' => 'kilo' ),
'h' => array( 'multiplier' => 1E2, 'name' => 'hecto' ),
'e' => array( 'multiplier' => 1E1, 'name' => 'deka' ),
'd' => array( 'multiplier' => 1E-1, 'name' => 'deci' ),
'c' => array( 'multiplier' => 1E-2, 'name' => 'centi' ),
'm' => array( 'multiplier' => 1E-3, 'name' => 'milli' ),
'u' => array( 'multiplier' => 1E-6, 'name' => 'micro' ),
'n' => array( 'multiplier' => 1E-9, 'name' => 'nano' ),
'p' => array( 'multiplier' => 1E-12, 'name' => 'pico' ),
'f' => array( 'multiplier' => 1E-15, 'name' => 'femto' ),
'a' => array( 'multiplier' => 1E-18, 'name' => 'atto' ),
'z' => array( 'multiplier' => 1E-21, 'name' => 'zepto' ),
'y' => array( 'multiplier' => 1E-24, 'name' => 'yocto' )
)

Definition at line 117 of file Engineering.php.

Referenced by getConversionMultipliers().

PHPExcel_Calculation_Engineering::$_conversionUnits
staticprivate

Definition at line 52 of file Engineering.php.

PHPExcel_Calculation_Engineering::$_one_sqrtpi = 0.564189583547756287
staticprivate

Definition at line 1976 of file Engineering.php.

PHPExcel_Calculation_Engineering::$_two_sqrtpi = 1.128379167095512574
staticprivate

Definition at line 1917 of file Engineering.php.

PHPExcel_Calculation_Engineering::$_unitConversions
staticprivate

Definition at line 139 of file Engineering.php.


The documentation for this class was generated from the following file: