Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Trigonometric tables
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Lists of values of mathematical functions}} {{no footnotes|date=December 2018}} {{Trigonometry}} In [[mathematics]], tables of [[trigonometric function]]s are useful in a number of areas. Before the existence of [[Calculator|pocket calculator]]s, '''trigonometric tables''' were essential for [[navigation]], [[science]] and [[engineering]]. The calculation of [[mathematical table]]s was an important area of study, which led to the development of the [[history of computing|first mechanical computing devices]]. 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.<ref>{{Cite web |title=Trigonometry Table: Learning of trigonometry table is simplified |url=https://www.yogiraj.co.in/trigonometry-table |access-date=2023-11-02 |website=Yogiraj notes {{!}} General study and Law study Notes |language=en-us}}</ref> == Using a trigonometry table involves a few straightforward steps == # Determine the specific angle for which you need to find the trigonometric values. # Locate this angle along the horizontal axis (top row) of the table. # Choose the trigonometric function you're interested in from the vertical axis (first column). # 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 == [[File:Bernegger Manuale 137.jpg|thumb|right|200px|A page from a 1619 book of [[mathematical table]]s.]] 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|floating-point]] units, is to combine a [[polynomial]] or [[rational function|rational]] [[approximation theory|approximation]] (such as [[Chebyshev approximation]], best uniform approximation, [[Padé approximant|Padé approximation]], and typically for higher or variable precisions, [[Taylor series|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 [[shift operator|shift]]s and additions. All of these methods are commonly implemented in [[computer hardware|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 [[arbitrary-precision arithmetic|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 number|complex]]) [[elliptic integral]] (Brent, 1976). Trigonometric functions of angles that are [[rational number|rational]] multiples of 2π are [[algebraic number]]s. The values for ''a/b·2π'' can be found by applying [[de Moivre's identity]] for ''n = a'' to a ''b<sup>th</sup>'' [[root of unity]], which is also a root of the polynomial ''x<sup>b</sup> - 1'' in the [[complex plane]]. For example, the cosine and sine of 2π ⋅ 5/37 are the [[real part|real]] and [[imaginary part]]s, 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 of a polynomial|degree]]-37 polynomial ''x''<sup>37</sup> − 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 number|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 identity|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 [[History of astronomy|astronomy]]. In modern form, the identities he derived are stated as follows (with signs determined by the quadrant in which ''x'' lies): :<math>\cos\left(\frac{x}{2}\right) = \pm \sqrt{\tfrac{1}{2}(1 + \cos x)}</math> :<math>\sin\left(\frac{x}{2}\right) = \pm \sqrt{\tfrac{1}{2}(1 - \cos x)}</math> :<math>\sin(x \pm y) = \sin(x) \cos(y) \pm \cos(x) \sin(y)\,</math> :<math>\cos(x \pm y) = \cos(x) \cos(y) \mp \sin(x) \sin(y)\,</math> 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 ''s''<sub>''n''</sub> for [[sine|sin]](2[[Pi|π]]''n''/''N'') and ''c''<sub>''n''</sub> for [[cosine|cos]](2π''n''/''N'') is: :''s''<sub>0</sub> = 0 :''c''<sub>0</sub> = 1 :''s''<sub>''n''+1</sub> = ''s''<sub>''n''</sub> + ''d'' × ''c''<sub>''n''</sub> :''c''<sub>''n''+1</sub> = ''c''<sub>''n''</sub> − ''d'' × ''s''<sub>''n''</sub> for ''n'' = 0,...,''N'' − 1, where ''d'' = 2π/''N''. This is simply the [[Numerical ordinary differential equations#Euler method|Euler method]] for integrating the [[differential equation]]: :<math>ds/dt = c</math> :<math>dc/dt = -s</math> 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 (''s''<sub>202</sub> = −1.0368 instead of −0.9757). For ''N'' = 1024, the maximum error in the sine values is ~0.015 (''s''<sub>803</sub> = −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 == {{original research|date=December 2018}} A simple recurrence formula to generate trigonometric tables is based on [[Euler's formula]] and the relation: :<math>e^{i(\theta + \Delta)} = e^{i\theta} \times e^{i\Delta\theta}</math> This leads to the following recurrence to compute trigonometric values ''s''<sub>''n''</sub> and ''c''<sub>''n''</sub> as above: :''c''<sub>0</sub> = 1 :''s''<sub>0</sub> = 0 :''c''<sub>''n''+1</sub> = ''w''<sub>''r''</sub> ''c''<sub>''n''</sub> − ''w''<sub>''i''</sub> ''s''<sub>''n''</sub> :''s''<sub>''n''+1</sub> = ''w''<sub>''i''</sub> ''c''<sub>''n''</sub> + ''w''<sub>''r''</sub> ''s''<sub>''n''</sub> for ''n'' = 0, ..., ''N'' − 1, where ''w''<sub>''r''</sub> = cos(2π/''N'') and ''w''<sub>''i''</sub> = 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 unity|root]] of ''z''<sup>''N''</sup> − 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<ref>{{harvnb|Singleton|1967}}</ref>) often used to generate trigonometric values for FFT implementations: :''c''<sub>0</sub> = 1 :''s''<sub>0</sub> = 0 :''c''<sub>''n''+1</sub> = ''c''<sub>''n''</sub> − (α ''c''<sub>''n''</sub> + β ''s''<sub>''n''</sub>) :''s''<sub>''n''+1</sub> = ''s''<sub>''n''</sub> + (β ''c''<sub>''n''</sub> − α ''s''<sub>''n''</sub>) where α = 2 sin<sup>2</sup>(π/''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 == * [[Aryabhata's sine table]] * [[CORDIC]] *[[Exact trigonometric values]] *[[Madhava's sine table]] *[[Numerical analysis]] *[[Plimpton 322]] *[[Prosthaphaeresis]] == References == {{reflist}} * [[Carl B. Boyer]] (1991) ''A History of Mathematics'', 2nd edition, [[John Wiley & Sons]]. * Manfred Tasche and Hansmartin Zeuner (2002) "Improved roundoff error analysis for precomputed twiddle factors", ''Journal for Computational Analysis and Applications'' 4(1): 1–18. * James C. Schatzman (1996) "Accuracy of the discrete Fourier transform and the fast Fourier transform", [[SIAM Journal on Scientific Computing]] 17(5): 1150–1166. * Vitit Kantabutra (1996) "On hardware for computing exponential and trigonometric functions," [[IEEE Transactions on Computers]] 45(3): 328–339 . * [[R. P. Brent]] (1976) "[http://doi.acm.org/10.1145/321941.321944 Fast Multiple-Precision Evaluation of Elementary Functions]", [[Journal of the Association for Computing Machinery]] 23: 242–251. * {{cite journal|last1=Singleton|first1=Richard C|date=1967|title=On Computing The Fast Fourier Transform|journal=[[Communications of the ACM]]|volume=10|issue=10|pages=647–654|doi=10.1145/363717.363771 |s2cid=6287781 |doi-access=free}} * William J. Cody Jr., William Waite, ''Software Manual for the Elementary Functions'', Prentice-Hall, 1980, {{ISBN|0-13-822064-6}}. * Mary H. Payne, Robert N. Hanek, ''Radian reduction for trigonometric functions'', [[Association for Computing Machinery|ACM]] SIGNUM Newsletter 18: 19-24, 1983. * Gal, Shmuel and Bachelis, Boris (1991) "An accurate elementary mathematical library for the IEEE floating point standard", [[ACM Transactions on Mathematical Software]]. [[Category:Trigonometry]] [[Category:Numerical analysis]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Ambox
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Harvnb
(
edit
)
Template:ISBN
(
edit
)
Template:No footnotes
(
edit
)
Template:Original research
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Trigonometry
(
edit
)