Fixed flaw in the computation of area

1/2bh does not always work for every triangle, and was causing unusual
scalings in some cases, so I'm now using the more expensive Heron's
formula. Also changed the way theta is computed to a more efficient
method that does not involve correcting with pi.