I have a function that calculates the area of a triangle; however, when the area for the triangle is negative, the area is represented as '-1.#IND'. How do you force a function to set the area to 0.0 when the area of a triangle is negative?
this is what the appropriate function contains so far:
Your formula is wrong.
s=.5*abs(AB*AC)
OR
s=.5*abs(AB*BC)
OR
s=.5*abs(BC*CA)
(The two sides must be adjacent.)
OR
s=sqrt(pow(AB,2)*pow(AC,2)-pow(AB*AC,2))
There's no such thing as negative surface (well, there is in calculus, but not in geometry).
I don't see what you're saying.
The formula is wrong. Period. It's not calculating the area of a triangle, but something completely different. There's no point in adding any checks after it, because it's the whole formula, not the data, that's wrong.