Suppose that triangle A has corner points p1 = (x1, y1), p2 = (x2, y2) and p3 = (x3, y3). Then the area of triangle A is |d1 + d2 + d3|/2 where
d1 = x1y2 - x2y1,
d2 = x2y3 - x3y2
d3 = x3y1 - x1y3.

Write a straight-line program that defines x1 = 0.0, y1 = 0.0, x2 = 4.0, y2 = 6.0, x3 = 8.0 and y3 = 0.0, defines d1, d2 and d3, then defines area to be the area of the triangle. Use names x1 for x1, y1 for y1, etc. Remember that abs(x) is the absolute value of x.

 

    [Language: Cinnameg  Kind: statements]