mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 12:08:16 +08:00
223 lines
1.8 KiB
Markdown
223 lines
1.8 KiB
Markdown
### 扩展数学函数
|
|
|
|
#### 1.sin
|
|
|
|
> sin 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
sin(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
sin(0)
|
|
```
|
|
|
|
#### 2.cos
|
|
|
|
> cos 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
cos(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
cos(0)
|
|
```
|
|
|
|
#### 3.tan
|
|
|
|
> tan 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
tan(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
tan(1)
|
|
```
|
|
|
|
#### 4.asin
|
|
|
|
> asin 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
asin(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
asin(1)
|
|
```
|
|
|
|
#### 5.acos
|
|
|
|
> acos 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
acos(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
acos(1)
|
|
```
|
|
|
|
#### 6.atan
|
|
|
|
> atan 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
atan(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
atan(1)
|
|
```
|
|
|
|
#### 7.pow
|
|
|
|
> pow 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
pow(a, b) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
pow(2, 3)
|
|
```
|
|
|
|
#### 8.atan2
|
|
|
|
> atan2 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
atan2(a, b) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
atan2(2, 3)
|
|
```
|
|
|
|
#### 9.logf
|
|
|
|
> logf 函数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
logf(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
logf(0)
|
|
```
|
|
|
|
#### 10.is_prime
|
|
|
|
> 判断一个整数是否是质数。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
is_prime(a) => bool
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
is_prime(7)
|
|
```
|
|
|
|
#### 11.exp
|
|
|
|
> exp 函数
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
exp(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
exp(7)
|
|
```
|
|
|
|
#### 12.d2r
|
|
|
|
> 将角度转换成幅度。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
d2r(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
d2r(7)
|
|
```
|
|
|
|
#### 13.r2d
|
|
|
|
> 将幅度转换成角度。
|
|
----------------------------
|
|
|
|
##### 原型
|
|
|
|
```
|
|
r2d(a) => double
|
|
```
|
|
|
|
##### 示例
|
|
|
|
```
|
|
r2d(7)
|
|
```
|