convert Meters To Pixels - Java java.lang

Java examples for java.lang:Math Convert

Description

convert Meters To Pixels

Demo Code


//package com.java2s;

public class Main {
    static public double convertMetersToPixels(double meters,
            double latitude, int zoom) {
        return meters
                / ((Math.cos(latitude * Math.PI / 180.0) * 2 * Math.PI * 6378137) / (256 * Math
                        .pow(2, zoom)));
    }/*from   w w w.jav  a  2 s .  c o m*/
}

Related Tutorials