Changeset 12131 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2017-05-13T01:12:44+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r11045 r12131 8 8 import static java.lang.Math.sin; 9 9 import static java.lang.Math.sqrt; 10 import static java.lang.Math.toRadians;11 10 import static org.openstreetmap.josm.data.projection.Ellipsoid.WGS84; 12 11 import static org.openstreetmap.josm.tools.I18n.trc; 12 import static org.openstreetmap.josm.tools.Utils.toRadians; 13 13 14 14 import java.awt.geom.Area; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r12100 r12131 286 286 static final int FLAG_OUTERMEMBER_OF_SELECTED = 8; 287 287 288 private static final double PHI = Math.toRadians(20);288 private static final double PHI = Utils.toRadians(20); 289 289 private static final double cosPHI = Math.cos(PHI); 290 290 private static final double sinPHI = Math.sin(PHI); … … 978 978 fromAngle = Math.atan(dy / dx); 979 979 } 980 double fromAngleDeg = Math.toDegrees(fromAngle);980 double fromAngleDeg = Utils.toDegrees(fromAngle); 981 981 982 982 double vx = distanceFromVia * Math.cos(fromAngle); … … 1001 1001 if (pFrom.x >= pVia.x && pFrom.y >= pVia.y) { 1002 1002 if (!leftHandTraffic) { 1003 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg - 90));1004 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg - 90));1003 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg - 90)); 1004 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg - 90)); 1005 1005 } else { 1006 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 90));1007 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 90));1006 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 90)); 1007 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 90)); 1008 1008 } 1009 1009 iconAngle = 270+fromAngleDeg; … … 1011 1011 if (pFrom.x < pVia.x && pFrom.y >= pVia.y) { 1012 1012 if (!leftHandTraffic) { 1013 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg));1014 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg));1013 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg)); 1014 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg)); 1015 1015 } else { 1016 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 180));1017 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 180));1016 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 180)); 1017 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 180)); 1018 1018 } 1019 1019 iconAngle = 90-fromAngleDeg; … … 1021 1021 if (pFrom.x < pVia.x && pFrom.y < pVia.y) { 1022 1022 if (!leftHandTraffic) { 1023 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 90));1024 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 90));1023 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 90)); 1024 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 90)); 1025 1025 } else { 1026 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg - 90));1027 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg - 90));1026 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg - 90)); 1027 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg - 90)); 1028 1028 } 1029 1029 iconAngle = 90+fromAngleDeg; … … 1031 1031 if (pFrom.x >= pVia.x && pFrom.y < pVia.y) { 1032 1032 if (!leftHandTraffic) { 1033 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 180));1034 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 180));1033 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 180)); 1034 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 180)); 1035 1035 } else { 1036 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg));1037 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg));1036 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg)); 1037 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg)); 1038 1038 } 1039 1039 iconAngle = 270-fromAngleDeg; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r11452 r12131 32 32 import org.openstreetmap.josm.gui.NavigatableComponent; 33 33 import org.openstreetmap.josm.gui.draw.MapPath2D; 34 import org.openstreetmap.josm.tools.Utils; 34 35 35 36 /** … … 90 91 91 92 /** Helper variable for {@link #drawSegment} */ 92 private static final ArrowPaintHelper ARROW_PAINT_HELPER = new ArrowPaintHelper( Math.toRadians(20), 10);93 private static final ArrowPaintHelper ARROW_PAINT_HELPER = new ArrowPaintHelper(Utils.toRadians(20), 10); 93 94 94 95 /** Helper variable for {@link #visit(Relation)} */ -
trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
r11893 r12131 18 18 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 19 19 import org.openstreetmap.josm.gui.MapView; 20 import org.openstreetmap.josm.tools.Utils; 20 21 21 22 /** … … 144 145 double cosT = 5 * Math.cos(t); 145 146 double sinT = 5 * Math.sin(t); 146 int deg = (int) Math.toDegrees(t);147 int deg = (int) Utils.toDegrees(t); 147 148 if (selected) { 148 149 g.setColor(getHighlightColor(color));
Note:
See TracChangeset
for help on using the changeset viewer.