Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8561
| From | Ray Koopman <koopman@sfu.ca> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: How to select only points which are inside a domain |
| Date | 2012-02-16 08:31 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jhies5$b5f$1@smc.vnet.net> (permalink) |
| References | <201202091034.FAA18221@smc.vnet.net> <201202101057.FAA00780@smc.vnet.net> |
On Feb 15, 1:42 am, Ted Sariyski <tsari...@craft-tech.com> 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
pts = Point /@ RandomReal[1,{10,3}]
{Point[{0.954633, 0.471902, 0.0731487}],
Point[{0.967115, 0.448343, 0.138532}],
Point[{0.0689816, 0.621088, 0.957534}],
Point[{0.47981, 0.681518, 0.351431}],
Point[{0.412179, 0.221469, 0.743002}],
Point[{0.699619, 0.272222, 0.84906}],
Point[{0.950494, 0.842014, 0.113386}],
Point[{0.0584834, 0.645106, 0.983113}],
Point[{0.198335, 0.21592, 0.681302}],
Point[{0.820813, 0.789445, 0.698693}]}
dom = Interval /@ Sort /@ RandomReal[1,{3,2}]
{Interval[{0.361566, 0.708194}],
Interval[{0.138505, 0.759585}],
Interval[{0.348656, 0.791273}]}
Select[pts, Inner[IntervalMemberQ, dom, Sequence@@#, And]& ]
{Point[{0.47981, 0.681518, 0.351431}],
Point[{0.412179, 0.221469, 0.743002}]}
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: How to select only points which are inside a domain Ray Koopman <koopman@sfu.ca> - 2012-02-16 08:31 +0000
csiph-web