Java code
Given the corner points of a triangle (x1, y1), (x2, y2), (x3, y3), compute the area.
Hint: The area of the triangle with corner points (0, 0), (x1, y1), and (x2, y2) is |x1 · y2 – x2 · y1| / 2.
Complete the following code:
public class Geometry
{
/**
A method to return the smaller of two integers
@param a, the first integer
@param b, the second integer
@return small, the smaller of the two
*/
public static double triangleArea(double x1, double y1,
double x2, double y2, double x3, double y3)
{
…
}
}