src/canvas.cpp
// "distance" from point to line using canonical line equation
"distance" from point to line using canonical line equation
" distance " from point to line using canonical line equation
int canvas::line_distance(const point &start, const point &end, const point &p) {
    int ax = start.x;
    int ay = start.y;
    int bx = end.x;
    int by = end.y;
    int W = bx - ax;
    int H = by - ay;
    return H * (p.x - ax) - W * (p.y - ay);
}
int canvas :: line_distance ( const point & start , const point & end , const point & p ) { int ax = start . x ; int ay = start . y ; int bx = end . x ; int by = end . y ; int W = bx - ax ; int H = by - ay ; return H * ( p . x - ax ) - W * ( p . y - ay ) ; }
"distance" from point to line using canonical line equation
" distance " from point to line using canonical line equation