當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python SciPy special.tandg用法及代碼示例

本文簡要介紹 python 語言中 scipy.special.tandg 的用法。

用法:

scipy.special.tandg(x, out=None) = <ufunc 'tandg'>#

角度 x 的正切,以度為單位。

參數

x array_like

角度,以度為單位。

out ndarray,可選

函數結果的可選輸出數組。

返回

標量或 ndarray

與輸入相切。

例子

>>> import numpy as np
>>> import scipy.special as sc

它比直接使用切線更準確。

>>> x = 180 * np.arange(3)
>>> sc.tandg(x)
array([0., 0., 0.])
>>> np.tan(x * np.pi / 180)
array([ 0.0000000e+00, -1.2246468e-16, -2.4492936e-16])

相關用法


注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.special.tandg。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。