X-Git-Url: https://git.sesse.net/?p=tcxmerge;a=blobdiff_plain;f=opt.cc;h=87b632e62e7ac5fd042abe9c0ff1ae9988273417;hp=bb318a4729e142cef336280798aa9e0fdfda4ac1;hb=5e162abbf9da991f67661149b686714535e0fa1d;hpb=726821c014581bc1fad84fbd866ca291cdd80f10 diff --git a/opt.cc b/opt.cc index bb318a4..87b632e 100644 --- a/opt.cc +++ b/opt.cc @@ -93,8 +93,8 @@ BSPTreeNode* make_bsp_tree(const vector& remaining_roads) const LineSegment& ls = roads[remaining_roads[i]]; // find the normal - double a = -(ls.to.x - ls.from.x); - double b = ls.to.y - ls.from.y; + double a = ls.to.y - ls.from.y; + double b = -(ls.to.x - ls.from.x); double invlen = 1.0 / hypot(a, b); a *= invlen, b *= invlen;