cos and sin are what you use when you want to draw a circle, or animate something moving in a circle.
In the post on unit vectors, we defined the unit n-sphere and found a parametrization of it. In the previous post, we encountered the arclength parametrization, which for most purposes is more convenient than other parametrizations. In this post, we discuss the arclength parametrization of the unit circle S1, which is given by the cos and sin functions. This will be useful for drawing things along a circle or animating something that's rotating.
We need to start by naming the length of the unit circle.
By scaling, it follows that the circumference of a circle of radius r is given by ϖr. For example, the circumference of a circle of radius 4 is 4ϖ≈25.13…. Equivalently, we could define ϖ as the ratio of any circle's circumference to its radius.
This completely defines cos and sin, but doesn't tell us how to compute them. However, in just a few posts we'll derive an algorithm to compute these.
You may be used to a definition of cos and sin in terms of ratios of right-angle triangles; I'll review that interpretation below. That interpretation is often useful, but it doesn't work for angles larger than 90∘.
Let's say more about animation. So far, cos and sin tell us how to parametrize the unit circle, i.e. the circle of radius 1 centered at the origin O=(0,0). What about other circles?
Let's do this in steps. First, let
S1(r)={v∈R2:∥v∥=r}
be the circle of radius r centered at the origin. We have
S1(r):=rS1:={rv∣v∈S1}
so can parametrize this by
r(cost,sint)=(rcost,rsint),t∈[0,ϖ].
Next, let's consider circles centered at other points. For a point P∈A2 and a radius r>0, let
S1(P,r):={Q∈A2:∥P−Q∥=r}
be the circle of radius r centered at P. Note that S1(r) lives in the vector space R2, while S1(P,r) lives in the affine space A2; recall that "the origin" is a feature of vector space. We can get S1(P,r) by translatingS1(r) to the point P: in other words,
S1(P,r):=P+S1(r):={P+v∣v∈S1(r)}
Therefore, a parametrization of S1(P,r) is given by
P+r(cost,sint)=⟨p1+rcost,p2+rsint⟩,t∈[0,ϖ],
where P=⟨p1,p2⟩.
That does everything we need if we want to draw a circle (or a part of a circle). Often though, we want to animate something moving in a circle. This means we need to further take into account its speed (or angular velocity) and its starting position.
By default, (cost,sint) starts at (1,0) and goes around the circle one every ϖ units of time, going counterclockwise. To have it start at a different angle θ0, we just add that on to t:
(cos(θ0+t),sin(θ0+t))
To change the speed, we multiply t by a constant. For example, if t is measured in seconds and we want to go around the circle once every two seconds, we'd use
(cos(θ0+2ϖt),sin(θ0+2ϖt))
since going around the circle once every two seconds is the same as going halfway around the circle every second. We can also scale by a negative number to go clockwise instead of counter-clockwise.
This perspective is often useful, but it doesn't work for angles larger than 90∘.
How does this relate to coordinates of points on the unit circle? First, note that for any point on a circle, we can form a right-angle triangle whose hypotenuse is the line segment from the center of the circle to that point (see below). In the case of the unit circle,
Although we don't yet have a general algorithm for computing cos and sin, we can read off the values of the coordinates of East (0), North (90∘=4ϖ), West (180∘=2ϖ), and South (270∘=43ϖ).
With a bit more work, we can calculate the coordinates of the point at 45∘, using the triangle interpretation above.
45°
x
x
1
Since the angles of a triangle add up to 180∘=ϖ/2, the remaining angle is also 45∘=ϖ/8. This implies that the two side lengths cos45∘ and sin45∘ are equal; let's call that x. By the Pythagorean theorem,
Once we've established (1), we can derive all the usual trigonometric identities using algebraic manipulations, with no further geometric insight required.
Use (1) to derive the "half-angle formulas"
cos(θ/2)sin(θ/2)=±21+cosθ=±21−cosθ
Use (2) and (3) to derive the "double-angle formulas"
cos(2θ)sin(2θ)=cos2(θ)−sin2(θ)=2cos2(θ)−1=1−2sin2(θ)=2cos(θ)sin(θ)
Derive the "angle-difference" formulas
cos(α−β)sin(α−β)=cos(α)cos(β)+sin(α)sin(β)=sin(α)cos(β)−cos(α)sin(β)
and the "angle-sum" formulas
cos(α+β)sin(α+β)=cos(α)cos(β)−sin(α)sin(β)=sin(α)cos(β)+cos(α)sin(β)
These are sometimes stated in combined form
cos(α±β)sin(α±β)=cos(α)cos(β)∓sin(α)sin(β)=sin(α)cos(β)±cos(α)sinβ)
This is not the best way to derive these formulas, but it works; the point is mainly that you can get them from each other using pure algebra. We'll see a more enlightening explanation of and in a future lesson, and then the rest will follow by algebra in a similar way (in the opposite order as you derived them here).