Trigonometry - sin and cos inaccuracies



I was playing around with sin and cos but I noticed some of the values weren't accurate, in particular some of the main values.

Workaround: With the new update, just put everything in the "round" maths operator and it will make it zero for you. Not that it makes a difference because this is such a small problem anyway :slight_smile:

Here are some pics-

sin 180
sin 180 should be 0 and although this is very close, it's not quite 0.

sin 360
sin 360 should be 0 also and the result looks like it has something to do with sin 180 being multiplied by -2.

When I look at all these actually, all these values I've picked up are meant to be 0.

cos 90
Again cos 90 should be 0 though this is very close:

cos 270
cos 270 should be 0 also.

It's not a huge issue like I said, you can just use the "round" operator if you want it to be exactly zero.

Please let me know if I'd made any mistakes too.


I don'tunderstand sine and cosine too much I havent been taught it yet (Year 5) but you should tell the hopscotch team about this. Apparently sine and cosine is about the sides of a triangle.


Yep it is about the sides of a triangle :smiley:

I know the Hopscotch Team are working on other cool features for us and they're probably quite busy with those so I'll just deal with this for now since it's not huge. Just thought I might post it so that others are aware.


That's really interesting how you put it in a Set Text block to see what it is equal to! :smiley:


This post was flagged by the community and is temporarily hidden.


I thought it was a circle, not a triangle..? 🤔


Yeah it's about a right triangle in a circle @Rawrbear.


Ohhhh... Yeah! :sweat_smile::sweat_smile::sweat_smile: (20)




You again? Why are you always writing "k"?


I'm bored




I think you get points for every topic you reply to.


No, I just sew do for really old posts


Oh. Ok. Cool. ◬




This post was flagged by the community and is temporarily hidden.


I think this is happening because it's "sin 180" is expressed in radians, which are a more accurate dimension for trigonometry, since degrees are an arbitrary way to divide a pie.

: )

Just type "sin 180" in Google.

Here's an article:


Here's a like! :heart:


Wow, Hopscotch looked a lot different back then. Helpful topic though! :grinning: