Changeset 29205 in osm for applications/editors/josm/plugins
- Timestamp:
- 2013-01-19T23:33:23+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r29204 r29205 208 208 while (curr.distance(next) >= len) { 209 209 if (piv) { 210 succ = new Point2D.Double(prev.getX() + (len * Math.cos(angle)), prev.getY() + (len * Math.sin(angle))); 210 double rem = len; 211 double s = prev.distance(next); 212 double p = curr.distance(prev); 213 if (p > 0) { 214 double n = curr.distance(next); 215 double beta = Math.acos((s * s + p * p - n * n) / 2 / s / p); 216 double gamma = Math.asin(p / len * Math.sin(beta)); 217 double alpha = Math.PI - beta - gamma; 218 rem = len * Math.sin(alpha) / Math.sin(beta); 219 } 220 succ = new Point2D.Double(prev.getX() + (rem * Math.cos(angle)), prev.getY() + (rem * Math.sin(angle))); 211 221 piv = false; 212 222 } else { … … 214 224 } 215 225 if (!gap) { 216 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2(succ.getY() - curr.getY(), succ.getX() - curr.getX())+Math.toRadians(90))), null); 226 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), 227 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2(succ.getY() - curr.getY(), succ.getX() - curr.getX())+Math.toRadians(90))), null); 217 228 } 218 229 if (space > 0) gap = !gap;
Note:
See TracChangeset
for help on using the changeset viewer.