Trigonometric tables

Last updated

In mathematics, tables of trigonometric functions are useful in a number of areas. Before the existence of pocket calculators, trigonometric tables were essential for navigation, science and engineering. The calculation of mathematical tables was an important area of study, which led to the development of the first mechanical computing devices.

Contents

Modern computers and pocket calculators now generate trigonometric function values on demand, using special libraries of mathematical code. Often, these libraries use pre-calculated tables internally, and compute the required value by using an appropriate interpolation method. Interpolation of simple look-up tables of trigonometric functions is still used in computer graphics, where only modest accuracy may be required and speed is often paramount.

Another important application of trigonometric tables and generation schemes is for fast Fourier transform (FFT) algorithms, where the same trigonometric function values (called twiddle factors) must be evaluated many times in a given transform, especially in the common case where many transforms of the same size are computed. In this case, calling generic library routines every time is unacceptably slow. One option is to call the library routines once, to build up a table of those trigonometric values that will be needed, but this requires significant memory to store the table. The other possibility, since a regular sequence of values is required, is to use a recurrence formula to compute the trigonometric values on the fly. Significant research has been devoted to finding accurate, stable recurrence schemes in order to preserve the accuracy of the FFT (which is very sensitive to trigonometric errors).

A trigonometry table is essentially a reference chart that presents the values of sine, cosine, tangent, and other trigonometric functions for various angles. These angles are usually arranged across the top row of the table, while the different trigonometric functions are labeled in the first column on the left. To locate the value of a specific trigonometric function at a certain angle, you would find the row for the function and follow it across to the column under the desired angle. [1]

Utilising a trigonometry table involves a few straightforward steps

  1. Determine the specific angle for which you need to find the trigonometric values.
  2. Locate this angle along the horizontal axis (top row) of the table.
  3. Choose the trigonometric function you're interested in from the vertical axis (first column).
  4. Trace across from the function and down from the angle to the point where they intersect on the table; the number at this intersection provides the value of the trigonometric function for that angle.

On-demand computation

A page from a 1619 book of mathematical tables. Bernegger Manuale 137.jpg
A page from a 1619 book of mathematical tables.

Modern computers and calculators use a variety of techniques to provide trigonometric function values on demand for arbitrary angles (Kantabutra, 1996). One common method, especially on higher-end processors with floating-point units, is to combine a polynomial or rational approximation (such as Chebyshev approximation, best uniform approximation, Padé approximation, and typically for higher or variable precisions, Taylor and Laurent series) with range reduction and a table lookup they first look up the closest angle in a small table, and then use the polynomial to compute the correction. Maintaining precision while performing such interpolation is nontrivial, but methods like Gal's accurate tables, Cody and Waite range reduction, and Payne and Hanek radian reduction algorithms can be used for this purpose. On simpler devices that lack a hardware multiplier, there is an algorithm called CORDIC (as well as related techniques) that is more efficient, since it uses only shifts and additions. All of these methods are commonly implemented in hardware for performance reasons.

The particular polynomial used to approximate a trigonometric function is generated ahead of time using some approximation of a minimax approximation algorithm.

For very high precision calculations, when series-expansion convergence becomes too slow, trigonometric functions can be approximated by the arithmetic-geometric mean, which itself approximates the trigonometric function by the (complex) elliptic integral (Brent, 1976).

Trigonometric functions of angles that are rational multiples of 2π are algebraic numbers. The values for a/b·2π can be found by applying de Moivre's identity for n = a to a bth root of unity, which is also a root of the polynomial xb - 1 in the complex plane. For example, the cosine and sine of 2π  5/37 are the real and imaginary parts, respectively, of the 5th power of the 37th root of unity cos(2π/37) + sin(2π/37)i, which is a root of the degree-37 polynomial x37  1. For this case, a root-finding algorithm such as Newton's method is much simpler than the arithmetic-geometric mean algorithms above while converging at a similar asymptotic rate. The latter algorithms are required for transcendental trigonometric constants, however.

Half-angle and angle-addition formulas

Historically, the earliest method by which trigonometric tables were computed, and probably the most common until the advent of computers, was to repeatedly apply the half-angle and angle-addition trigonometric identities starting from a known value (such as sin(π/2) = 1, cos(π/2) = 0). This method was used by the ancient astronomer Ptolemy, who derived them in the Almagest , a treatise on astronomy. In modern form, the identities he derived are stated as follows (with signs determined by the quadrant in which x lies):

These were used to construct Ptolemy's table of chords, which was applied to astronomical problems.

Various other permutations on these identities are possible: for example, some early trigonometric tables used not sine and cosine, but sine and versine.

A quick, but inaccurate, approximation

A quick, but inaccurate, algorithm for calculating a table of N approximations sn for sin(2π n/N) and cn for cos(2πn/N) is:

s0 = 0
c0 = 1
sn+1 = sn + d×cn
cn+1 = cnd×sn

for n = 0,...,N  1, where d = 2π/N.

This is simply the Euler method for integrating the differential equation:

