|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Takes the cosine of a number (usually, an angle).
cos(angle)
Menu Location
Press the COS button to enter cos(.
This command works on all calculators.
1 byte
The cos() command returns the cosine of an angle measure. Naturally, the result depends on the angle mode the calculator is in: radian, degree, or (in AMS version 3.10) gradian. You can also use one of the r, °, G marks to specify an angle mode.
For many common angles, cos() can compute an exact result. Other angles, the calculator will leave alone unless it's in approximate mode (or unless you make it approximate), and then it will give a decimal approximation. As long as the calculator is in radian mode, cos() can be used with complex numbers as well.
:cos(60°)
1/2
:cos(x+2π)
cos(x)
:cos(πi/2)
cosh(π/2)If cos() is applied to a list, it will take the cosine of every element in the list.
Advanced Uses
The cos() of a matrix is not (in general) the same as taking the cosine of every element of the matrix. A different definition is used to compute the result; see Matrices and Their Commands. It requires the matrix to be square and diagonalizable in order to apply.
Error Conditions
230 - Dimension happens when taking cos() of a matrix that isn't square.
260 - Domain error happens when taking cos() of a complex number in degree or gradian mode.
665 - Matrix not diagonalizable happens when taking cos() of a matrix that isn't diagonalizable.
