cis
Compute exp(im*x), where im is the imaginary unit, return in radians.
Methods
julia> methods(cis, (Any,), [Base, Base.Math, Base.MathConstants, Base.MPFR])# 2 methods for generic function "cis" from Base: [1] cis(z::Complex) @ complex.jl:589 [2] cis(theta::Real) @ complex.jl:584
Examples
Real Numbers
julia> cis(0)
1.0 + 0.0im
julia> cis(-0.0)
1.0 - 0.0im
julia> cis(pi)
-1.0 + 0.0imComplex
julia> cis(0+0im)
1.0 + 0.0imTips
See Also
Extended Inputs
Matrix
With Array like input:
julia> methods(cis, (Any,), [LinearAlgebra])# 6 methods for generic function "cis" from Base: [1] cis(J::UniformScaling) @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/uniformscaling.jl:176 [2] cis(A::Hermitian{var"#s4811", S} where {var"#s4811"<:Complex, S<:(AbstractMatrix{<:var"#s4811"})}) @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetric.jl:913 [3] cis(A::Union{Hermitian{T, S} where S, SymTridiagonal{T, V} where V<:AbstractVector{T}, Symmetric{T, S} where S} where T<:Real) @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetric.jl:909 [4] cis(D::Diagonal) @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/diagonal.jl:879 [5] cis(A::AbstractMatrix{<:Union{Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, Complex{<:Union{Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8}}, Rational{<:Union{Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8}}}}) @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/dense.jl:693 [6] cis(A::AbstractMatrix) @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/dense.jl:692
Tech Notes
cis(::Real): by pure juliacis(::BigFloat): by MPFR
Version History
Introduced in Julia v1.0 (2018)