Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as Java by Kiran ( 14 years ago )
double latitude = Double.valueOf(location.getLatitude());
           double longitude = Double.valueOf(location.getLongitude());

           latitude = latitude * Math.PI / 180;
           longitude = longitude * Math.PI / 180;

           double x = EARTH_RADIUS * Math.sin(latitude) * Math.cos(longitude);
           double y = EARTH_RADIUS * Math.sin(latitude) * Math.sin(longitude);
           double z = EARTH_RADIUS * Math.cos(latitude);

           double projectedX = x * FOCAL_LENGTH / (FOCAL_LENGTH + z);
           double projectedY = y * FOCAL_LENGTH / (FOCAL_LENGTH + z);

 

Revise this Paste

Your Name: Code Language: