Math notes: distance √((x₂−x₁)²+(y₂−y₁)²); midpoint ((x₁+x₂)/2,(y₁+y₂)/2); slope m=(y₂−y₁)/(x₂−x₁) if x₂≠x₁; line through A,B: Ax+By+C=0 with A=y₁−y₂, B=x₂−x₁, C=x₁y₂−x₂y₁; triangle area via shoelace; section point (internal) P=((mx₂+nx₁)/(m+n),(my₂+ny₁)/(m+n)).