Coap+222,+Triangles+Galore


 * //__Triangles Galore__//**

Triangles triangles triangles... such a royal pain.

A good trick that might help you find the area of the triangle and dont want to bother finding the midpoint of one line, then the slope and then the distance between that and your last remaining point (or at least i find it very annoying doing it the afformentioned way). Or any other ways you can think up, is the following.

Herons Formula:

where 's' is the semi-perimeter of the triangle (perimeter divided by 2). And the side lengths are a, b and c.

Of course the orriginal location of this is the following: [|Wikipedia: Herons Formula]

In any case, specifically those cases such as a particularly agitating program where it was required we find the area of a triangle. This may come in handy. Or it may not, really it depends on you. But it works, and it saved me from a rather large headache.

Enjoy!

Author: Daniel Smith
Last edited: Editor: