Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8577
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: How to select only points which are inside a domain |
| Date | 2012-02-17 11:22 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jhlda4$opb$1@smc.vnet.net> (permalink) |
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>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: How to select only points which are inside a domain Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-02-17 11:22 +0000
csiph-web