convert Pixels To Meters - Java java.lang

Java examples for java.lang:Math Convert

Description

convert Pixels To Meters

Demo Code


//package com.java2s;

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

Related Tutorials