Re: Lack of detailed documentation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: randolph(dot)a(dot)strauss(at)nasa(dot)gov, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Lack of detailed documentation
Date: 2020-02-09 16:08:55
Message-ID: 6537.1581264535@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Fri, Feb 7, 2020 at 4:53 PM PG Doc comments form <noreply(at)postgresql(dot)org>
> wrote:
>> On: https://www.postgresql.org/docs/current/functions-geometry.html
>> The functions aren't defined, nor have pointers. For instance:
>> * Scaling/rotation box '((0,0),(1,1))' * point '(2.0,0)'
>> I see how it can be scaling (or shearing), but how does it do rotation?
>> Or maybe when the points x^2+y^2 == 1, it's interpreted at rotation?

> Google: "box point multiplication postgres" came up with the follow book
> section:
> Haven't independently confirm the math but it sounds reasonable...

I responded to the OP about this but unaccountably forgot to cc the list.
The two main points were:

* Per high-school-level vector geometry, rotation around the origin
by an angle theta is equivalent to multiplying by the vector
(cos(theta), sin(theta)). (So no, the book section you quoted isn't
quite right :-(.) But we can't go and offer a geometry course on
this page.

* While this works for rotating points, paths, and circles, it
doesn't really work for rotating boxes, because for any rotation
angle that's not a multiple of 90 degrees, you'd need to end up with
a tilted box ... and our box type has no notion of tilted. The
specified corners rotate to the right places, but the box size isn't
preserved.

So it seems fairly unfortunate to me that the two examples of
scaling/rotation use a box as the LHS. I could get behind changing
them to use, say, a path as LHS. But I don't think there's room to
explain how to do rotation if you don't know that already, any more
than (say) our explanation of aggregate functions tries to explain
statistics.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2020-02-09 17:03:06 Re: 9.4. String Functions and Operators page does not document that encode adds line breaks
Previous Message Tom Lane 2020-02-09 15:49:50 Re: 9.4. String Functions and Operators page does not document that encode adds line breaks