[Scilab-users] How to specify angle in degree and minutes

Dang Ngoc Chan, Christophe Christophe.Dang at sidel.com
Mon Mar 22 09:16:15 CET 2021


Hello,

> De : Dmitry Samersoff
> Envoyé : mardi 16 mars 2021 19:59
>
> I need to calculate cosine of bunch of angles
> that comes as Degree Minutes Seconds (e.g. 44d32m11s).
>
> What is the best way to do it in scilab?

If you have a vector of numbers angle = [dd, mm, ss], it is rather easy to convert it into a decimal number, e.g.

angle(1) + (angle(2) + angle(3)/60)/60

If you have a character string, this means parsing.
Have a look at tokens()

https://help.scilab.org/docs/6.1.0/en_US/tokens.html

e.g.

--> tokens("44d32m11s", ["d", "m", "s"])
 ans  =

  "44"
  "32"
  "11"

> Does cosd() accept some notation that is similar to one above?

No, https://help.scilab.org/docs/6.1.0/en_US/cosd.html

HTH,

Regards


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



More information about the users mailing list