#!/bin/sh . ./Common ############################################################################### tst "bug: p2d_no_intersect could wrap around and bite itself" <<EOF struct p2d *p = p2d_new(); p2d_append(p, v2d_new(0, 0)); p2d_append(p, v2d_new(1, 27.8058649225)); p2d_append(p, v2d_new(1, 2)); p2d_close(p); p2d_area(p, 3, 3); EOF expect <<EOF EOF #------------------------------------------------------------------------------ tst "bug: collinear path segments tripped angle_3" <<EOF struct p2d *p = p2d_new(); struct p2d *q; p2d_append(p, v2d_new(0, 0)); p2d_append(p, v2d_new(1, 27.8058649225)); p2d_append(p, v2d_new(1, 2.0947540869)); p2d_append(p, v2d_new(1, 2)); p2d_close(p); q = p2d_area(p, 3, 3); p2d_write_gnuplot_all(stdout, q); EOF # Not output since the polygon is too small. This did not cause the above bug # but just happened to be a property of the problem polygon. expect <<EOF EOF ###############################################################################