Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ttijp-00009Q-MP for pgsql-general@arkaria.postgresql.org; Fri, 11 Jan 2013 17:49:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ttijo-0002xD-J4 for pgsql-general@arkaria.postgresql.org; Fri, 11 Jan 2013 17:49:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ttijn-0002x5-MV for pgsql-general@postgresql.org; Fri, 11 Jan 2013 17:49:51 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ttijh-00017W-Rg for pgsql-general@postgresql.org; Fri, 11 Jan 2013 17:49:50 +0000 Received: from [10.1.1.3] (60-234-150-59.bitstream.orcon.net.nz [60.234.150.59]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id r0BHnbur031801 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 12 Jan 2013 06:49:38 +1300 Message-ID: <50F050B1.2070107@archidevsys.co.nz> Date: Sat, 12 Jan 2013 06:49:37 +1300 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Bosco Rama CC: PostGIS Users Discussion , pgsql-general List Subject: Re: [postgis-users] Query with LIMIT but as random result set? References: <20130110202824.255780@gmx.com> <50F04C66.50209@archidevsys.co.nz> <50F04FA5.4050809@boscorama.com> In-Reply-To: <50F04FA5.4050809@boscorama.com> Content-Type: multipart/alternative; boundary="------------020703010905010007050306" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------020703010905010007050306 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/01/13 06:45, Bosco Rama wrote: > On 01/11/13 09:31, Gavin Flower wrote: >> -- theta in radians >> -- for radius = 100 >> >> INSERT INTO ranpoint >> (id, theta, r) >> VALUES >> (generate_series(1, 10), pi() * random(), 100 * random()); > Shouldn't the value for theta be: > 2 * pi() * random() > > Bosco. > > Very definitely! :-) Me bad, as the saying goes... Cheers, Gavin --------------020703010905010007050306 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mbx.knossos.net.nz id r0BHnbur031801
On 12/01/13 06:45, Bosco Rama wrote:
On 01/11/13 09:31, Gavin Flower wrote:
-- theta in radians
-- for radius =3D 100

INSERT INTO ranpoint
     (id, theta, r)
VALUES
     (generate_series(1, 10), pi() * random(), 100 * random());
Shouldn't the value for theta be:
     2 * pi() * random()

Bosco.


Very definitely!=C2=A0 :-)

Me bad, as the saying goes...


Cheers,
Gavin
--------------020703010905010007050306--