A Sine and Cosine Tutorial

I know many of you are like :scream: when you see the Sin and Cos blocks. But using them is not that complicated! Here’s a tutorial for anyone struggling with Sine and Cosine:


1. Pull out a Blank Text Object


2. Pull out an Emoji
Next you will need to pull out an emoji or some other text object. Today I’m going to use the basketball emoji.


3. Add a Set Pos Block
Create a new rule for the basketball emoji and pull out a Set Position block.


4. Place the Cos Block
Now Place the Cos block inside the X slot on the Set Position block.


5. The Three Slots
I will now explain what the three slots on the sin/cos blocks mean and how to use them.
For the first slot you will want to type in a number. This number will determine how far your object is from the object it is rotating around.
In the second slot you will want to place a value. This will determine the speed of your object.
The last slot will determine what X and Y positions your object will rotate around. If you are making your object rotate around another object, place the values Text X Position and Text Y Position in this slot.


We will now do the same with the Sine block.


Next we need to place this block in a Repeat Forever block.


The Value:
We now need to make another rule on the basketball where it says, when the play button is tapped, Repeat Forever.


Inside this block we will place an Increase Value block with our value Length inside it.
Now we just need to change the amount you increase the value by in order to change the speed of the basketball. The higher the number, the faster the basketball rotates. 5 will be the default speed.


YAY! You have now learned to properly use Sine and Cosine in Hopscotch! Go mess around with the functions and clones and see what you can create!
THIS LINK is to the final product!


Was this tutorial helpful?

  • Yes
  • No
0 voters

Thank you guys for the Feedback! Ask questions below!

59 Likes

OMG That took so long to do.

10 Likes

Great tutorial! I’ll look forward to using this! I have like no experience with it XD

10 Likes

Thanks! I hope you guys use this to the best of your abilities!

6 Likes

Of course I ran outta likes!

5 Likes

Ikr XD <lololololololololololplololol

4 Likes

You guys can also fool around with the code in the example project to see what you can do!

3 Likes

One problem: the auto-correct kept changing “your” to “you’re”. Grammar sometimes bugs me. But great tutorial!

4 Likes

That troll who voted no -.-

4 Likes

@AmazingAlphaAquaWolf Probs not :wink: I did that when I first started. I think they should make the Sine block come first so nobody makes that mistake :wink:

5 Likes

Omg that really helped!! I’m pretty bad at sine and cosine

3 Likes

Thanks @PowderBluePuppy!

2 Likes

Link to the sin and cos linky link linkthing I did based on your tutorial:

3 Likes

@Bubbles4Ever929 Nice job! You did a great job testing the first slot to make it rotate in a different shape! :wink::+1:

2 Likes

Maxed out on likes… It’s supposed to be the moon rotating around earth

4 Likes

I know! :earth_americas::new_moon: Good Job!

4 Likes

Thanks @UptownStudios!! Great tutorial :smiley:

5 Likes

Wow this is really helpful! Srsly, for the first time, my things are working :joy:

5 Likes

Here’s what I was experimenting

8 Likes

@DancingLollipop Nice Job!

4 Likes