Returns mercator Y corresponding to latitude. - Java java.lang

Java examples for java.lang:Math Function

Description

Returns mercator Y corresponding to latitude.

Demo Code


//package com.java2s;
import static java.lang.Math.*;

public class Main {
    /**/*from   w w w  .ja  va 2 s  .c  om*/
     * Returns mercator Y corresponding to latitude.
     * See http://en.wikipedia.org/wiki/Mercator_projection .
     */
    static double mercator(double lat) {
        return log(tan(lat * 0.5 + PI / 4));
    }
}

Related Tutorials