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

Dmitry Samersoff dms at samersoff.net
Mon Mar 22 14:42:25 CET 2021


Hello Christophe,

Thank you for your support.

tokens + arithmetic conversion did what I was needed.

It would be nice to have the support for such notation in a future and 
avoid extra steps - this kind of data is rather common for many areas of 
knowledge.

-Dmitry

On 22/03/2021 11:16, Dang Ngoc Chan, Christophe wrote:
> 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.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 




More information about the users mailing list