![]() ![]() |
Dmitry Samersoff |
![]() |
Hello Everybody,
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? Does cosd() accept some notation that is similar to one above? Thank you! -Dmitry _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
![]() ![]() |
Dang Ngoc Chan, Christophe |
![]() |
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 [hidden email] http://lists.scilab.org/mailman/listinfo/users |
![]() ![]() |
Dmitry Samersoff |
![]() |
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 > [hidden email] > http://lists.scilab.org/mailman/listinfo/users > _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
![]() |
In reply to this post by Dmitry Samersoff
Hello,
The best way would be to use msscanf: --> [x]=msscanf("44d32m11s","%dd%dm%ds") x = 44. 32. 11. S. Le 16/03/2021 à 19:59, Dmitry Samersoff a écrit : > Hello Everybody, > > 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? > > Does cosd() accept some notation that is similar to one above? > > Thank you! > -Dmitry > _______________________________________________ > users mailing list > [hidden email] > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > -- Stéphane Mottelet Ingénieur de recherche EA 4297 Transformations Intégrées de la Matière Renouvelable Département Génie des Procédés Industriels Sorbonne Universités - Université de Technologie de Compiègne CS 60319, 60203 Compiègne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Free forum by Nabble | Edit this page |