Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8556

Re: How to select only points which are inside a domain (cont)

From Christoph Lhotka <christoph.lhotka@fundp.ac.be>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to select only points which are inside a domain (cont)
Date 2012-02-16 08:27 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jhiemd$b39$1@smc.vnet.net> (permalink)

Show all headers | View raw


hi,

if you define the domain as a distance r from a point {mx,my,mz} you 
could use:

r=1:
{mx,my,mz}={.5,.5,-1}:
dat0 = Table[RandomReal[{-2, 2}, 3], {100}];
dat = Select[dat0, EuclideanDistance[{mx, my, mz}, #] < r &];
Graphics3D[{{Opacity[.2], Sphere[{mx, my, mz}, r]}, Point[dat]}]

best,

christoph

n 02/15/2012 10:41 AM, Ted Sariyski wrote:
> This works, but I think there is a better way.
> Thanks,
> --Ted
>
> Point @@@
>    Select[List @@@
>      pointsK[1], (#[[1, 1]]>= wMin&&  #[[1, 1]]<  wMax&&  #[[1, 2]]>=
>         tMin&&  #[[1, 2]]<  tMax )&]
>
> On 02/14/2012 04:30 PM, Ted Sariyski wrote:
>> Hi,
>> I have a list of points: pntL={Point[x1,y1,z1],...}. How to select
>> only points which are inside a domain {xmin,xmax,ymin,ymax,zmin,zmax}?
>> Thanks in advance,
>> --Ted
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: How to select only points which are inside a domain (cont) Christoph Lhotka <christoph.lhotka@fundp.ac.be> - 2012-02-16 08:27 +0000

csiph-web