Message Boards Message Boards

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

Convert Radian to Degree?

Posted 7 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 7 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

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

That works. Thanks a lot.

POSTED BY: Thong Ly
Posted 2 years ago

UnitConvert can do this.

In[1]:= UnitConvert[Quantity[\[Pi],"Radians"],"AngularDegrees"]
Out[1]= 180°
POSTED BY: C C
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