Tue Jul 07, 2020 11:45 pm
Login Register Lost Password? Contact Us


Convert degrees to radian

Comments and questions related to the Enterprise Control Language

Tue Jun 16, 2020 3:33 pm Change Time Zone

Is there an hpcc utility that converts degrees to radians?
jtaylor178
 
Posts: 8
Joined: Mon Oct 07, 2019 5:57 pm

Tue Jun 16, 2020 3:44 pm Change Time Zone

jtaylor178,

Strangely enough, a colleague and I were discusing exactly that question two weeks ago, so here's the code I wrote for that:
Code: Select all
Pi := 3.141592653589793;
Deg2Rad(REAL deg) := deg * (Pi/180); //degrees * number of radians in a degree
BTW, this Pi is exactly the same value as returned by the Python Math.Pi function.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1545
Joined: Wed Oct 26, 2011 7:40 pm

Tue Jun 16, 2020 4:21 pm Change Time Zone

thanks.

I started with DMS format instead of DD in your example.

So for my case I would convert DMS format 172109S to DD format -17.3525 and then
multiple it by (3.14159265359/180)
jtaylor178
 
Posts: 8
Joined: Mon Oct 07, 2019 5:57 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest