Ignore:
Timestamp:
2016-03-17T01:50:12+01:00 (3 years ago)
Author:
Don-vip
Message:

sonar - Local variable and method parameter names should comply with a naming convention

Location:
trunk/src/org/openstreetmap/josm/data/projection/proj
Files:
8 edited

Legend:

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

    r9998 r10001  
    167167     */
    168168    public double phi1(final double qs) {
    169         final double tone_es = 1 - e2;
     169        final double toneEs = 1 - e2;
    170170        double phi = Math.asin(0.5 * qs);
    171171        if (e < EPSILON) {
     
    178178            final double com   = 1.0 - con*con;
    179179            final double dphi  = 0.5 * com*com / cospi *
    180                     (qs/tone_es - sinpi / com + 0.5/e * Math.log((1. - con) / (1. + con)));
     180                    (qs/toneEs - sinpi / com + 0.5/e * Math.log((1. - con) / (1. + con)));
    181181            phi += dphi;
    182182            if (Math.abs(dphi) <= ITERATION_TOLERANCE) {
     
    194194     */
    195195    private double qsfn(final double sinphi) {
    196         final double one_es = 1 - e2;
     196        final double oneEs = 1 - e2;
    197197        if (e >= EPSILON) {
    198198            final double con = e * sinphi;
    199             return one_es * (sinphi / (1. - con*con) -
     199            return oneEs * (sinphi / (1. - con*con) -
    200200                    (0.5/e) * Math.log((1.-con) / (1.+con)));
    201201        } else {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/DoubleStereographic.java

    r9974 r10001  
    5858    }
    5959
    60     private void initialize(double lat_0) {
    61         double phi0 = toRadians(lat_0);
     60    private void initialize(double lat0) {
     61        double phi0 = toRadians(lat0);
    6262        double e2 = ellps.e2;
    6363        r = sqrt(1-e2) / (1 - e2*pow(sin(phi0), 2));
    6464        n = sqrt(1 + ellps.eb2 * pow(cos(phi0), 4));
    65         double S1 = (1 + sin(phi0)) / (1 - sin(phi0));
    66         double S2 = (1 - e * sin(phi0)) / (1 + e * sin(phi0));
    67         double w1 = pow(S1 * pow(S2, e), n);
     65        double s1 = (1 + sin(phi0)) / (1 - sin(phi0));
     66        double s2 = (1 - e * sin(phi0)) / (1 + e * sin(phi0));
     67        double w1 = pow(s1 * pow(s2, e), n);
    6868        double sinchi00 = (w1 - 1) / (w1 + 1);
    6969        c = (n + sin(phi0)) * (1 - sinchi00) / ((n - sin(phi0)) * (1 + sinchi00));
     
    7474    @Override
    7575    public double[] project(double phi, double lambda) {
    76         double Lambda = n * lambda;
    77         double Sa = (1 + sin(phi)) / (1 - sin(phi));
    78         double Sb = (1 - e * sin(phi)) / (1 + e * sin(phi));
    79         double w = c * pow(Sa * pow(Sb, e), n);
     76        double nLambda = n * lambda;
     77        double sa = (1 + sin(phi)) / (1 - sin(phi));
     78        double sb = (1 - e * sin(phi)) / (1 + e * sin(phi));
     79        double w = c * pow(sa * pow(sb, e), n);
    8080        double chi = asin((w - 1) / (w + 1));
    81         double B = 1 + sin(chi) * sin(chi0) + cos(chi) * cos(chi0) * cos(Lambda);
    82         double x = 2 * r * cos(chi) * sin(Lambda) / B;
    83         double y = 2 * r * (sin(chi) * cos(chi0) - cos(chi) * sin(chi0) * cos(Lambda)) / B;
     81        double b = 1 + sin(chi) * sin(chi0) + cos(chi) * cos(chi0) * cos(nLambda);
     82        double x = 2 * r * cos(chi) * sin(nLambda) / b;
     83        double y = 2 * r * (sin(chi) * cos(chi0) - cos(chi) * sin(chi0) * cos(nLambda)) / b;
    8484        return new double[] {x, y};
    8585    }
     
    9393        double j = atan(x/(g - y)) - i;
    9494        double chi = chi0 + 2 * atan((y - x * tan(j/2)) / (2 * r));
    95         double Lambda = j + 2*i;
    96         double lambda = Lambda / n;
     95        double lambda = (j + 2*i) / n;
    9796        double psi = 0.5 * log((1 + sin(chi)) / (c*(1 - sin(chi)))) / n;
    9897        double phiprev = -1000;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r9600 r10001  
    9191     * Initialize for LCC with 2 standard parallels.
    9292     *
    93      * @param lat_0 latitude of false origin (in degrees)
    94      * @param lat_1 latitude of first standard parallel (in degrees)
    95      * @param lat_2 latitude of second standard parallel (in degrees)
     93     * @param lat0 latitude of false origin (in degrees)
     94     * @param lat1 latitude of first standard parallel (in degrees)
     95     * @param lat2 latitude of second standard parallel (in degrees)
    9696     */
    97     private void initialize2SP(double lat_0, double lat_1, double lat_2) {
    98         this.params = new Parameters2SP(lat_0, lat_1, lat_2);
     97    private void initialize2SP(double lat0, double lat1, double lat2) {
     98        this.params = new Parameters2SP(lat0, lat1, lat2);
    9999
    100         final double m1 = m(toRadians(lat_1));
    101         final double m2 = m(toRadians(lat_2));
     100        final double m1 = m(toRadians(lat1));
     101        final double m2 = m(toRadians(lat2));
    102102
    103         final double t1 = t(toRadians(lat_1));
    104         final double t2 = t(toRadians(lat_2));
    105         final double tf = t(toRadians(lat_0));
     103        final double t1 = t(toRadians(lat1));
     104        final double t2 = t(toRadians(lat2));
     105        final double tf = t(toRadians(lat0));
    106106
    107107        n  = (log(m1) - log(m2)) / (log(t1) - log(t2));
     
    113113     * Initialize for LCC with 1 standard parallel.
    114114     *
    115      * @param lat_0 latitude of natural origin (in degrees)
     115     * @param lat0 latitude of natural origin (in degrees)
    116116     */
    117     private void initialize1SP(double lat_0) {
    118         this.params = new Parameters1SP(lat_0);
    119         final double lat_0_rad = toRadians(lat_0);
     117    private void initialize1SP(double lat0) {
     118        this.params = new Parameters1SP(lat0);
     119        final double lat0rad = toRadians(lat0);
    120120
    121         final double m0 = m(lat_0_rad);
    122         final double t0 = t(lat_0_rad);
     121        final double m0 = m(lat0rad);
     122        final double t0 = t(lat0rad);
    123123
    124         n = sin(lat_0_rad);
     124        n = sin(lat0rad);
    125125        f  = m0 / (n * pow(t0, n));
    126126        r0 = f * pow(t0, n);
     
    129129    /**
    130130     * auxiliary function t
    131      * @param lat_rad latitude in radians
     131     * @param latRad latitude in radians
    132132     * @return result
    133133     */
    134     protected double t(double lat_rad) {
    135         return tan(PI/4 - lat_rad / 2.0)
    136             / pow((1.0 - e * sin(lat_rad)) / (1.0 + e * sin(lat_rad)), e/2);
     134    protected double t(double latRad) {
     135        return tan(PI/4 - latRad / 2.0)
     136            / pow((1.0 - e * sin(latRad)) / (1.0 + e * sin(latRad)), e/2);
    137137    }
    138138
    139139    /**
    140140     * auxiliary function m
    141      * @param lat_rad latitude in radians
     141     * @param latRad latitude in radians
    142142     * @return result
    143143     */
    144     protected double m(double lat_rad) {
    145         return cos(lat_rad) / (sqrt(1 - e * e * pow(sin(lat_rad), 2)));
     144    protected double m(double latRad) {
     145        return cos(latRad) / (sqrt(1 - e * e * pow(sin(latRad), 2)));
    146146    }
    147147
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java

    r9628 r10001  
    3030
    3131    @Override
    32     public double[] project(double lat_rad, double lon_rad) {
    33         return new double[] {Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a};
     32    public double[] project(double latRad, double lonRad) {
     33        return new double[] {Math.toDegrees(lonRad) / a, Math.toDegrees(latRad) / a};
    3434    }
    3535
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java

    r10000 r10001  
    379379            double temp = 1.0 / q;
    380380            double s = 0.5 * (q - temp);
    381             double V = Math.sin(b * x);
    382             double U = (s * singamma0 - V * cosgamma0) / (0.5 * (q + temp));
    383             if (Math.abs(Math.abs(U) - 1.0) < EPSILON) {
     381            double v2 = Math.sin(b * x);
     382            double u2 = (s * singamma0 - v2 * cosgamma0) / (0.5 * (q + temp));
     383            if (Math.abs(Math.abs(u2) - 1.0) < EPSILON) {
    384384                v = 0; // this is actually an error and should be reported to the caller somehow
    385385            } else {
    386                 v = 0.5 * arb * Math.log((1.0 - U) / (1.0 + U));
     386                v = 0.5 * arb * Math.log((1.0 - u2) / (1.0 + u2));
    387387            }
    388388            temp = Math.cos(b * x);
     
    390390                u = ab * x;
    391391            } else {
    392                 u = arb * Math.atan2(s * cosgamma0 + V * singamma0, temp);
     392                u = arb * Math.atan2(s * cosgamma0 + v2 * singamma0, temp);
    393393            }
    394394        } else {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/PolarStereographic.java

    r9998 r10001  
    171171    @Override
    172172    public Bounds getAlgorithmBounds() {
    173         final double CUT = 60;
     173        final double cut = 60;
    174174        if (southPole) {
    175             return new Bounds(-90, -180, CUT, 180, false);
     175            return new Bounds(-90, -180, cut, 180, false);
    176176        } else {
    177             return new Bounds(-CUT, -180, 90, 180, false);
     177            return new Bounds(-cut, -180, 90, 180, false);
    178178        }
    179179    }
  • trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java

    r9628 r10001  
    5050     * Convert lat/lon to east/north.
    5151     *
    52      * @param lat_rad the latitude in radians
    53      * @param lon_rad the longitude in radians
     52     * @param latRad the latitude in radians
     53     * @param lonRad the longitude in radians
    5454     * @return array of length 2, containing east and north value in meters,
    5555     * divided by the semi major axis of the ellipsoid.
    5656     */
    57     double[] project(double lat_rad, double lon_rad);
     57    double[] project(double latRad, double lonRad);
    5858
    5959    /**
  • trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java

    r9628 r10001  
    5656    }
    5757
    58     private void initialize(double lat_0) {
    59         phi0 = toRadians(lat_0);
     58    private void initialize(double lat0) {
     59        phi0 = toRadians(lat0);
    6060        kR = sqrt(1 - ellps.e2) / (1 - (ellps.e2 * pow(sin(phi0), 2)));
    6161        alpha = sqrt(1 + (ellps.eb2 * pow(cos(phi0), 4)));
     
    7878    @Override
    7979    public double[] project(double phi, double lambda) {
    80         double S = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2
     80        double s = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2
    8181            * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + k;
    82         double b = 2 * (atan(exp(S)) - PI / 4);
     82        double b = 2 * (atan(exp(s)) - PI / 4);
    8383        double l = alpha * lambda;
    8484
Note: See TracChangeset for help on using the changeset viewer.