Skip to content
Embercode
✕
GeometryQuick quiz

Segments, polygons and hulls

8 questions. Covers Convex hull with the monotone chain.

Questions 1 to 5 of 8

  1. 1. A teammate's segment test returns NO for the segments (0, 0)-(4, 0) and (2, 0)-(2, 3), which touch at (2, 0). The test is: orient(a, b, c) * orient(a, b, d) < 0 and orient(c, d, a) * orient(c, d, b) < 0. What is wrong?
  2. 2. What is the doubled area (the shoelace sum) of the square with corners (0, 0), (4, 0), (4, 4) and (0, 4), listed in that order? Give the integer.

    Type a number.

  3. 3. Which statements about the shoelace formula for a simple polygon with integer corners are true?

    Pick every answer that is true.

  4. 4. Judge data puts query points on vertices and on walls. Which order of tests gives the right answer for a point on a wall?
  5. 5. An AI tool wrote this check for whether a query point p lies on the wall from a to b: ``cpp bool on_wall(P p, P a, P b) { return cross(a, b, p) == 0; } `` What does it get wrong?

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.