You are here

public static function PHPExcel_Calculation_Engineering::IMSIN in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php \PHPExcel_Calculation_Engineering::IMSIN()

* IMSIN * * Returns the sine of a complex number in x + yi or x + yj text format. * * Excel Function: * IMSIN(complexNumber) * *

Parameters

string $complexNumber The complex number for which you want the sine.: * @return string|float

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php, line 1836

Class

PHPExcel_Calculation_Engineering
PHPExcel_Calculation_Engineering

Code

public static function IMSIN($complexNumber) {
  $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
  $parsedComplex = self::_parseComplex($complexNumber);
  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']);
  }
}