Construct geometric figure

From pjt222/agent-almanac · View interactive version

Construct geometric figure is an AI agent skill from the GitHub repository pjt222/agent-almanac. Perform a ruler-and-compass construction with step-by-step justification for each operation, producing a constructible geometric figure from given elements. Covers classical Euclidean constructions including perpendicular bisectors, angle bisectors, parallel lines, regular polygons, and tangent line

How to use this skill

Skill file

Construct a Geometric Figure

Produce a ruler-and-compass construction for a specified geometric figure, documenting every step with its Euclidean justification and verifying the result against the original specification.

When to Use

Inputs

Procedure

Step 1: Identify Given Elements and Target Figure

Parse the problem statement to extract:

  1. Given elements -- list every point, segment, angle, circle, or length provided.
  2. Target figure -- state precisely what must be constructed.
  3. Constraints -- note any additional conditions (congruence, parallelism, tangency, collinearity).

Express the problem in standard form:

Given: Points A, B; segment AB; circle C1 centered at A with radius r.
Construct: Equilateral triangle ABC with AB as one side.
Constraints: C must lie on the same side of AB as point P (if specified).

Verify that all referenced elements are well-defined and consistent.

Got: A clear, unambiguous restatement of the construction problem with every given element cataloged and the target figure precisely described.

If fail: If the problem statement is ambiguous, list the possible interpretations and request clarification. If given elements are contradictory (e.g., a triangle with side lengths 1, 1, 5), state the contradiction and halt.

Step 2: Verify Constructibility

Determine whether the target figure can be constructed using straightedge and compass alone.

  1. Check algebraic constraints. A length is constructible if and only if it lies in a field extension of the rationals obtained by successive square roots. If the construction requires cube roots or transcendental operations, it is impossible.
  1. Known impossible constructions:
  1. Known constructible operations:
  1. Document the verdict with justification.
Constructibility analysis:
- Target: equilateral triangle on segment AB
- Required operations: circle-circle intersection (two arcs of radius AB)
- Algebraic degree: 2 (quadratic extension)
- Verdict: CONSTRUCTIBLE

Got: A definitive yes/no verdict on constructibility, with a brief justification citing the relevant algebraic or classical result.

If fail: If constructibility is uncertain, attempt to reduce the problem to known constructible primitives. If the figure is provably non-constructible, document the impossibility proof and suggest the closest constructible approximation or an alternative method (e.g., neusis construction, origami).

Step 3: Plan Construction Sequence

Decompose the target figure into a sequence of primitive construction operations.

  1. Identify primitives needed. Every ruler-and-compass construction reduces to these atomic operations:
  1. Order the operations. Each operation must reference only points that already exist (given or previously constructed). Build a dependency graph:
Step 1: Draw circle C1 centered at A through B.       [uses: A, B]
Step 2: Draw circle C2 centered at B through A.       [uses: A, B]
Step 3: Mark intersections of C1 and C2 as P, Q.      [uses: C1, C2]
Step 4: Draw line through P and Q.                     [uses: P, Q]
  1. Minimize step count. Look for opportunities to combine operations or reuse previously constructed elements.
  1. Annotate each step with its geometric purpose (e.g., "This constructs the perpendicular bisector of AB").

Got: An ordered list of primitive operations where each step depends only on previously established elements, covering all parts of the target figure.

If fail: If the decomposition stalls, identify which part of the figure cannot be reached from the current set of constructed points. Revisit Step 2 to confirm constructibility, or introduce auxiliary constructions (helper circles, midpoints, reflections) to bridge the gap.

Step 4: Execute Construction Steps with Justification

Write out each construction step in full, providing the Euclidean justification.

For each primitive operation, document:

  1. The operation: what is drawn or marked.
  2. The inputs: which existing elements are used.
  3. The justification: which Euclidean proposition, theorem, or property guarantees the operation produces the claimed result.
  4. The output: what new elements are created.

Format each step consistently:

Step 3: Mark intersections of C1 and C2 as P and Q.
  - Operation: Circle-circle intersection
  - Inputs: C1 (center A, radius AB), C2 (center B, radius BA)
  - Justification: Two circles with equal radii whose centers are separated
    by less than the sum of their radii intersect in exactly two points,
    symmetric about the line of centers (Euclid I.1).
  - Output: Points P and Q, where AP = BP = AB (equilateral property).

Continue until the target figure is fully constructed. For complex figures, group related steps into phases (e.g., "Phase 1: Construct auxiliary perpendicular bisector", "Phase 2: Locate incenter").

Got: A complete sequence of justified construction steps that, when executed in order, produce the target figure. Every new point, line, or circle is accounted for.

If fail: If a justification cannot be provided for a step, the step may be invalid. Verify the geometric claim independently. Common errors include assuming two circles intersect when they do not (check distance between centers vs. sum/difference of radii), or assuming a point lies on a line without proof.

Step 5: Verify Construction Meets Specification

Confirm that the constructed figure satisfies all original requirements.

  1. Check each constraint from Step 1 against the constructed figure:
  1. Count degrees of freedom. The constructed figure should have exactly the number of free parameters implied by the specification. If there are extra degrees of freedom, the specification was under-determined. If there are none and the construction fails, the specification was over-determined or contradictory.
  1. Test with specific coordinates (optional but recommended for complex constructions):
Verification with coordinates:
Let A = (0, 0), B = (1, 0).
C1: x^2 + y^2 = 1
C2: (x-1)^2 + y^2 = 1
Intersection: x = 1/2, y = sqrt(3)/2
Triangle ABC: sides AB = BC = CA = 1. VERIFIED.
  1. Document the verification result with a clear pass/fail for each constraint.

Got: Every constraint from the original specification is verified, and the construction is confirmed correct. A coordinate check (when performed) matches the geometric argument.

If fail: If a constraint fails, trace back through the construction to find the erroneous step. Common causes: incorrect intersection choice (wrong branch of a circle-line intersection), sign error in coordinate verification, or a missing auxiliary construction.

Validation

Pitfalls

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.