def compute(self, egocentricLocation):
    """
    Compute the new active cells from the given "sensor location relative to
    body" vector.

    @param egocentricLocation (pair of floats)
    [di, dj] offset of the sensor from the body.
    """
    offsetInCellFields = (np.matmul(self.rotationMatrix, egocentricLocation) *
                          self.cellFieldsPerUnitDistance)

    np.mod(offsetInCellFields, self.cellDimensions, out=offsetInCellFields)
    self.activeCells = np.unique(
      np.ravel_multi_index(np.floor(offsetInCellFields).T.astype('int'),
                           self.cellDimensions))
Compute the new active cells from the given "sensor location relative to
    body" vector.

    @param egocentricLocation (pair of floats)
    [di, dj] offset of the sensor from the body.