本文簡要介紹 python 語言中  numpy.arccos  的用法。
- 用法:- numpy.arccos(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True [, signature, extobj ]) = <ufunc 'arccos'>
- 三角函數反餘弦,逐元素。 - cos的逆,因此,如果- y = cos(x),則- x = arccos(y)。- x: array_like
- 單位圓上的 x 坐標。對於實參數,域是 [-1, 1]。 
- out: ndarray,None,或 ndarray 和 None 的元組,可選
- 存儲結果的位置。如果提供,它必須具有輸入廣播到的形狀。如果未提供或 None,則返回一個新分配的數組。元組(隻能作為關鍵字參數)的長度必須等於輸出的數量。 
- where: 數組,可選
- 此條件通過輸入廣播。在條件為真的位置,out數組將設置為 ufunc 結果。在其他地方,out數組將保留其原始值。請注意,如果未初始化out數組是通過默認創建的 - out=None,其中條件為 False 的位置將保持未初始化狀態。
- **kwargs:
- 對於其他僅關鍵字參數,請參閱 ufunc 文檔。 
 
- angle: ndarray
- 射線在給定 x 坐標處與單位圓相交的角度,以弧度 [0, pi] 為單位。如果 x 是標量,則這是一個標量。 
 
 - 參數:- 返回:- 注意:- arccos是一個多值函數:對於每個x有無數個數z這樣- cos(z) = x.約定是返回角度z真正的部分在於[0, π].- 對於實值輸入數據類型, - arccos總是返回真實的輸出。對於每個不能表示為實數或無窮大的值,它產生- nan並設置無效的浮點錯誤標誌。- 對於complex-valued 輸入, - arccos是具有分支切割的複解析函數- [-inf, -1]和[1, inf]並且從上到上是連續的,從下到後是連續的。- 逆numpy.cos也被稱為阿科斯或cos^-1。 - 參考:- M. Abramowitz 和 I.A. Stegun,“數學函數手冊”,第 10 次印刷,1964 年,第 79 頁。https://personal.math.ubc.ca/~cbm/aands/page_79.htm - 例子:- 我們期望 1 的 arccos 為 0,-1 的 arccos 為 pi: - >>> np.arccos([1, -1]) array([ 0. , 3.14159265])- 繪製 arccos: - >>> import matplotlib.pyplot as plt >>> x = np.linspace(-1, 1, num=100) >>> plt.plot(x, np.arccos(x)) >>> plt.axis('tight') >>> plt.show()  
相關用法
- Python numpy arccosh用法及代碼示例
- Python numpy arctan用法及代碼示例
- Python numpy arctan2用法及代碼示例
- Python numpy arctanh用法及代碼示例
- Python numpy arcsinh用法及代碼示例
- Python numpy arcsin用法及代碼示例
- Python numpy argpartition用法及代碼示例
- Python numpy array用法及代碼示例
- Python numpy array_repr用法及代碼示例
- Python numpy around用法及代碼示例
- Python numpy array2string用法及代碼示例
- Python numpy arange用法及代碼示例
- Python numpy argsort用法及代碼示例
- Python numpy array_equiv用法及代碼示例
- Python numpy array_str用法及代碼示例
- Python numpy array_equal用法及代碼示例
- Python numpy argmin用法及代碼示例
- Python numpy argmax用法及代碼示例
- Python numpy argwhere用法及代碼示例
- Python numpy array_split用法及代碼示例
- Python numpy asscalar用法及代碼示例
- Python numpy any用法及代碼示例
- Python numpy ascontiguousarray用法及代碼示例
- Python numpy asarray_chkfinite用法及代碼示例
- Python numpy all用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.arccos。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
