rewrite with closure
Merge pull request #2 from dmtaub/triangleToPointDistance

rewrite with closure