Hints, tips and tricks for newbies
Moderators: JRL, Dorian (MJT support)
-
nodochau
- Pro Scripter
- Posts: 135
- Joined: Wed Jan 16, 2019 12:59 pm
Post
by nodochau » Wed Jan 22, 2020 6:46 pm
Hello All,
What wrong with this function:
Let>ans={cos(340)}
And it returns me ans=0.759668310007225.
My calculator returns me 0.93969207859...

??
Please help
-
hagchr
- Automation Wizard
- Posts: 331
- Joined: Mon Jul 05, 2010 7:53 am
- Location: Stockholm, Sweden
Post
by hagchr » Wed Jan 22, 2020 8:40 pm
Hi, According to the manual, the COS function requires the angle to be entered in radians, not degrees, see conversion below:
Code: Select all
Let>val_in_degrees=340
Let>val_in_radians={%val_in_degrees%/360*2*Pi}
Let>result={cos(%val_in_radians%)}
MDL>result
-
nodochau
- Pro Scripter
- Posts: 135
- Joined: Wed Jan 16, 2019 12:59 pm
Post
by nodochau » Thu Jan 23, 2020 11:31 am
Yes, You are right.
Thanks a lot. I haven't read the instruction well enough
