Skip to content

Main content

Random Point in Polygon Classification Quiz Generator

Construct simple integer rectangles or concave L polygons with interior, exterior, edge and vertex probes, delegating area and boundary-inclusive classification.

Loading tool…

Description

Construct simple integer rectangles or concave L polygons with interior, exterior, edge and vertex probes, delegating area and boundary-inclusive classification.

A generated practice exercise contains a prompt and an answer key under a specific rule set. A planted answer establishes one possible solution; only an explicit enumeration or uniqueness check establishes whether alternatives exist.

Construct simple integer rectangles or concave L polygons with interior, exterior, edge and vertex probes, delegating area and boundary-inclusive classification.

When to use this tool

Use this generator to create reproducible point in polygon classification quiz cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply count, shape, originMinimum, originMaximum, minimumExtent, maximumExtent in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read cases, boundaryConvention. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.

Construct a rectangle or concave L-shaped polygon, then create known interior, exterior, edge, and vertex probes. Delegate point classification and polygon area and cross-check both against the construction.1

Delegated operations used for this result: point in polygon; polygon area. Their calculation or parsing conventions apply to the corresponding result fields.2, 3

Input fieldMeaning and unitsAccepted input
countRequested count; the mechanics explain whether one draw expands into several returned records.Required. Safe integer; minimum 1; maximum 16.
shapeShapeRequired. Text; one of "rectangle", "l-shape", "mixed".
originMinimumOrigin MinimumRequired. Safe integer.
originMaximumOrigin MaximumRequired. Safe integer.
minimumExtentMinimum ExtentRequired. Safe integer; minimum 4.
maximumExtentMaximum ExtentRequired. Safe integer; minimum 4.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
casesCasesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 16.
cases[].shapeShapeRequired. Text; one of "rectangle", "l-shape".
cases[].parametersParametersRequired. Object; no unknown keys.
cases[].parameters.xXRequired. Safe integer.
cases[].parameters.yYRequired. Safe integer.
cases[].parameters.widthWidthRequired. Safe integer; minimum 4.
cases[].parameters.heightHeightRequired. Safe integer; minimum 4.
cases[].parameters.cutXCut XRequired. Safe integer; minimum 2. or Null.
cases[].parameters.cutYCut YRequired. Safe integer; minimum 2. or Null.
cases[].xsXsRequired. Array of Finite number.; minimum items 4; maximum items 6.
cases[].ysYsRequired. Array of Finite number.; minimum items 4; maximum items 6.
cases[].areaAreaRequired. Finite number; strictly above 0.
cases[].pointsPointsRequired. Array of Object; no unknown keys.; minimum items 6; maximum items 6.
cases[].points[].xXRequired. Finite number.
cases[].points[].yYRequired. Finite number.
cases[].points[].intendedIntendedRequired. Text; one of "interior", "exterior", "boundary".
cases[].points[].insideInsideRequired. Boolean.
cases[].points[].onBoundaryOn BoundaryRequired. Boolean.
boundaryConventionBoundary ConventionRequired. Text.
randomnessReplay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source.Required. Object; no unknown keys.
randomness.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "count": 1,
    "shape": "mixed",
    "originMinimum": -2,
    "originMaximum": 2,
    "minimumExtent": 4,
    "maximumExtent": 6,
    "seed": 42
  },
  "output": {
    "cases": [
      {
        "shape": "l-shape",
        "parameters": {
          "x": 0,
          "y": 2,
          "width": 6,
          "height": 4,
          "cutX": 3,
          "cutY": 2
        },
        "xs": [
          0,
          6,
          6,
          3,
          3,
          0
        ],
        "ys": [
          2,
          2,
          4,
          4,
          6,
          6
        ],
        "area": 18,
        "points": [
          {
            "x": 1,
            "y": 3,
            "intended": "interior",
            "inside": true,
            "onBoundary": false
          },
          {
            "x": 1,
            "y": 5,
            "intended": "interior",
            "inside": true,
            "onBoundary": false
          },
          {
            "x": 7,
            "y": 7,
            "intended": "exterior",
            "inside": false,
            "onBoundary": false
          },
          {
            "x": 3,
            "y": 2,
            "intended": "boundary",
            "inside": true,
            "onBoundary": true
          },
          {
            "x": 0,
            "y": 2,
            "intended": "boundary",
            "inside": true,
            "onBoundary": true
          },
          {
            "x": 4,
            "y": 5,
            "intended": "exterior",
            "inside": false,
            "onBoundary": false
          }
        ]
      }
    ],
    "boundaryConvention": "Boundary points count as inside; exact collinearity and segment bounds identify edges and vertices.",
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Boundary points count as inside and also have onBoundary true. Exact-collinearity conventions and floating-point conditioning can reject extreme geometry; the cases do not cover arbitrary polygons or tolerance-based GIS behavior.
  • A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Point in Polygon Classification Quiz Generator — tool.io

  2. Calculation or validation: geometry/point-in-polygon — tool.io

  3. Calculation or validation: geometry/polygon-area — tool.io

Similar or alternative tools