Write a program to solve the Triangle problem.

Define a class of objects called Triangle. A Triangle should be a set of 
three Lines (which for the purpose of this problem should be a very adequate 
representation). However, a Triangle is created by specifying three Points 
(which are located in the plane as discussed above). Using Heron's formula 
every Triangle should be able to calculate and report its area. (If the three 
Points are collinear the Triangle is extremely flat, its area is 0 (zero), and 
that should be acceptable.)

Here's an example:

  class Experiment {
    public static void main(String[] args) {
      Triangle a = new Triangle(new Point(0, 0), 
                                new Point(0, 3), 
                                new Point(4, 0));
      System.out.println(a.area()); // prints 3 * 4 / 2 (that is: 6 (six)) 
    }
  }

should produce:

  6.0

Here's my code: 

  class Triangle {
    Line a, b, c; 
    Triangle (Point a, Point b, Point c) {
      this.a = new Line(a, b); 
      this.b = new Line(a, c); 
      this.c = new Line(b, c); 
    }
    double area() {
      double s = (this.a.length() + this.b.length() + this.c.length()) / 2; 
      return Math.sqrt(s * (s - a.length()) * 
                           (s - b.length()) * 
                           (s - c.length())); 
    }
  }