[OpenMap Users] Geo.approximateArc

From: Sutphin, William B CIV NUWC NWPT <william.sutphin_at_navy.mil>
Date: Mon, 10 Aug 2009 11:24:36 -0400


I'm using Geo.approximateArc to create wedge to draw at a location.

This is what I do. Forgive the formatting

Geo[] arc;

double angle = 90.0;

Geo origin = Geo.makeGeoDegrees(0.0, 0.0);

Geo left = Geo.offset(origin, Geo.kmToAngle(50.0), -Geo.radians(angle/2.0));
Geo right = Geo.offset(origin, Geo.kmToAngle(50.0), Geo.radians(angle/2.0));

arc = Geo.approximateArc(origin, left, right, Geo.radians(5.0));

this works fine and gives me a nice 90 degree wedge (45 on each side of north, 20 segments).

However, if the angle is greater than 180, this doesn't work. Looking at the source, the method call

double theta = angle(p0, pc, p1);

always returns an angle < 180.0 degrees. So if I send in an angle of 270 (135 on each side of north; -135 to 135) it gets turned into 90.0. Doesn't matter is -135 is turned into 225.

Before I get fancy, I want to make sure I'm not doing something wrong.


Bill Sutphin

[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Aug 10 2009 - 11:36:13 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT