# Trigonometry for Game Programming – SpriteKit and Swift Tutorial: Part 2/2

Learn trigonometry for game programming using SpriteKit and Swift. You will learn the theory and then practice using trigonometry by making a space shooter game!

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5505-trigonometry-for-game-programming-spritekit-and-swift-tutorial-part-2-2

When I use the orbit code, the object that I want to orbit around the circle does not move. What am I doing wrong?

@cinnastix Most likely that you aren’t using a component that changes as time passes. If you look at the updateOrbiter method in the tutorial, you’ll notice it take a parameter that increases as time passes. That value is used in the calculation to change the angle over time. Without this value changing, the object would remain in one spot.

This is great. Except, when I go the interactive circle link, it throws everything I learned off. Putting it at a 45 degree angle, it displays the cosine as the Blue line, and the sine as the green line. From what I thought after looking at the part 1 photos, when you use cosine, it returns the value of the opposite side. And as for sine, it returns the value of the adjacent side.

So which is right? Is the cosine the value of the blue line as it is in the interactive link, or is it the value of the opposite line like the photos say here?

Of course, when you Google you get the formula cos() = adj / hypotenuse

Go back and look again. For the figure with the sin, cos, and tan defined, the graphic is showing the two sides being used in orange, and the remaining unused side in blue.

sin(angle) = opposite / hypotenuse (opposite side and hypotenuse are orange)