Skip site navigation (1) Skip section navigation (2)

Small doc patch for area() function...

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Small doc patch for area() function...
Date: 2004-05-28 05:48:41
Message-ID: AC90CAD8-B06A-11D8-9308-000A95C705DC@chittenden.org (view raw or flat)
Thread:
Lists: pgsql-patches
Small patch that adds some documentation for the area() function.   
Specifically, point out that intersecting points in a path will yield  
(most likely), unexpected results.  Visually these are identical paths,  
but mathematically they're not the same.  Ex:

  area |                                           plan
------ 
+----------------------------------------------------------------------- 
-------------------
    -0 | ((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))
     2 | ((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))

The current algorithm for area(PATH) is very quick, but only handles  
non-intersecting paths.  I'm going to work on two other functions for  
the PATH data type that determines if a PATH is intersecting or not,  
and a function that returns the area() for an intersecting PATH.  The  
intersecting area() function will be considerably slower (I think it's  
going to be O(n!) or worse instead of the current O(n), but that comes  
with the territory).

-sc


Attachment: patch.txt
Description: text/plain (1.2 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2004-05-28 06:24:45
Subject: Re: Cancel/Kill backend functions
Previous:From: Tom LaneDate: 2004-05-28 05:30:01
Subject: Re: Cancel/Kill backend functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group