General math helper tools.
- neoscore.core.math_helpers.interpolate(line_start: Point, line_end: Point, x: Unit) Unit
Calculate the value of a line defined by two points at a given x pos.
- neoscore.core.math_helpers.is_power_of_2(value: int) bool
Check if a number is a power of 2.
- neoscore.core.math_helpers.point_angle(point: Point) float
Calculate the angle from the positive X axis to a point in radians.
The returned angle goes positive clockwise and is between pi and -pi.
Combine with the Python stdlib function
math.degrees()to get the angle in degrees.
- neoscore.core.math_helpers.dist(p1: Tuple[float, float], p2: Tuple[float, float]) float
Find the Euclidean distance between two 2D float tuples.
In the future this function and signature may be modified to support neoscore unit-points as well.