with initial conditions s(0) = 0 and c(0) = 1, whose analytical solution is s = sin(t) and c = cos(t).

Unfortunately, this is not a useful algorithm for generating sine tables because it has a significant error, proportional to 1/N.

For example, for N = 256 the maximum error in the sine values is ~0.061 (s202 = 1.0368 instead of 0.9757). For N = 1024, the maximum error in the sine values is ~0.015 (s803 = 0.99321 instead of 0.97832), about 4 times smaller. If the sine and cosine values obtained were to be plotted, this algorithm would draw a logarithmic spiral rather than a circle.

A better, but still imperfect, recurrence formula

A simple recurrence formula to generate trigonometric tables is based on Euler's formula and the relation:

This leads to the following recurrence to compute trigonometric values sn and cn as above:

c0 = 1
s0 = 0
cn+1 = wrcnwisn
sn+1 = wicn + wrsn

for n = 0, ..., N  1, where wr = cos(2π/N) and wi = sin(2π/N). These two starting trigonometric values are usually computed using existing library functions (but could also be found e.g. by employing Newton's method in the complex plane to solve for the primitive root of zN  1).

This method would produce an exact table in exact arithmetic, but has errors in finite-precision floating-point arithmetic. In fact, the errors grow as O(ε N) (in both the worst and average cases), where ε is the floating-point precision.

A significant improvement is to use the following modification to the above, a trick (due to Singleton [2] ) often used to generate trigonometric values for FFT implementations:

c0 = 1
s0 = 0
cn+1 = cn  (αcn + βsn)
sn+1 = sn + (β cn  α sn)

where α = 2 sin2(π/N) and β = sin(2π/N). The errors of this method are much smaller, O(ε N) on average and O(ε N) in the worst case, but this is still large enough to substantially degrade the accuracy of FFTs of large sizes.

See also

Related Research Articles

<span class="mw-page-title-main">Complex number</span> Number with a real and an imaginary part

In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted i, called the imaginary unit and satisfying the equation ; every complex number can be expressed in the form , where a and b are real numbers. Because no real number satisfies the above equation, i was called an imaginary number by René Descartes. For the complex number , a is called the real part, and b is called the imaginary part. The set of complex numbers is denoted by either of the symbols or C. Despite the historical nomenclature "imaginary", complex numbers are regarded in the mathematical sciences as just as "real" as the real numbers and are fundamental in many aspects of the scientific description of the natural world.

<span class="mw-page-title-main">Trigonometric functions</span> Functions of an angle

In mathematics, the trigonometric functions are real functions which relate an angle of a right-angled triangle to ratios of two side lengths. They are widely used in all sciences that are related to geometry, such as navigation, solid mechanics, celestial mechanics, geodesy, and many others. They are among the simplest periodic functions, and as such are also widely used for studying periodic phenomena through Fourier analysis.

<span class="mw-page-title-main">Box–Muller transform</span> Statistical transform

The Box–Muller transform, by George Edward Pelham Box and Mervin Edgar Muller, is a random number sampling method for generating pairs of independent, standard, normally distributed random numbers, given a source of uniformly distributed random numbers. The method was in fact first mentioned explicitly by Raymond E. A. C. Paley and Norbert Wiener in 1934.

In mathematics, a linear differential equation is a differential equation that is defined by a linear polynomial in the unknown function and its derivatives, that is an equation of the form

In the mathematical subfields of numerical analysis and mathematical analysis, a trigonometric polynomial is a finite linear combination of functions sin(nx) and cos(nx) with n taking on the values of one or more natural numbers. The coefficients may be taken as real numbers, for real-valued functions. For complex coefficients, there is no difference between such a function and a finite Fourier series.

<span class="mw-page-title-main">CORDIC</span> Algorithm for computing trigonometric, hyperbolic, logarithmic and exponential functions

CORDIC, also known as Volder's algorithm, or: Digit-by-digit methodCircular CORDIC, Linear CORDIC, Hyperbolic CORDIC, and Generalized Hyperbolic CORDIC, is a simple and efficient algorithm to calculate trigonometric functions, hyperbolic functions, square roots, multiplications, divisions, and exponentials and logarithms with arbitrary base, typically converging with one digit per iteration. CORDIC is therefore also an example of digit-by-digit algorithms. CORDIC and closely related methods known as pseudo-multiplication and pseudo-division or factor combining are commonly used when no hardware multiplier is available, as the only operations it requires are additions, subtractions, bitshift and lookup tables. As such, they all belong to the class of shift-and-add algorithms. In computer science, CORDIC is often used to implement floating-point arithmetic when the target platform lacks hardware multiply for cost or space reasons.

In mathematics, trigonometric interpolation is interpolation with trigonometric polynomials. Interpolation is the process of finding a function which goes through some given data points. For trigonometric interpolation, this function has to be a trigonometric polynomial, that is, a sum of sines and cosines of given periods. This form is especially suited for interpolation of periodic functions.

Prosthaphaeresis was an algorithm used in the late 16th century and early 17th century for approximate multiplication and division using formulas from trigonometry. For the 25 years preceding the invention of the logarithm in 1614, it was the only known generally applicable way of approximating products quickly. Its name comes from the Greek prosthesis (πρόσθεσις) and aphaeresis (ἀφαίρεσις), meaning addition and subtraction, two steps in the process.

Indian mathematics emerged in the Indian subcontinent from 1200 BCE until the end of the 18th century. In the classical period of Indian mathematics, important contributions were made by scholars like Aryabhata, Brahmagupta, Bhaskara II, and Varāhamihira. The decimal number system in use today was first recorded in Indian mathematics. Indian mathematicians made early contributions to the study of the concept of zero as a number, negative numbers, arithmetic, and algebra. In addition, trigonometry was further advanced in India, and, in particular, the modern definitions of sine and cosine were developed there. These mathematical concepts were transmitted to the Middle East, China, and Europe and led to further developments that now form the foundations of many areas of mathematics.

In geometry, the area enclosed by a circle of radius r is πr2. Here the Greek letter π represents the constant ratio of the circumference of any circle to its diameter, approximately equal to 3.14159.

<span class="mw-page-title-main">Small-angle approximation</span> Simplification of the basic trigonometric functions

The small-angle approximations can be used to approximate the values of the main trigonometric functions, provided that the angle in question is small and is measured in radians:

<span class="mw-page-title-main">Sine and cosine</span> Fundamental trigonometric functions

In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side that is opposite that angle to the length of the longest side of the triangle, and the cosine is the ratio of the length of the adjacent leg to that of the hypotenuse. For an angle , the sine and cosine functions are denoted simply as and .

<span class="mw-page-title-main">History of trigonometry</span>

Early study of triangles can be traced to the 2nd millennium BC, in Egyptian mathematics and Babylonian mathematics. Trigonometry was also prevalent in Kushite mathematics. Systematic study of trigonometric functions began in Hellenistic mathematics, reaching India as part of Hellenistic astronomy. In Indian astronomy, the study of trigonometric functions flourished in the Gupta period, especially due to Aryabhata, who discovered the sine function. During the Middle Ages, the study of trigonometry continued in Islamic mathematics, by mathematicians such as Al-Khwarizmi and Abu al-Wafa. It became an independent discipline in the Islamic world, where all six trigonometric functions were known. Translations of Arabic and Greek texts led to trigonometry being adopted as a subject in the Latin West beginning in the Renaissance with Regiomontanus. The development of modern trigonometry shifted during the western Age of Enlightenment, beginning with 17th-century mathematics and reaching its modern form with Leonhard Euler (1748).

Clenshaw–Curtis quadrature and Fejér quadrature are methods for numerical integration, or "quadrature", that are based on an expansion of the integrand in terms of Chebyshev polynomials. Equivalently, they employ a change of variables and use a discrete cosine transform (DCT) approximation for the cosine series. Besides having fast-converging accuracy comparable to Gaussian quadrature rules, Clenshaw–Curtis quadrature naturally leads to nested quadrature rules, which is important for both adaptive quadrature and multidimensional quadrature (cubature).

<span class="mw-page-title-main">Exact trigonometric values</span> Trigonometric numbers in terms of square roots

In mathematics, the values of the trigonometric functions can be expressed approximately, as in , or exactly, as in . While trigonometric tables contain many approximate values, the exact values for certain angles can be expressed by a combination of arithmetic operations and square roots.

<span class="mw-page-title-main">Trigonometry</span> Area of geometry, about angles and lengths

Trigonometry is a branch of mathematics concerned with relationships between angles and ratios of lengths. The field emerged in the Hellenistic world during the 3rd century BC from applications of geometry to astronomical studies. The Greeks focused on the calculation of chords, while mathematicians in India created the earliest-known tables of values for trigonometric ratios such as sine.

In mathematics, Bhāskara I's sine approximation formula is a rational expression in one variable for the computation of the approximate values of the trigonometric sines discovered by Bhāskara I, a seventh-century Indian mathematician. This formula is given in his treatise titled Mahabhaskariya. It is not known how Bhāskara I arrived at his approximation formula. However, several historians of mathematics have put forward different hypotheses as to the method Bhāskara might have used to arrive at his formula. The formula is elegant and simple, and it enables the computation of reasonably accurate values of trigonometric sines without the use of geometry.

<span class="mw-page-title-main">Unit circle</span> Circle with radius of one

In mathematics, a unit circle is a circle of unit radius—that is, a radius of 1. Frequently, especially in trigonometry, the unit circle is the circle of radius 1 centered at the origin in the Cartesian coordinate system in the Euclidean plane. In topology, it is often denoted as S1 because it is a one-dimensional unit n-sphere.

A system of polynomial equations is a set of simultaneous equations f1 = 0, ..., fh = 0 where the fi are polynomials in several variables, say x1, ..., xn, over some field k.

References

  1. "Trigonometry Table: Learning of trigonometry table is simplified". Yogiraj notes | General study and Law study Notes. Retrieved 2023-11-02.
  2. Singleton 1967