code: def sampleLocation(self):
      
      areaRatio = self.radius / (self.radius + self.height)
      if random.random() < areaRatio:
        return self._sampleLocationOnDisc()
      else:
        return self._sampleLocationOnSide()
docs: Simple method to sample uniformly from a cylinder.