Template:Cos

From Wikipedia, the free encyclopedia

[view] [edit] Template documentation

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

For the value of pi, you can use 3.14159265358979.

Usage:
{{Cos|radians}}
Limitations
Don't use this template to create 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!
The limitation of the precision to 4 decimals avoids 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).
Examples:
  • cos(- π  ) = -1
  • cos(-5π/6) = -0.866
  • cos(-3π/4) = -0.7071
  • cos(-2π/3) = -0.5
  • cos(- π/2) = 0
  • cos(- π/3) = 0.5
  • cos(- π/4) = 0.7071
  • cos(- π/6) = 0.866
  • cos(  0  ) = 1
  • cos(  π/6) = 0.866
  • cos(  π/4) = 0.7071
  • cos(  π/3) = 0.5
  • cos(  π/2) = 0
  • cos( 2π/3) = -0.5
  • cos( 3π/4) = -0.7071
  • cos( 5π/6) = -0.866
  • cos(  π  ) = -1
  • cos( 3π/2) = 0
  • cos( 2π  ) = 1
  • cos( 5π/2) = 0
  • cos( 3π  ) = -1
  • cos( 7π/2) = 0
  • cos( 4π  ) = 1
See also:
    In other languages