# Sanitized excerpt conceptually from geometry.py (LungLens inference-api) # Verified by tests/test_geometry.py (2026-10-19): lovibond finite, dpd_ipd == 2.0 for unit vectors def lovibond_angle_degrees(nail_matrix, proximal_nail_fold, nail_plate): v1 = (nail_matrix[0] - proximal_nail_fold[0], nail_matrix[1] - proximal_nail_fold[1]) v2 = (nail_plate[0] - proximal_nail_fold[0], nail_plate[1] - proximal_nail_fold[1]) return angle_between(v1, v2) def dpd_ipd_ratio(dpd_a, dpd_b, ipd_a, ipd_b): dpd = euclidean(dpd_a, dpd_b) ipd = euclidean(ipd_a, ipd_b) if ipd == 0: raise ValueError("INVALID_GEOMETRY") return dpd / ipd # Note: numbers are only as good as the landmarks supplied. Placeholder landmarks # still produce a numeric output; that is not clinical validation.