what is the difference between cos(8) and cosd(8)

I write an equation related to using cosine, sine, tangent but everytime I run mathlab show me a negative result but when I use calculator it is a positive and giving me correct number. so after a little bit digging and I find that it has something to do with cos, sin, tan, cosd, sind, tand what the difference having d or withouth d?
cos(8)
cosd(8)
sin(20)
sind(20)
tan(30)
tand(30)

 Respuesta aceptada

Voss
Voss el 22 de Feb. de 2022
Editada: Voss el 22 de Feb. de 2022
With the d, the input angle is interpreted as being in degrees. Without the d, it's in radians.
Example, these two commands will produce the same output:
cos(pi/4) % pi/4 radians = 45 degrees
ans = 0.7071
cosd(45)
ans = 0.7071

2 comentarios

Stark Volt
Stark Volt el 22 de Feb. de 2022
Thank you, that's help
Thanks

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Etiquetas

Preguntada:

el 22 de Feb. de 2022

Comentada:

el 21 de Feb. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by