Re: SQL challenge
Date: Thu, 15 Jul 2004 10:10:22 -0700
Message-ID: <14zJc.32$K9.202_at_news.oracle.com>
"Mikito Harakiri" <mikharakiri_at_iahu.com> wrote in message
news:TnlJc.35$P_2.169_at_news.oracle.com...
> select pa.x, pa.y, pa.z,
> pb.x, pb.y, pb.z
> from Points pa, Points pb
> where not exists (
> select 0 from Points p1, Points p2, Points p3, Points p4
> where Inside(pa, p1, p2, p3, p4)
> ) and not exists (
> select 0 from Points p1, Points p2, Points p3, Points p4
> where Inside(pb, p1, p2, p3, p4)
> ) and not exists (
> select 0 from Points p1, Points p2, Points p3, Points p4
> where Inside(Middle(pa,pb), p1, p2, p3, p4)
> and pa != p1 and pa != p2 and pa != p3 and pa != p4
> and pb != p1 and pb != p2 and pb != p3 and pb != p4
> )
Though, this would hardly qualify as "elegant as well".
Here one more idea to check.
Find H-polyhedron first (definition in
http://www.ifor.math.ethz.ch/staff/fukuda/polyfaq/polyfaq.html).
H-polyhedron (and V-polyhedron) are fundamental so that we can expect
succinct SQL query.
Check how many equalities from H-polyhedron representation the middle point of [pa, pb] meet. If 2, then it's the edge of the polyhedra... Received on Thu Jul 15 2004 - 19:10:22 CEST