function named geopolyCosine is a misnomer

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

function named geopolyCosine is a misnomer

Graham Hardman
Hi,

I was very interested in the numerical approximation used in the
function named geopolyCosine and after a bit of on-line research decided
to test it's accuracy myself. What I discovered was that the function in
fact returns the sin value rather than the cosine value.

This is quickly noticed by checking the return value when r = 0. The
value returned is 0 rather than the expected 1.0

The function is only employed by the geopoly_regular function which I
found does actually return the expected shape (taking into account the
approximation being used).

On checking the geopoly_regular program code I saw that the coordinate
calculation formulae cancel out the incorrect value returned from
geopolyCosine by essentially  reversing the normal understanding of sin
and cosine.

I hope it is understood that I do not wish to offend. I would, in fact
appreciate a link to the site where this approximation was discovered.

regards,

Graham
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: function named geopolyCosine is a misnomer

Thomas Kurz
Could it be that the one angle is north-based, the other one east-based?


----- Original Message -----
From: Graham Hardman <[hidden email]>
To: SQLite mailing list <[hidden email]>
Sent: Thursday, November 29, 2018, 12:46:05
Subject: [sqlite] function named geopolyCosine is a misnomer

Hi,

I was very interested in the numerical approximation used in the
function named geopolyCosine and after a bit of on-line research decided
to test it's accuracy myself. What I discovered was that the function in
fact returns the sin value rather than the cosine value.

This is quickly noticed by checking the return value when r = 0. The
value returned is 0 rather than the expected 1.0

The function is only employed by the geopoly_regular function which I
found does actually return the expected shape (taking into account the
approximation being used).

On checking the geopoly_regular program code I saw that the coordinate
calculation formulae cancel out the incorrect value returned from
geopolyCosine by essentially  reversing the normal understanding of sin
and cosine.

I hope it is understood that I do not wish to offend. I would, in fact
appreciate a link to the site where this approximation was discovered.

regards,

Graham
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: function named geopolyCosine is a misnomer

Richard Hipp-3
On 11/29/18, Thomas Kurz <[hidden email]> wrote:
> Could it be that the one angle is north-based, the other one east-based?

Ha Ha.  No, Graham is right.  I started out writing a Cosine function,
then I switched it over to be a Sine function but failed to change the
name.  A rename has now been committed to trunk, is in the latest
"prerelease snapshot", and will appear in the next official release
(which will also be the first official release that includes the new
capability).

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: function named geopolyCosine is a misnomer

John Gillespie-2
If I missed i tin earlier posts, sorry. Is there any documentation on the
geopoly extension? With possible uses or examples?

John

On Thu, 29 Nov 2018 at 14:39, Richard Hipp <[hidden email]> wrote:

> On 11/29/18, Thomas Kurz <[hidden email]> wrote:
> > Could it be that the one angle is north-based, the other one east-based?
>
> Ha Ha.  No, Graham is right.  I started out writing a Cosine function,
> then I switched it over to be a Sine function but failed to change the
> name.  A rename has now been committed to trunk, is in the latest
> "prerelease snapshot", and will appear in the next official release
> (which will also be the first official release that includes the new
> capability).
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: function named geopolyCosine is a misnomer

Richard Hipp-3
On 12/1/18, John G <[hidden email]> wrote:
> Is there any documentation on the
> geopoly extension?
>

https://www.sqlite.org/search?s=d&q=geopoly
https://www.sqlite.org/geopoly.html

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users