UNPKG

769 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function sec
4
5Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.
6
7For matrices, the function is evaluated element wise.
8
9
10## Syntax
11
12```js
13math.sec(x)
14```
15
16### Parameters
17
18Parameter | Type | Description
19--------- | ---- | -----------
20`x` | number &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Function input
21
22### Returns
23
24Type | Description
25---- | -----------
26number &#124; Complex &#124; Array &#124; Matrix | Secant of x
27
28
29## Examples
30
31```js
32math.sec(2) // returns number -2.4029979617223822
331 / math.cos(2) // returns number -2.4029979617223822
34```
35
36
37## See also
38
39[cos](cos.md),
40[csc](csc.md),
41[cot](cot.md)