OMG yes, there is more trigonometry. I have already covered basic trigonometry in, Chapter 7, Collision Detection, but believe it or not, trigonometry is really useful in game development. Trigonometry happens to be very useful for particle systems and we will be using SVG and some trig to build a little pie chart we can use to visualize the direction of our particle emitter. So, let's take a second to quickly review things one more time:
- Sine = Opposite/Hypotenuse (SOH)
- Cosine = Adjacent/Hypotenuse (CAH)
- Tangent = Opposite/Adjacent (TOA)
Remember the word SOHCAHTOA?
If we are using a 2D Cartesian coordinate system (spoiler alert, we are) the opposite edge in our scenario is just the Y coordinate, and the adjacent edge is the X coordinate. So, in terms of a 2D Cartesian coordinate system, our ratios look like this:
- Sine = Y/Circle Radius
- Cosine = X...