1
Development / Re: Creating a controller program
« on: February 12, 2014, 02:47:35 AM »
changed TerrainLat(1) to 30 as I think I had that wrong but still same depth at the beginning.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
private const double EARTH_RADIUS = 6371000; //in meters
double dTerrainXWidth = dTerrainLongExtent * 2 * Math.PI * EARTH_RADIUS * Math.Cos(dTerrainLat + (dTerrainLatExtent / 2)) / 360;
double dTerrainZWidth = dTerrainLatExtent * 2 * Math.PI * EARTH_RADIUS / 360;
double Longitude = (dXPosition * dTerrainLongExtent / dTerrainXWidth) + dTerrainLong;
double Latitude = (dZPosition * dTerrainLatExtent / dTerrainZWidth) + dTerrainLat;