cosd
Compute the cosine of x
expressed in degrees.
Base.Math.cosd
— Functioncosd(x)
Compute cosine of x
, where x
is in degrees. If x
is a matrix, x
needs to be a square matrix.
Methods
julia> methods(cosd, (Any,), [Base, Base.Math, Base.MathConstants, Base.MPFR])
# 3 methods for generic function "cosd" from Base.Math: [1] cosd(x::BigFloat) @ Base.MPFR mpfr.jl:880 [2] cosd(x::Real) @ special/trig.jl:1214 [3] cosd(x) @ special/trig.jl:1268
Examples
Real Numbers
julia> cosd(0)
1.0
julia> cosd(-0.0)
1.0
julia> cosd(60)
0.5
julia> cosd(90)
0.0
julia> cosd(180)
-1.0
Complex
julia> cosd(0+0im)
1.0 - 0.0im
Tips
See Also
Extended Inputs
Tech Notes
- Implemented in terms of
cos
:cosd(deg) = cos(deg2rad(deg))
Version History
Introduced in Julia v1.0 (2018)