R语言 计算一个数值的反正切 – atan() 函数 R语言中的 atan() 函数用于计算作为参数传递给它的数值的反正切值。 语法: atan(x) 参数: x: 数值 例1 : # R code to calculate inverse tangent of a value # Assigning values to variables x1 <- -1 x2 <- 0.5 # Using atan() Function atan(x1) atan(x2)RCopy 输出 [1] -0.7853982 [1] 0.4636476RCopy 例2 : # R code to calculate inverse tangent of a value # Assigning values to variables x1 <- 0.224587 x2 <- 0.456732 # Using atan() Function atan(x1) atan(x2)RCopy 输出 [1] 0.2209213 [1] 0.4284381RCopy