Re: [EXTERNAL] Re: Lack of detailed documentation - Mailing list pgsql-docs
From | Strauss, Randy (ARC-AF)[SGT, INC] |
---|---|
Subject | Re: [EXTERNAL] Re: Lack of detailed documentation |
Date | |
Msg-id | 3D8A56AB-AC13-46D7-B72B-B913A4ACDA7D@nasa.gov Whole thread Raw |
In response to | Re: Lack of detailed documentation (Tom Lane <tgl@sss.pgh.pa.us>) |
List | pgsql-docs |
Yes, I figured this out. People shouldn't have to figure out that the 2 numbers in the vector are the scale and rotation. They could be the rotation and scale. The rotation could be in degrees or radians. This is documentation- it should explain it. And yes, does it rotate around its center, or the origin? And this was just one example. Every friggin' one of them needs to be documented. I'm not demanding that they be done right away, but there should be a description of each. They can all start with TBD... -r Randy Strauss, desk: 650-604-0431 (Bldg N210, Rm 145, Cube 36) On 2/9/20, 8:09 AM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote: "David G. Johnston" <david.g.johnston@gmail.com> writes: > On Fri, Feb 7, 2020 at 4:53 PM PG Doc comments form <noreply@postgresql.org> > wrote: >> On: https://urldefense.proofpoint.com/v2/url?u=https-3A__www.postgresql.org_docs_current_functions-2Dgeometry.html&d=DwIBAg&c=ApwzowJNAKKw3xye91w7BE1XMRKi2LN9kiMk5Csz9Zk&r=0XRgt7H2WP_TiC5qNss_VhvfCsa-0F_Mw2WUm8TRNiA&m=IDBm4StAmus_A2EYOJRshLFkAAflIS2G74fY7Dhjpag&s=ZuX_8udUWIRdOV5aFxQKHppjdkUgMrhz0mg68HmdTlo&e= >> 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
pgsql-docs by date: