Trigonometry - sin and cos inaccuracies

trig
sin_and_cos

#1

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.


#2

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.


#3

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.


#4

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


#5

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


#6

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


#7

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


#8

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


#9

k


#10

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


#11

I'm bored


#12

K


#13

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


#14

No, I just sew do for really old posts


#15

Oh. Ok. Cool. ◬


#16

K


#17

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


#18

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:
https://www.uwgb.edu/dutchs/structge/sl01.htm


#19

Here's a like! :heart:


#20

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