Logo Search packages:      
Sourcecode: javamorph version File versions  Download package

static boolean javamorph::CTriangulation::delaunayCond (  )  [inline, static, private]

Check the DELAUNAY condition of P1 P2 and PNEW. No other point shall be within the circumcircle of the three points.

Returns:
true if DELAUNAY condition is satisfied.

Definition at line 173 of file CTriangulation.java.

References circle_radius, distance(), p1, p2, pnew, points, and used.

Referenced by findPoint().

                                         {
        CLine 
            l1 = new CLine(p1, pnew), 
            l2 = new CLine(p2, pnew);
        for(Point p: points){
            double d = distance(p);
            if(!p.equals(pnew) && !p.equals(p1) && !p.equals(p2)){
                if(d < circle_radius){
                    return false;
                }
            }
        }
        for(CLine l: used){
            if(l.cross(l1) || l.cross(l2)){
                return false;
            }
        }
        return true;
    }


Generated by  Doxygen 1.6.0   Back to index