Thu Jan 27, 2022 4:42 am
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?
Posts: 8
Joined: Mon Oct 07, 2019 5:57 pm

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


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.


Community Advisory Board Member
Community Advisory Board Member
Posts: 1612
Joined: Wed Oct 26, 2011 7:40 pm

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


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)
Posts: 8
Joined: Mon Oct 07, 2019 5:57 pm

Return to ECL

Who is online

Users browsing this forum: Google [Bot] and 1 guest