2021-01-09 17:30:54 +08:00
|
|
|
### 扩展数学函数
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 1.sin
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> sin 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
sin(a) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
sin(0)
|
|
|
|
```
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 2.cos
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> cos 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
cos(a) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
cos(0)
|
|
|
|
```
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 3.tan
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> tan 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
tan(a) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
tan(1)
|
|
|
|
```
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 4.asin
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> asin 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
asin(a) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
asin(1)
|
|
|
|
```
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 5.acos
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> acos 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
acos(a) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
acos(1)
|
|
|
|
```
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 6.atan
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> atan 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
atan(a) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
atan(1)
|
|
|
|
```
|
|
|
|
|
2021-01-13 14:04:50 +08:00
|
|
|
#### 7.pow
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
> pow 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
2021-01-13 14:04:50 +08:00
|
|
|
pow(a, b) => double
|
2021-01-09 17:30:54 +08:00
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
##### 示例
|
2021-01-09 17:30:54 +08:00
|
|
|
|
|
|
|
```
|
|
|
|
pow(2, 3)
|
|
|
|
```
|
|
|
|
|
2021-07-16 10:01:33 +08:00
|
|
|
#### 8.atan2
|
|
|
|
|
|
|
|
> atan2 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
|
|
|
atan2(a, b) => double
|
|
|
|
```
|
|
|
|
|
|
|
|
##### 示例
|
|
|
|
|
|
|
|
```
|
|
|
|
atan2(2, 3)
|
|
|
|
```
|
|
|
|
|
|
|
|
#### 9.log
|
|
|
|
|
|
|
|
> log 函数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
|
|
|
log(a) => double
|
|
|
|
```
|
|
|
|
|
|
|
|
##### 示例
|
|
|
|
|
|
|
|
```
|
|
|
|
log(0)
|
|
|
|
```
|
|
|
|
|
|
|
|
#### 10.is_prime
|
|
|
|
|
|
|
|
> 判断一个整数是否是质数。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
|
|
|
is_prime(a) => bool
|
|
|
|
```
|
|
|
|
|
|
|
|
##### 示例
|
|
|
|
|
|
|
|
```
|
|
|
|
is_prime(7)
|
|
|
|
```
|
|
|
|
|
|
|
|
#### 11.exp
|
|
|
|
|
|
|
|
> exp 函数
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
|
|
|
exp(a) => double
|
|
|
|
```
|
|
|
|
|
|
|
|
##### 示例
|
|
|
|
|
|
|
|
```
|
|
|
|
exp(7)
|
|
|
|
```
|
2021-07-20 11:24:38 +08:00
|
|
|
|
|
|
|
#### 12.d2r
|
|
|
|
|
|
|
|
> 将角度转换成幅度。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
|
|
|
d2r(a) => double
|
|
|
|
```
|
|
|
|
|
|
|
|
##### 示例
|
|
|
|
|
|
|
|
```
|
|
|
|
d2r(7)
|
|
|
|
```
|
|
|
|
|
2021-07-20 11:29:05 +08:00
|
|
|
#### 13.r2d
|
|
|
|
|
|
|
|
> 将幅度转换成角度。
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
##### 原型
|
|
|
|
|
|
|
|
```
|
|
|
|
r2d(a) => double
|
|
|
|
```
|
|
|
|
|
|
|
|
##### 示例
|
|
|
|
|
|
|
|
```
|
|
|
|
r2d(7)
|
|
|
|
```
|