Ray-casting algorithm: Difference between revisions

Updated D entry
(Updated D code)
(Updated D entry)
Line 502:
}
 
return poly.edges.count!(e => raySegI(p, e))(poly.edges) % 2;
}
 
Line 531:
writefln(`Is point inside figure "%s"?`, poly.name);
foreach (p; testPoints)
writefln(" (%3s, %2s): %s", p.x, p.y, contains(poly, p));
writeln();
}