line1 = LineString([(1, 1.2), (2, 2), (3, 2.3), (4, 1.2)])
pt = Point(2.5, 1.2)
pr = line1.interpolate(line1.project(pt))
print(line1.distance(pr) == 0.0)
EPS = 1.2e-16
How to deal with rounding errors in Shapely