// Determine the direction of a planar turn from six coordinates. Returns one for counterclockwise, zero for collinear, minus one for clockwise. pub fn turn_orientation(ax: f64, ay: f64, bx: f64, by: f64, cx: f64, cy: f64) -> i64 { let cross = (bx-ax)*(cy-ay)-(by-ay)*(cx-ax); if cross>0.0 { return 1; } if cross<0.0 { return -1; } 0 }