# Misc Utility Functions

Given key/pair combos, returns a string in uuid format. Such as text=’hi’, size=32 it will return “text-hi-size-32”. Called with no parameters, id does NOT return a random unique id.

arcade.lerp(v1: float, v2: float, u: float) [source]

linearly interpolate between two values

arcade.lerp_vec(v1: Union[Tuple[float, float], List[float]], v2: Union[Tuple[float, float], List[float]], u: float) Union[Tuple[float, float], List[float]][source]

Return a random angle in degrees.

Generate a point in a circle, or can think of it as a vector pointing a random direction with a random magnitude <= radius Reference: https://stackoverflow.com/a/30564123 Note: This algorithm returns a higher concentration of points around the center of the circle

arcade.rand_in_rect(bottom_left: Union[Tuple[float, float], List[float]], width: float, height: float) Union[Tuple[float, float], List[float]][source]

Note: by passing a random value in for float, you can achieve what rand_in_circle() does

arcade.rand_on_line(pos1: Union[Tuple[float, float], List[float]], pos2: Union[Tuple[float, float], List[float]]) Union[Tuple[float, float], List[float]][source]

Given two points defining a line, return a random point on that line.

arcade.rand_vec_magnitude(angle: float, lo_magnitude: float, hi_magnitude: float) Union[Tuple[float, float], List[float]][source]