cotd

Compute the cotangent of x expressed in degrees.

Base.Math.cotdFunction
cotd(x::T) where {T <: Number} -> float(T)

Compute the cotangent of x, where x is in degrees.

Throw a DomainError if isinf(x), return a T(NaN) if isnan(x).

source

Methods

julia> methods(cotd, (Any,), [Base, Base.Math, Base.MathConstants, Base.MPFR])# 1 method for generic function "cotd" from Base.Math:
 [1] cotd(z::Number)
     @ special/trig.jl:1167

Examples

Real Numbers

julia> cotd(0)
Inf

julia> cotd(-0.0)
-Inf

julia> cotd(90)
0.0

julia> cotd(45)
1.0

julia> cotd(90)
0.0

julia> cotd(180)
-Inf

Complex

julia> cotd(0+0im)
NaN + NaN*im

Tips

See Also

Extended Inputs

Tech Notes

  • Implemented in terms of tand: cotd(x) = inv(tand(x))

Version History

Introduced in Julia v1.0 (2018)