SinusoidalProjection returns the incorrect results
--------------------------------------------------

                 Key: LUCENE-2519
                 URL: https://issues.apache.org/jira/browse/LUCENE-2519
             Project: Lucene - Java
          Issue Type: Bug
          Components: contrib/spatial
            Reporter: Grant Ingersoll


Currently, the SinusoidalProjection does:
{code}
public double[] coords(double latitude, double longitude) {
    double rlat = Math.toRadians(latitude);
    double rlong = Math.toRadians(longitude);
    double nlat = rlong * Math.cos(rlat);
    return new double[]{nlat, rlong};
    
  }
{code}

But the correct formula (from 
http://en.wikipedia.org/wiki/Sinusoidal_projection) is:
{quote}
x = (gamma - gamma[0]) cos(phi)
y = phi
{quote}
where gamma[0] is assumed to be the prime meridian in this case (0), gamma is 
the incoming longitude and phi is the latitude

Thus, the above code should return:
{quote}
{nlat, rlat}
{quote}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to