Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Implemented functions are:
log2
log10
log1p
cis
cispi
sin
cos
tan
Expand Down
35 changes: 0 additions & 35 deletions src/Quaternion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,41 +154,6 @@ end
_isexpfun(::Union{typeof(exp),typeof(exp2),typeof(exp10)}) = true
_isexpfun(::Any) = false

"""
cis(q::Quaternion)

Return ``\\exp(u * q)``, where ``u`` is the normalized imaginary part of `q`.

Let ``q = s + a u``, where ``s`` is the real part, ``u`` is a pure unit quaternion,
and ``a \\ge 0`` is the magnitude of the imaginary part of ``q``.

!!! Note
This is the extension of `cis(z)` for complex `z` to the quaternions and is not
equivalent to `exp(im * q)`. As a result, `cis(Quaternion(z)) ≠ cis(z)` when
`imag(z) < 0`.
"""
cis(q::Quaternion)

if VERSION ≥ v"1.6"
"""
cispi(q::Quaternion)

Compute `cis(π * q)` more accurately.

!!! Note
This is not equivalent to `exp(π*im*q)`. See [cis(::Quaternion)](@ref) for details.
"""
function Base.cispi(q::Quaternion)
Base.depwarn("`cispi(::Quaternion)` is deprecated and will be removed in the next breaking release. See https://github.com/JuliaGeometry/Quaternions.jl/pull/76 for more information.", :cispi)
extend_analytic(cispi, q)
end
end

function Base.cis(q::Quaternion)
Base.depwarn("`cis(::Quaternion)` is deprecated and will be removed in the next breaking release. See https://github.com/JuliaGeometry/Quaternions.jl/pull/76 for more information.", :cis)
extend_analytic(cis, q)
end

for f in (
:sqrt, :exp, :exp2, :exp10, :expm1, :log2, :log10, :log1p,
:sin, :cos, :tan, :asin, :acos, :atan, :sinh, :cosh, :tanh, :asinh, :acosh, :atanh,
Expand Down
6 changes: 2 additions & 4 deletions test/Quaternion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Base.:(/)(a::MyReal, b::Real) = a.val / b
# all complex analytic functions can be extended to the quaternions
#! format: off
unary_funs = [
sqrt, inv, exp, exp2, exp10, expm1, log, log2, log10, log1p, cis,
sqrt, inv, exp, exp2, exp10, expm1, log, log2, log10, log1p,
sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh,
csc, sec, cot, acsc, asec, acot, csch, sech, coth, acsch, asech, acoth,
sinpi, cospi,
Expand All @@ -364,7 +364,7 @@ Base.:(/)(a::MyReal, b::Real) = a.val / b
for _ in 1:100
c = randn(ComplexF64)
q = quat(c)
fun !== cis && @test @inferred(fun(q)) ≈ fun(c)
@test @inferred(fun(q)) ≈ fun(c)
@test q2 * fun(q) * inv(q2) ≈ fun(q2 * q * inv(q2))
end
end
Expand Down Expand Up @@ -410,8 +410,6 @@ Base.:(/)(a::MyReal, b::Real) = a.val / b
]
@test f(q) ≈ finv(inv(q))
end
@test @test_deprecated(cis(q)) ≈ exp(normalize(q - real(q)) * q)
VERSION ≥ v"1.6" && @test @test_deprecated(cispi(q)) ≈ cis(π * q)
end
end

Expand Down