Message Boards Message Boards

[✓] Convert Radian to Degree?

GROUPS:

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
Answer
6 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} *)
POSTED BY: Mike Luntz
Answer
6 months ago

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
Answer
6 months ago

That works. Thanks a lot.

POSTED BY: Thong Ly
Answer
6 months ago

Group Abstract Group Abstract