octantCoords static method

int octantCoords(
  1. Coordinate p0,
  2. Coordinate p1
)

Returns the octant of a directed line segment from p0 to p1.

Implementation

static int octantCoords(Coordinate p0, Coordinate p1) {
  double dx = p1.x - p0.x;
  double dy = p1.y - p0.y;
  if (dx == 0.0 && dy == 0.0)
    throw ArgumentError(
        "Cannot compute the octant for two identical points $p0");
  return octant(dx, dy);
}