@@ 1924-1941 (lines=18) @@ | ||
1921 | * @param string $complexNumber The complex number for which you want the cosine. |
|
1922 | * @return string|float |
|
1923 | */ |
|
1924 | public static function IMCOS($complexNumber) |
|
1925 | { |
|
1926 | $complexNumber = Functions::flattenSingleValue($complexNumber); |
|
1927 | ||
1928 | $parsedComplex = self::parseComplex($complexNumber); |
|
1929 | ||
1930 | if ($parsedComplex['imaginary'] == 0.0) { |
|
1931 | return cos($parsedComplex['real']); |
|
1932 | } else { |
|
1933 | return self::IMCONJUGATE( |
|
1934 | self::COMPLEX( |
|
1935 | cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']), |
|
1936 | sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']), |
|
1937 | $parsedComplex['suffix'] |
|
1938 | ) |
|
1939 | ); |
|
1940 | } |
|
1941 | } |
|
1942 | ||
1943 | /** |
|
1944 | * IMSIN |
|
@@ 1954-1969 (lines=16) @@ | ||
1951 | * @param string $complexNumber The complex number for which you want the sine. |
|
1952 | * @return string|float |
|
1953 | */ |
|
1954 | public static function IMSIN($complexNumber) |
|
1955 | { |
|
1956 | $complexNumber = Functions::flattenSingleValue($complexNumber); |
|
1957 | ||
1958 | $parsedComplex = self::parseComplex($complexNumber); |
|
1959 | ||
1960 | if ($parsedComplex['imaginary'] == 0.0) { |
|
1961 | return sin($parsedComplex['real']); |
|
1962 | } else { |
|
1963 | return self::COMPLEX( |
|
1964 | sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']), |
|
1965 | cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']), |
|
1966 | $parsedComplex['suffix'] |
|
1967 | ); |
|
1968 | } |
|
1969 | } |
|
1970 | ||
1971 | /** |
|
1972 | * IMSQRT |