fixed determination of average cosine where during the refactoring a getLatRad/getLngRad accidentally became getLatitude/getLongitude which is not radians but degrees

This commit is contained in:
Axel Uhl committed 2015-04-07 22:11:02 +02:00
1 parent 0ea7e2f106
commit 9e4635abd0
1 file changed
+2 -1
@@ -152,7 +152,8 @@ public class Swarm implements TimeListener {
double boundsWidthpx = Math.abs(boundsNEpx.x - boundsSWpx.x);
double boundsHeightpx = Math.abs(boundsSWpx.y - boundsNEpx.y);
this.nParticles = (int)Math.round(Math.sqrt(boundsWidthpx * boundsHeightpx) * this.field.getParticleFactor() * this.parameters.swarmScale);
cosineOfAverageLatitude = Math.cos((visibleBoundsOfField.getSouthWest().getLatitude()+visibleBoundsOfField.getNorthEast().getLatitude())/2);
cosineOfAverageLatitude = Math.cos((visibleBoundsOfField.getSouthWest().getLatitude()/180.*Math.PI+
visibleBoundsOfField.getNorthEast().getLatitude()/180.*Math.PI)/2);
};
//native void log(String message) /*-{