HTML and CSS Reference
In-Depth Information
Chapter 3
Trigonometry for Animation
What we'll cover in this chapter:
What is trigonometry?
Angles
Trigonometry functions
Rotation
Waves
Circles and ellipses
Pythagorean Theorem
Distance between two points
This chapter is near the beginning of the topic because trigonometry is used extensively for animation
techniques, starting with the examples in Chapter 5. And in fact, we'll even touch on it in Chapter 4 on
rendering techniques. However, feel free to jump ahead if you already know basic trigonometry or are just
anxious to animate things. You can always come back here when you come across something you don't
understand.
Many people shy away from math and trigonometry, using excuses like: “I'm not good with numbers.” The
interesting thing about programming with trigonometry is that you are hardly dealing with numbers at all.
It's more about visualizing shapes and relationships. For the most part, you deal with variables containing
positions, distances, and angles, and you never see the actual numbers. It's mostly a matter of
understanding various relationships, and in fact, about 90% of the trigonometry you need for basic
animation comes down to two functions: Math.sin and Math.cos .
 
Search WWH ::




Custom Search