source/gDel2D/gDel2D/CPU/predicates.cpp
RealType incirclefast
    (
    const RealType *pa,
    const RealType *pb,
    const RealType *pc,
    const RealType *pd
    )
{
    RealType adx, ady, bdx, bdy, cdx, cdy;
    RealType abdet, bcdet, cadet;
    RealType alift, blift, clift;

    adx = pa[0] - pd[0];
    ady = pa[1] - pd[1];
    bdx = pb[0] - pd[0];
    bdy = pb[1] - pd[1];
    cdx = pc[0] - pd[0];
    cdy = pc[1] - pd[1];

    abdet = adx * bdy - bdx * ady;
    bcdet = bdx * cdy - cdx * bdy;
    cadet = cdx * ady - adx * cdy;
    alift = adx * adx + ady * ady;
    blift = bdx * bdx + bdy * bdy;
    clift = cdx * cdx + cdy * cdy;

    return alift * bcdet + blift * cadet + clift * abdet;
}
/*****************************************************************************/
/*                                                                           */
/*  incirclefast()   Approximate 2D incircle test.  Nonrobust.               */
/*  incircleexact()   Exact 2D incircle test.  Robust.                       */
/*  incircleslow()   Another exact 2D incircle test.  Robust.                */
/*  incircle()   Adaptive exact 2D incircle test.  Robust.                   */
/*                                                                           */
/*               Return a positive value if the point pd lies inside the     */
/*               circle passing through pa, pb, and pc; a negative value if  */
/*               it lies outside; and zero if the four points are cocircular.*/
/*               The points pa, pb, and pc must be in counterclockwise       */
/*               order, or the sign of the result will be reversed.          */
/*                                                                           */
/*  Only the first and last routine should be used; the middle two are for   */
/*  timings.                                                                 */
/*                                                                           */
/*  The last three use exact arithmetic to ensure a correct answer.  The     */
/*  result returned is the determinant of a matrix.  In incircle() only,     */
/*  this determinant is computed adaptively, in the sense that exact         */
/*  arithmetic is used only to the degree it is needed to ensure that the    */
/*  returned value has the correct sign.  Hence, incircle() is usually quite */
/*  fast, but will run more slowly when the input points are cocircular or   */
/*  nearly so.                                                               */
/*                                                                           */
/*****************************************************************************/
incirclefast()   Approximate 2D incircle test.  Nonrobust.
incircleexact()   Exact 2D incircle test.  Robust.
incircleslow()   Another exact 2D incircle test.  Robust.
incircle()   Adaptive exact 2D incircle test.  Robust.

Return a positive value if the point pd lies inside the
circle passing through pa, pb, and pc; a negative value if
it lies outside; and zero if the four points are cocircular.
The points pa, pb, and pc must be in counterclockwise
order, or the sign of the result will be reversed.

Only the first and last routine should be used; the middle two are for
timings.

The last three use exact arithmetic to ensure a correct answer.  The
result returned is the determinant of a matrix.  In incircle() only,
this determinant is computed adaptively, in the sense that exact
arithmetic is used only to the degree it is needed to ensure that the
returned value has the correct sign.  Hence, incircle() is usually quite
fast, but will run more slowly when the input points are cocircular or
nearly so.
incirclefast () Approximate 2D incircle test . Nonrobust . incircleexact () Exact 2D incircle test . Robust . incircleslow () Another exact 2D incircle test . Robust . incircle () Adaptive exact 2D incircle test . Robust . Return a positive value if the point pd lies inside the circle passing through pa pb and pc ; a negative value if it lies outside ; and zero if the four points are cocircular . The points pa pb and pc must be in counterclockwise order or the sign of the result will be reversed . Only the first and last routine should be used ; the middle two are for timings . The last three use exact arithmetic to ensure a correct answer . The result returned is the determinant of a matrix . In incircle () only this determinant is computed adaptively in the sense that exact arithmetic is used only to the degree it is needed to ensure that the returned value has the correct sign . Hence incircle () is usually quite fast but will run more slowly when the input points are cocircular or nearly so .
RealType incirclefast
    (
    const RealType *pa,
    const RealType *pb,
    const RealType *pc,
    const RealType *pd
    )
{
    RealType adx, ady, bdx, bdy, cdx, cdy;
    RealType abdet, bcdet, cadet;
    RealType alift, blift, clift;
    adx = pa[0] - pd[0];
    ady = pa[1] - pd[1];
    bdx = pb[0] - pd[0];
    bdy = pb[1] - pd[1];
    cdx = pc[0] - pd[0];
    cdy = pc[1] - pd[1];
    abdet = adx * bdy - bdx * ady;
    bcdet = bdx * cdy - cdx * bdy;
    cadet = cdx * ady - adx * cdy;
    alift = adx * adx + ady * ady;
    blift = bdx * bdx + bdy * bdy;
    clift = cdx * cdx + cdy * cdy;
    return alift * bcdet + blift * cadet + clift * abdet;
}
RealType incirclefast ( const RealType * pa , const RealType * pb , const RealType * pc , const RealType * pd ) { RealType adx , ady , bdx , bdy , cdx , cdy ; RealType abdet , bcdet , cadet ; RealType alift , blift , clift ; adx = pa [ 0 ] - pd [ 0 ] ; ady = pa [ 1 ] - pd [ 1 ] ; bdx = pb [ 0 ] - pd [ 0 ] ; bdy = pb [ 1 ] - pd [ 1 ] ; cdx = pc [ 0 ] - pd [ 0 ] ; cdy = pc [ 1 ] - pd [ 1 ] ; abdet = adx * bdy - bdx * ady ; bcdet = bdx * cdy - cdx * bdy ; cadet = cdx * ady - adx * cdy ; alift = adx * adx + ady * ady ; blift = bdx * bdx + bdy * bdy ; clift = cdx * cdx + cdy * cdy ; return alift * bcdet + blift * cadet + clift * abdet ; }
incirclefast()   Approximate 2D incircle test.
incirclefast () Approximate 2D incircle test .