News


Given the lengths of the sides of a triangle, compute the area of the triangle.

Here's one implementation (based completely off a geometry formula):

double printArea(double a, double b, double c)
{
double s = (a + b + c) / 2;
return Math.Sqrt(s * (s - a) * (s - b) * (s - c));
}
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Comments

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: