mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Tidied code, added MidPoint to CompoundMark class
Compound Mark class is now constructed with a list of marks. A mid point is created on its construction for use in Geo Calculations #story[1124] #pair[wmu16, hyi25]
This commit is contained in:
@@ -45,6 +45,19 @@ public class GeoUtility {
|
||||
return (Math.toDegrees(getBearingRad(p1, p2)) + 360.0) % 360.0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* WARNING: this function DOES NOT account for wrapping around on lats / longs etc.
|
||||
* SO BE CAREFUL IN USING THIS FUNCTION
|
||||
*
|
||||
* @param p1 GeoPoint 1
|
||||
* @param p2 GeoPoint 2
|
||||
* @return GeoPoint midPoint
|
||||
*/
|
||||
public static GeoPoint getDirtyMidPoint(GeoPoint p1, GeoPoint p2) {
|
||||
return new GeoPoint((p1.getLat() + p2.getLat()) / 2, (p1.getLng() + p2.getLng()) / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the angle between to angular co-ordinates on a sphere in radians.
|
||||
*
|
||||
|
||||
@@ -256,9 +256,9 @@ public class XMLParser {
|
||||
if (cMarkNode.getNodeName().equals("CompoundMark")) {
|
||||
cMark = new CompoundMark(
|
||||
XMLParser.getNodeAttributeInt(cMarkNode, "CompoundMarkID"),
|
||||
XMLParser.getNodeAttributeString(cMarkNode, "Name")
|
||||
XMLParser.getNodeAttributeString(cMarkNode, "Name"),
|
||||
createMarks(cMarkNode)
|
||||
);
|
||||
cMark.addSubMarks(createMarks(cMarkNode));
|
||||
allMarks.add(cMark);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user