cancel
Showing results for 
Search instead for 
Did you mean: 

Cartesian 2 Polar

Super User
494 Views
Highlighted
Super User
Super User

Cartesian 2 Polar

These two measures convert Cartesian coordinates to polar coordinates. Both take two parameters, x and y, which are Cartesian coordinates.

 

r = SQRT(POWER(MAX([x]),2)+POWER(MAX([y]),2))

 

theta =
SWITCH(TRUE(),
            MAX([x])>0, ATAN(MAX([y])/MAX([x])),
            MAX([x])<0 && MAX([y])>=0, ATAN(MAX([y])/MAX([x]))+PI(),
            MAX([x])<0 && MAX([y])<0, ATAN(MAX([y])/MAX([x]))-PI(),
            MAX([x])=0 && MAX([y])>0,PI()/2,
            MAX([x])=0 && MAX([y])<0,-1*PI()/2,
            BLANK()
)

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!