Re: How to select only points which are inside a domain
- To: mathgroup at smc.vnet.net
- Subject: [mg124994] Re: How to select only points which are inside a domain
- From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
- Date: Fri, 17 Feb 2012 06:22:10 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
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
Hi, Ted,
Try the following. This makes your list:
lst=Table[{RandomReal[{-5,5}],RandomReal[{-5,5}],RandomReal[{-5,5}]},{250}];
It yields figures distributed between -5 and 5. Assume further that your domain (from which we only should select) is a cube in the origin with the unit size. Then try this:
Select[lst,-1<#[[1]]<1&&-1<#[[2]]<1&&-1<#[[3]]<1&]
Have fun, Alexei
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch at iee.lu<mailto:alexei.boulbitch at iee.lu>