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.