Interactive points
Point A tuple(1, 2)
Point B tuple(4, 6)
distance^2 = (1-4)^2 + (2-6)^2 = 25
Each point is an immutable pair (x, y). Squared distance avoids floats while still comparing how far points are.
Each point is (x, y). Subtract, square, add — that’s distance².
A coordinate is a fixed pair of numbers. A tuple is perfect for that: p1 = (x1, y1). Distance squared is (x1-x2)^2 + (y1-y2)^2.
Maps, games, collision checks, and nearest-neighbor search all store positions as (x, y) records.