Ignore:
Timestamp:
2016-01-12T17:39:45+01:00 (4 years ago)
Author:
bastiK
Message:

add Albers Equal Area Projection and Polar Stereographic Projection (see #12186)
(imports pieces of code from the Geotools project)

Location:
trunk/src/org/openstreetmap/josm/data/projection/proj
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java

    r9132 r9419  
    5353
    5454    /**
     55     * Ellipsoid excentricity, equals to <code>sqrt({@link #excentricitySquared})</code>.
     56     * Value 0 means that the ellipsoid is spherical.
     57     *
     58     * @see #excentricitySquared
     59     */
     60    protected double e;
     61
     62    /**
    5563     * The square of excentricity: e² = (a²-b²)/a² where
    5664     * <var>e</var> is the excentricity,
     
    6371    public void initialize(ProjParameters params) throws ProjectionConfigurationException {
    6472        e2 = params.ellps.e2;
     73        e = params.ellps.e;
    6574        //  Compute constants for the mlfn
    6675        double t;
     
    134143        }
    135144    }
     145
     146    /**
     147     * Computes function <code>f(s,c,e²) = c/sqrt(1 - s²&times;e²)</code> needed for the true scale
     148     * latitude (Snyder 14-15), where <var>s</var> and <var>c</var> are the sine and cosine of
     149     * the true scale latitude, and <var>e²</var> is the {@linkplain #excentricitySquared
     150     * eccentricity squared}.
     151     */
     152    final double msfn(final double s, final double c) {
     153        return c / Math.sqrt(1.0 - (s*s) * e2);
     154    }
     155
     156    /**
     157     * Computes function (15-9) and (9-13) from Snyder.
     158     * Equivalent to negative of function (7-7).
     159     */
     160    final double tsfn(final double lat, double sinlat) {
     161        sinlat *= e;
     162        /*
     163         * NOTE: change sign to get the equivalent of Snyder (7-7).
     164         */
     165        return Math.tan(0.5 * (Math.PI/2 - lat)) / Math.pow((1 - sinlat) / (1 + sinlat), 0.5*e);
     166    }
    136167}
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java

    r8346 r9419  
    1414    public Double lat1;
    1515    public Double lat2;
     16    public Double lat_ts;
    1617}
Note: See TracChangeset for help on using the changeset viewer.