#pragma once typedef struct { int x; int y; } LPoint; typedef struct { LPoint p0; LPoint p1; } LLine; // dist is a fixed point with precission of 8 bits // offs is where on the line segment xy0-xy1 the point's normale hits, // range 0..65536 (but can extend, if normale hits line outside line segment) int dist_pl(LPoint const * p, LLine const * l, int * offs); int dist_pp(LPoint const * p0, LPoint const * p1); int get_x_for_y(LPoint const * p0, LPoint const * p1, int y);