getNormal method

dynamic getNormal(
  1. dynamic p1,
  2. dynamic p2,
  3. dynamic result
)

Implementation

getNormal(p1, p2, result) {
  result.subVectors(p2, p1);
  return result.set(-result.y, result.x).normalize();
}