44 float x0 = line_pt_0->
pos.
x;
45 float x1 = line_pt_1->
pos.
x;
46 float y0 = line_pt_0->
pos.
y;
47 float y1 = line_pt_1->
pos.
y;
51 p.
x = static_cast<int16_t>(x0);
56 slope = (y0 - y1) / (x0 - x1);
57 intercept = y1 - x1 * slope;
60 p.
x = static_cast<int16_t>((point->
pos.
x + (point->
pos.
y - intercept) * slope) /
62 p.
y = static_cast<int16_t>(slope * p.
x + intercept);
71 *near_pt =
closest(point, line_pt_0, line_pt_1);