REFACTORED: reduced complexity in triangle area calculation