(pa, pb, pc)
| 1618 | } |
| 1619 | |
| 1620 | REAL orient2d(pa, pb, pc) |
| 1621 | REAL *pa; |
| 1622 | REAL *pb; |
| 1623 | REAL *pc; |
| 1624 | { |
| 1625 | REAL detleft, detright, det; |
| 1626 | REAL detsum, errbound; |
| 1627 | |
| 1628 | detleft = (pa[0] - pc[0]) * (pb[1] - pc[1]); |
| 1629 | detright = (pa[1] - pc[1]) * (pb[0] - pc[0]); |
| 1630 | det = detleft - detright; |
| 1631 | |
| 1632 | if (detleft > 0.0) { |
| 1633 | if (detright <= 0.0) { |
| 1634 | return det; |
| 1635 | } else { |
| 1636 | detsum = detleft + detright; |
| 1637 | } |
| 1638 | } else if (detleft < 0.0) { |
| 1639 | if (detright >= 0.0) { |
| 1640 | return det; |
| 1641 | } else { |
| 1642 | detsum = -detleft - detright; |
| 1643 | } |
| 1644 | } else { |
| 1645 | return det; |
| 1646 | } |
| 1647 | |
| 1648 | errbound = ccwerrboundA * detsum; |
| 1649 | if ((det >= errbound) || (-det >= errbound)) { |
| 1650 | return det; |
| 1651 | } |
| 1652 | |
| 1653 | return orient2dadapt(pa, pb, pc, detsum); |
| 1654 | } |
| 1655 | |
| 1656 | /*****************************************************************************/ |
| 1657 | /* */ |
no test coverage detected