数学 - 如何计算arccos公式?

时间:2013-12-08 13:23:56

标签: math formula cos

任何人都可以帮我计算Arccos(X)吗?用一些配方? 我正试图在某些环境(SAP WEBI)中使用有限的数学公式。 (只有cos,罪,tan ..)。

3 个答案:

答案 0 :(得分:1)

您可以尝试使用Newton的方法:

function acos(a) {
    delta = 1e-5
    // a lousy first approximation
    x = pi*(1-a)/2
    last = x
    x += (cos x-a)/sin x
    while ( abs(x-last) > delta ) {
        last = x
        x += (cos x-a)/sin x
    }
    return x
}

答案 1 :(得分:0)

来自https://en.wikipedia.org/wiki/Inverse_trigonometric_functions

# for -1 < x <= +1 :
acos(x) == 2*atan( sqrt(1-x*x)/(1+x) )

答案 2 :(得分:-1)

在WEBI中,没有办法计算ACOS,因此有两种解决方案:

  

1)在c ++中创建一个新的自定义函数并将其导入WEBI

  

2)创建一个Universe并在那里使用ACOS。

莫尔

相关问题