This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires: | |
// Leaflet: http://leafletjs.com/ | |
// Leaflet.curve: https://github.com/elfalem/Leaflet.curve | |
// | |
// Assumes: | |
// var map is a Leaflet map and already set up. | |
var latlngs = []; | |
var latlng1 = [LATITUDE, LONGTITUDE], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==== J A V A ================================== | |
/** | |
* Determines the angle of a straight line drawn between point one and two. The number returned, which is a double in degrees, tells us how much we have to rotate a horizontal line clockwise for it to match the line between the two points. | |
* If you prefer to deal with angles using radians instead of degrees, just change the last line to: "return Math.atan2(yDiff, xDiff);" | |
*/ | |
public static double GetAngleOfLineBetweenTwoPoints(Point.Double p1, Point.Double p2) | |
{ | |
double xDiff = p2.x - p1.x; | |
double yDiff = p2.y - p1.y; | |
return Math.toDegrees(Math.atan2(yDiff, xDiff)); |