This post begins a (potential) new series: **mathematics in action**. Let’s see how it goes.

There are many phenomena in science and engineering which one would like to describe using **angles**. With a pendulum, for example, one might use 0° to describe the state with the bob at the right, 90° for the bob at the centre moving left, 180° for the bob at the left, 270° for the bob at the centre moving right, and 360° = 0° for the bob at the right again:

This gets even more interesting when we have multiple pendulums (or metronomes, which are just pendulums upside down):

A more practical example of this sort of thing might be a bank of electric generators, which each generate an alternating current as they spin through their cycles:

There are even medical applications (see pages 83–84 of this thesis).

In studying this kind of thing, it is sometimes necessary to find the **average of a set of angles**. For example: 300°, 330°, 360°, and 30°. This is more complicated than it seems at first sight, since 330° = −30°, 300° = −60°, and so forth.

The solution is to find the **average sine**: in this case *a* = −0.2165 (the average of −0.8660, −0.5, 0, and 0.5), and the **average cosine**: in this case *b* = 0.8080 (the average of 0.5, 0.8660, 1, and 0.8660).

The average angle is the one whose sine and cosine are *a* and *b*, which in this case is: arctan(*a*/*b*) = −15° = 345° (Some care is needed in handling the case of negative or zero cosines).

We can define the extent to which the angles are the same by *r* = sqrt(*a*^{2} + *b*^{2}). This will give *r* = 0 for angles evenly spaced around a circle, and *r* = 1 for identical angles. For the set of 300°, 330°, 360°, and 30° (which are quite similar), we get *r* = 0.8365. To see an example of *r* defined in this way being used, look at this paper of mine. Having identical or near-identical angles is also important for sets of electric generators.

For those mathematics students that have studied complex numbers, this can all be made a lot easier. Each angle θ is represented as the complex number cos(θ) + *i* sin(θ) = *e*^{iθ}. We then **average the complex numbers**, giving *a* + *b* *i*. Conversion to polar coordinates then gives us *r* and the average angle φ, since *a* + *b* *i* = *r* *e*^{iφ}. This helps to explain why complex numbers are a compulsory part of every engineering course – especially when studying harmonic motion, alternating current, or anything that vibrates.