MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


On Feb 15, 1:42 am, Ted Sariyski <tsari... at 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}]}



  • Prev by Date: Re: How to select only points which are inside a domain (cont)
  • Next by Date: How to layout a planar graph so that it doesn't have any intersecting edges?
  • Previous by thread: How to select only points which are inside a domain (cont)
  • Next by thread: Re: ListInterpolate and missing values