Template:Sin/doc

Implements the mathematical sine function, from an input in radians, with an output precision of 10 decimals.

For the value of pi, you may use 3.14159265358979.


 * Usage :
 *  


 * Limitations
 * Don't use this template to create complex graphics! It will rapidly exhaust server resources if you instanciate it too many times. This template is intended only to compute very few trigonometric functions per page!
 * You may limit the precision to 4 decimals to avoid an output in scientific notation like "1E-5", which may generate errors if the result is used in another expression (because the ParserFunction #expr still does not support such numbers on input).
 * The function is computed using the following limited development at degree 21 factorized as this numerically stable expression:
 * sin x = (1 - (1 - (1 - (1 - (1 - (1 - (1 - (1 - (1 - (1 -
 * x*x / 420) *
 * x*x / 342) *
 * x*x / 272) *
 * x*x / 210) *
 * x*x / 156) *
 * x*x / 110) *
 * x*x / 72) *
 * x*x / 42) *
 * x*x / 20) *
 * x*x / 6) * x + O(x22),
 * where x is the input value after a modulo 2π reduction (to limit the error of approximation). i.e. x is in (-π,+π).
 * Under this condition, the result precision is more than 10 digits. A lower degree would be enough but this would require testing the quarter of circle and using several limited developments.

 • O • 0 • π/12 • π/6 • π/4 • π/3 • 5π/12 • π/2 • 7π/12 • 2π/3 • 3π/4 • 5π/6 • 11π/12 <div style="position:absolute;left:px;bottom:px">• π <div style="position:absolute;left:px;bottom:px">• 13π/12 <div style="position:absolute;left:px;bottom:px">• 7π/6 <div style="position:absolute;left:px;bottom:px">• 5π/4 <div style="position:absolute;left:px;bottom:px">• 4π/3 <div style="position:absolute;left:px;bottom:px">• 17π/12 <div style="position:absolute;left:px;bottom:px">• 3π/2 <div style="position:absolute;left:px;bottom:px">• 19π/12 <div style="position:absolute;left:px;bottom:px">• 5π/3 <div style="position:absolute;left:px;bottom:px">• 7π/4 <div style="position:absolute;left:px;bottom:px">• 11π/6 <div style="position:absolute;left:px;bottom:px">• 23π/12
 * Examples :
 * = (need to round to 4 decimals if exponential notation undesirable)
 * More complex example:
 * = (need to round to 4 decimals if exponential notation undesirable)
 * More complex example:
 * = (need to round to 4 decimals if exponential notation undesirable)
 * More complex example:
 * = (need to round to 4 decimals if exponential notation undesirable)
 * More complex example:
 * = (need to round to 4 decimals if exponential notation undesirable)
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:
 * More complex example:

that will render this trigonometric circle:

<div style="position:relative;width:600px;height:600px;font-family:serif;border:1px solid black;line-height:0.8"> • O <div style="position:absolute;left:0px;bottom:px">• O <div style="position:absolute;left:px;bottom:px">• 0 <div style="position:absolute;left:px;bottom:px">• π/12 <div style="position:absolute;left:px;bottom:px">• π/6 <div style="position:absolute;left:px;bottom:px">• π/4 <div style="position:absolute;left:px;bottom:px">• π/3 <div style="position:absolute;left:px;bottom:px">• 5π/12 <div style="position:absolute;left:px;bottom:px">• π/2 <div style="position:absolute;left:px;bottom:px">• 7π/12 <div style="position:absolute;left:px;bottom:px">• 2π/3 <div style="position:absolute;left:px;bottom:px">• 3π/4 <div style="position:absolute;left:px;bottom:px">• 5π/6 <div style="position:absolute;left:px;bottom:px">• 11π/12 <div style="position:absolute;left:px;bottom:px">• π <div style="position:absolute;left:px;bottom:px">• 13π/12 <div style="position:absolute;left:px;bottom:px">• 7π/6 <div style="position:absolute;left:px;bottom:px">• 5π/4 <div style="position:absolute;left:px;bottom:px">• 4π/3 <div style="position:absolute;left:px;bottom:px">• 17π/12 <div style="position:absolute;left:px;bottom:px">• 3π/2 <div style="position:absolute;left:px;bottom:px">• 19π/12 <div style="position:absolute;left:px;bottom:px">• 5π/3 <div style="position:absolute;left:px;bottom:px">• 7π/4 <div style="position:absolute;left:px;bottom:px">• 11π/6 <div style="position:absolute;left:px;bottom:px">• 23π/12 fr:Modèle:Sin
 * See also :
 * Template:Cos