math.sincos() 函数
math.sincos()
返回 math.sin(x:x)
和 math.cos(x:x)
的值。
函数类型签名
(x: float) => {sin: float, cos: float}
更多信息,请参阅 函数类型签名。
参数
x
(Required) 要操作的值。
示例
返回值的正弦和余弦
import "math"
math.sincos(x: 1.23)// {cos: 0.3342377271245026, sin: 0.9424888019316975}
在 map 中使用 math.sincos
import "math"
import "sampledata"
sampledata.float()
|> map(
fn: (r) => {
result = math.sincos(x: r._value)
return {_time: r._time, tag: r._tag, sin: result.sin, cos: result.cos}
},
)
此页是否对您有帮助?
感谢您的反馈!