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


R語言 tanpi()用法及代碼示例

tanpi()R 語言中的函數用於計算 x 的正切值,它是 pi 的倍數。

用法: tanpi(x)

參數:
x:數值、數組或向量

範例1:


# R program to illustrate 
# tanpi function 
    
# Calling the tanpi() function 
tanpi(0) 
tanpi(1 / 4) 

輸出:

[1] 0
[1] 1

範例2:


# R program to illustrate 
# tanpi function 
    
# Calling the tanpi() function 
tanpi(2 / 3) 
tanpi(1 / 2) 

輸出:

[1] -1.732051
[1] NaN

相關用法


注:本文由純淨天空篩選整理自nidhi_biet大神的英文原創作品 Compute the tangent value which is multiples of pi in R Programming – tanpi() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。