如何在iphone SDK中获得arctan MATH功能?
什么库/头/类等同于Java Math类?
背景和奖金问题:
我正在尝试将此函数从Java移植到Objective-C.我应该重写它,还是只能复制,粘贴和重写语法不同的部分?(换句话说,如果Java以Objective-C或C运行,它的行为方式是否相同?)
这是Java中的怪物功能.它基本上是Vincinty公式:
private double vincentyFormula(GeoLocation location, int formula) {
double a = 6378137;
double b = 6356752.3142;
double f = 1 / 298.257223563; // WGS-84 ellipsiod
double L = Math.toRadians(location.getLongitude() - getLongitude());
double U1 = Math
.atan((1 - f) * Math.tan(Math.toRadians(getLatitude())));
double U2 = Math.atan((1 - f)
* Math.tan(Math.toRadians(location.getLatitude())));
double sinU1 = Math.sin(U1), cosU1 = Math.cos(U1);
double sinU2 = Math.sin(U2), cosU2 = Math.cos(U2);
double lambda = L;
double lambdaP = 2 * Math.PI;
double …Run Code Online (Sandbox Code Playgroud)