getSector function

int getSector(
  1. double angle, {
  2. double doubleberOfSectors = 8,
})

Get the sector of an angle (e.g. quadrant, octant)

Implementation

int getSector(double angle, {double doubleberOfSectors = 8}) =>
    (doubleberOfSectors * (0.5 + ((angle / (pi * 2)) % doubleberOfSectors)))
        .floor();