Proposal: Trigonometric functions in degrees

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Proposal: Trigonometric functions in degrees
Дата
Msg-id CAEZATCXxdzxb2Mvi0-Xvp43tfvw-bUi703HdAJuLUd7dt5-ZgQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Proposal: Trigonometric functions in degrees  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Proposal: Trigonometric functions in degrees  (Emre Hasegeli <emre@hasegeli.com>)
Re: Proposal: Trigonometric functions in degrees  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Currently PostgreSQL only has trigonometric functions that work in
radians. I think it would be quite useful to have an equivalent set of
functions that worked in degrees. In other environments these are
commonly spelled sind(), cosd(), etc.

Partly, this would be a matter of convenience. It's quite common to
have a problem domain where angles are specified in degrees, and it's
somewhat cumbersome having to type things like sin(radians(x)) and
degrees(asin(x)).

Additionally, functions that worked natively in degrees would be able
to return exact answers in special cases like cosd(90) = 0, whereas
cos(radians(90)) is not exactly 0 because pi/2 cannot be represented
exactly as a floating point number.

Possibly the earthdistance module would benefit from these functions too.

Thoughts?

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Freeze avoidance of very large table.
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: JDBC driver debug out?