Message Boards Message Boards

0
|
14931 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Convert Radian to Degree?

Posted 6 years ago

Hi all,

I have a list of Rad angles {-1.69347, 1.70849, 0.181325, -1.69539, 1.73843, 0.357308, etc} and I want to convert it to 0 360 Degree. Can anyone help? If I just {-1.69347, 1.70849, 0.181325, -1.69539, 1.73843, 0.357308} / Degree, it will become {-97.029, 97.8892, 10.3892, -97.1386, 99.6046, 20.4723}. I want to add only those negative angles in the list by 360 Degree.

Thanks

POSTED BY: Thong Ly
4 Replies
Posted 1 year ago

UnitConvert can do this.

In[1]:= UnitConvert[Quantity[\[Pi],"Radians"],"AngularDegrees"]
Out[1]= 180°
POSTED BY: C C

That works. Thanks a lot.

POSTED BY: Thong Ly

What about

In[4]:= Mod[{-1.69347, 1.70849, 0.181325, -1.69539, 1.73843, 0.357308}/Degree, 360]
Out[4]= {262.971, 97.8893, 10.3892, 262.861, 99.6047, 20.4722}
POSTED BY: Dent de Lion
Posted 6 years ago

How about

rad = {-1.69347, 1.70849, 0.181325, -1.69539, 1.73843, 0.357308}
deg = Mod[#/Degree + 360, 360] & /@ rad
(* {262.971, 97.8893, 10.3892, 262.861, 99.6047, 20.4722} *)
POSTED BY: Mike Luntz
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract