[Haskell-cafe] Find a point inside (x,y,z) -> Bool
Atze van der Ploeg
atzeus at gmail.com
Thu Oct 29 09:23:35 UTC 2015
This representation ((x,y,z) _> bool) makes it very hard to find a point
inside. Basically it does not give you any info: does the shape have area?
What is it bounding box? Is it convex? Supposing x y and z are rationals
(arbitrary precision), then all these questions are not computable. I
suggest you use a different representation, such as a list of points for a
polygon.
On Oct 29, 2015 10:13 AM, "Jonas Scholl" <anselm.scholl at tu-harburg.de>
wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> You could try to use a data structure like a kd-tree, which can find the
> nearest neighbours to your point quite efficient.
>
> On 10/29/2015 10:01 AM, martin wrote:
> > Hello all, > > I hope this is not a too silly question. It goes like
> this: > >
> Suppose I have a shape defined as > > (x,y,z) -> Bool > > how can I find
> a Point inside this shape? Obviously I could iterate through all
> possible x,y and z, but this appears > very expensive. > > There may be
> no point at all at x=0. With brute force iteration I would have no clue
> that the False I am receiving with > (0,1,1) is caused by x=0 and I may
> nedlessly try all combinations of y and z without ever receiving a True.
> > > Are there any alternative ways of finding points inside a shape? > >
> _______________________________________________ > Haskell-Cafe mailing
> list > Haskell-Cafe at haskell.org >
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBCAAGBQJWMeMHAAoJEM0PYZBmfhoBcKUH/04/jSdP3660Ld1uWgK2P9BB
> iqAB4NnrRaCNbFNLSY6vNz1lFVm8p9ygxzZ4i+wfNbpa9V8tOvx2E2NJXaq/mLOr
> CDV9lS0LoQNWQCE41bH7QmEoK3ZiJjX1X0NolLpS2oBYhY1Jvwy/X8IUqoXAqZiu
> y+8CkExpJEL8dHmNXHwB4OmfRstRdcTumf/SVNhzwoHO+q+u8wz3d5PRSkCLSooB
> a5voFRdQpicfInzpW57+MHaQJtc1FtQ/+Ub4NQGh+rw5Npps/blQbvqgt/u1qcXL
> VwJqEonmF4T3NFxYAzfMR6rv/36MZcd39DK1+H2O5IrzIZXnXy007fw7irkiQ+0=
> =IIRy
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151029/076ef064/attachment.html>
More information about the Haskell-Cafe
mailing list