Explanation of the code

Hi,
what is the difference between cos and cosd in matlab
If alpha is angle A of the triangle. What does the following commands will do?
l=sind(alpha)*b;
d=cosd(alpha)*b;
Can anyone help me in understanding the code
Thanks in advance

Respuestas (1)

John Doe
John Doe el 12 de Mayo de 2013
Editada: John Doe el 12 de Mayo de 2013

1 voto

The input to cosd and sind are in degrees, whereas it is in radians for cos and sin.
l = sind(alpha)*b; % the vertical leg
d = cosd(alpha)*b; % the horizontal leg
Given that b is the length of the hypotenuse, and that it is a right-angled triangle.
Hope it helped!
- Rob

Categorías

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

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

Jim
el 12 de Mayo de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by