Changeset 11549 in josm
 Timestamp:
 20170210T15:44:42+01:00 (3 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/org/openstreetmap/josm/data/projection/proj/TransverseMercator.java
r10748 r11549 47 47 * at the time of migration. 48 48 * <p> 49 * 49 * The nonstandard parameter <code>gamma</code> has been added as a method 50 * to rotate the projected coordinates by a certain angle (clockwise, see 51 * {@link ObliqueMercator}). 52 * <p> 50 53 * <b>References:</b> 51 54 * <ul> … … 107 110 private double ml0; 108 111 112 /** 113 * The rectified bearing of the central line, in radians. 114 */ 115 protected double rectifiedGridAngle; 116 117 /** 118 * Sine and Cosine values for the coordinate system rotation angle 119 */ 120 private double sinrot, cosrot; 121 109 122 @Override 110 123 public String getName() { … … 125 138 latitudeOfOrigin = params.lat0 == null ? 0 : Math.toRadians(params.lat0); 126 139 ml0 = mlfn(latitudeOfOrigin, Math.sin(latitudeOfOrigin), Math.cos(latitudeOfOrigin)); 140 141 if (params.gamma != null) { 142 rectifiedGridAngle = Math.toRadians(params.gamma); 143 } else { 144 rectifiedGridAngle = 0.0; 145 } 146 sinrot = Math.sin(rectifiedGridAngle); 147 cosrot = Math.cos(rectifiedGridAngle); 148 127 149 } 128 150 … … 131 153 double sinphi = Math.sin(y); 132 154 double cosphi = Math.cos(y); 155 double u, v; 133 156 134 157 double t = (Math.abs(cosphi) > EPSILON) ? sinphi/cosphi : 0; … … 151 174 FC7 * als * (61.0+ t*(t*(179.0  t)  479.0))))); 152 175 176 u=y; v=x; 177 x = v * cosrot + u * sinrot; 178 y = u * cosrot  v * sinrot; 179 153 180 return new double[] {x, y}; 154 181 } … … 156 183 @Override 157 184 public double[] invproject(double x, double y) { 185 double v = x * cosrot  y * sinrot; 186 double u = y * cosrot + x * sinrot; 187 x=v; y=u; 188 158 189 double phi = invMlfn(ml0 + y); 159 190
Note: See TracChangeset
for help on using the changeset viewer.