题目:
题解:
class Solution:def __init__(self, radius: float, x_center: float, y_center: float):self.xc = x_centerself.yc = y_centerself.r = radiusdef randPoint(self) -> List[float]:u, theta = random.random(), random.random() * 2 * math.pir = sqrt(u)return [self.xc + r * math.cos(theta) * self.r, self.yc + r * math.sin(theta) * self.r]