12 lines
172 B
Python
12 lines
172 B
Python
"""Utility functions."""
|
|
|
|
import math
|
|
|
|
|
|
def distance(x1, y1, x2, y2):
|
|
return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
|
|
|
|
|
|
def lerp(a, b, t):
|
|
return a + (b - a) * t
|