Submitted by TomL_12953 on Wed, 10/20/2010 - 09:46.

Here are a couple functions that will make your life much easier (see http://www.cs.dartmouth.edu/~afra/ct/handouts/lischinski.pdf) FUNCTION TriArea(x1,y1,x2,y2,x3,y3)
! Returns twice the area of the oriented triangle, i.e., the
! area is positive if the triangle is oriented counterclockwise.

FUNCTION InCircle(x1,y1,x2,y2,x3,y3,x4,y4)
! Returns 1 if the point (x4,y4) is inside the circle defined by the
! points x1,y1, x2,y2, x3,y3, 0 otherwise. See Guibas and Stolfi (1985) p.107.

IF (x1*x1 + y1*y1) * TriArea(x2,y2,x3,y3,x4,y4) -(x2*x2 + y2*y2) * TriArea(x1,y1,x3,y3,x4,y4) + (x3*x3 + y3*y3) * TriArea(x1,y1,x2,y2,x4,y4) -(x4*x4 + y4*y4) * TriArea(x1,y1,x2,y2,x3,y3) > 0 THEN
LET InCircle = 1
ELSE
LET InCircle = 0
END IF

Learn to program in True BASIC with this popular book featuring sample code and step-by-step instructions that will have you quickly creating your own programs.

## Comments

## Re: Delaunay triangulation

Here are a couple functions that will make your life much easier (see http://www.cs.dartmouth.edu/~afra/ct/handouts/lischinski.pdf)

`FUNCTION TriArea(x1,y1,x2,y2,x3,y3)`

! Returns twice the area of the oriented triangle, i.e., the

! area is positive if the triangle is oriented counterclockwise.

LET TriArea = (x2 - x1)*(y3 - y1) - (y2 - y1)*(x3 - x1)

END FUNCTION

FUNCTION InCircle(x1,y1,x2,y2,x3,y3,x4,y4)

! Returns 1 if the point (x4,y4) is inside the circle defined by the

! points x1,y1, x2,y2, x3,y3, 0 otherwise. See Guibas and Stolfi (1985) p.107.

IF (x1*x1 + y1*y1) * TriArea(x2,y2,x3,y3,x4,y4) -(x2*x2 + y2*y2) * TriArea(x1,y1,x3,y3,x4,y4) + (x3*x3 + y3*y3) * TriArea(x1,y1,x2,y2,x4,y4) -(x4*x4 + y4*y4) * TriArea(x1,y1,x2,y2,x3,y3) > 0 THEN

LET InCircle = 1

ELSE

LET InCircle = 0

END IF

END FUNCTION