sincosd

Compute the sine and cosine of x expressed in degrees.

Base.Math.sincosdFunction
sincosd(x::T) where T -> Tuple{float(T),float(T)}

Simultaneously compute the sine and cosine of x, where x is in degrees, returning a tuple (sine, cosine).

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

Julia 1.3

This function requires at least Julia 1.3.

source

Methods

julia> methods(sincosd, (Any,), [Base, Base.Math, Base.MathConstants, Base.MPFR])# 2 methods for generic function "sincosd" from Base.Math:
 [1] sincosd(::Missing)
     @ special/trig.jl:1283
 [2] sincosd(x)
     @ special/trig.jl:1279

Examples

Real Numbers

julia> sincosd(0)
(0.0, 1.0)

julia> sincosd(-0.0)
(-0.0, 1.0)

julia> sincosd(45)
(0.7071067811865476, 0.7071067811865476)

julia> sincosd(90)
(1.0, 0.0)

julia> sincosd(180)
(0.0, -1.0)

Complex

julia> sincosd(0+0im)
(0.0 + 0.0im, 1.0 - 0.0im)

Tips

See Also

Extended Inputs

Tech Notes

  • sincosd(::Real): by pure julia
  • sincosd(::BigFloat): by MPFR

Version History

Introduced in Julia v1.3 (2019)