Message Boards Message Boards

GROUPS:

[✓] Convert Radian to Degree?

Posted 10 months ago
1132 Views
|
3 Replies
|
0 Total Likes
|

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

3 Replies
Posted 10 months 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} *)

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}

That works. Thanks a lot.

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