@@ 1823-1833 (lines=11) @@ | ||
1820 | * @param string $complexNumber The complex number for which you want the cosine. |
|
1821 | * @return string|float |
|
1822 | */ |
|
1823 | public static function IMCOS($complexNumber) { |
|
1824 | $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); |
|
1825 | ||
1826 | $parsedComplex = self::_parseComplex($complexNumber); |
|
1827 | ||
1828 | if ($parsedComplex['imaginary'] == 0.0) { |
|
1829 | return cos($parsedComplex['real']); |
|
1830 | } else { |
|
1831 | return self::IMCONJUGATE(self::COMPLEX(cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix'])); |
|
1832 | } |
|
1833 | } // function IMCOS() |
|
1834 | ||
1835 | ||
1836 | /** |
|
@@ 1847-1857 (lines=11) @@ | ||
1844 | * @param string $complexNumber The complex number for which you want the sine. |
|
1845 | * @return string|float |
|
1846 | */ |
|
1847 | public static function IMSIN($complexNumber) { |
|
1848 | $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); |
|
1849 | ||
1850 | $parsedComplex = self::_parseComplex($complexNumber); |
|
1851 | ||
1852 | if ($parsedComplex['imaginary'] == 0.0) { |
|
1853 | return sin($parsedComplex['real']); |
|
1854 | } else { |
|
1855 | return self::COMPLEX(sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix']); |
|
1856 | } |
|
1857 | } // function IMSIN() |
|
1858 | ||
1859 | ||
1860 | /** |