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


Groups > comp.soft-sys.math.mathematica > #8577 > unrolled thread

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

Started byAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
First post2012-02-17 11:22 +0000
Last post2012-02-17 11:22 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: How to select only points which are inside a domain Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-02-17 11:22 +0000

#8577 — Re: How to select only points which are inside a domain

FromAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
Date2012-02-17 11:22 +0000
SubjectRe: How to select only points which are inside a domain
Message-ID<jhlda4$opb$1@smc.vnet.net>
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@iee.lu<mailto:alexei.boulbitch@iee.lu>





[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web