Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static double[] getGaoDePos(double[] baiDu) {
        double X_PI = 3.14159265358979324 * 3000.0 / 180.0;
        double x = baiDu[0] - 0.0065, y = baiDu[1] - 0.006;
        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * X_PI);
        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * X_PI);
        double[] gaode = new double[2];
        gaode[0] = z * Math.cos(theta);
        gaode[1] = z * Math.sin(theta);
        return gaode;
    }
}