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 ruler-and-compass construction for specified figure → doc every step w/ Euclidean justification + valid. result vs. original spec.

Use When

In

Do

Step 1: Identify Given Elements + Target Figure

Parse problem statement → extract:

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

Express 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).

Valid. all ref'd elements well-defined + consistent.

→ Clear, unambiguous restatement of construction problem w/ every given element cataloged + target figure precisely described.

If err: Problem statement ambiguous → list possible interpretations + req clarification. Given elements contradictory (e.g., triangle w/ side lengths 1, 1, 5) → state contradiction + halt.

Step 2: Verify Constructibility

Determine whether target can be constructed w/ straightedge + compass alone.

  1. Check algebraic constraints. Length constructible iff lies in field extension of rationals obtained by successive sqrt. Requires cube roots / transcendental ops → impossible.
  1. Known impossible constructions:
  1. Known constructible ops:
  1. Doc verdict w/ 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

→ Definitive yes/no verdict on constructibility, w/ brief justification citing relevant algebraic / classical result.

If err: Constructibility uncertain → reduce problem to known constructible primitives. Provably non-constructible → doc impossibility proof + suggest closest constructible approximation or alt method (e.g., neusis construction, origami).

Step 3: Plan Construction Sequence

Decompose target figure → seq of primitive ops.

  1. Identify primitives needed. Every ruler-and-compass reduces to these atomic ops:
  1. Order ops. Each op must ref only points already existing (given or prev constructed). Build dep 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 ops or reuse prev constructed elements.
  1. Annotate each step w/ geometric purpose (e.g., "This constructs perpendicular bisector of AB").

→ Ordered list of primitive ops where each step depends only on prev est'd elements, covering all parts of target.

If err: Decomp stalls → ID which part of figure can't be reached from current set of constructed points. Revisit Step 2 to confirm constructibility, or introduce auxiliary constructions (helper circles, midpoints, reflections) to bridge gap.

Step 4: Execute Construction Steps w/ Justification

Write each construction step in full, providing Euclidean justification.

Each primitive op → doc:

  1. Op: what is drawn / marked.
  2. Ins: which existing elements used.
  3. Justification: which Euclidean proposition / theorem / property guarantees op produces claimed result.
  4. Out: what new elements created.

Format each step consistent:

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 target fully constructed. Complex figures → group related steps into phases (e.g., "Phase 1: Construct auxiliary perpendicular bisector", "Phase 2: Locate incenter").

→ Complete seq of justified construction steps that, executed in order, produce target. Every new point, line, circle accounted for.

If err: Can't provide justification for step → step may be invalid. Valid. geometric claim independently. Common errs: assuming two circles intersect when they don't (check distance between centers vs. sum/diff of radii), or assuming point lies on line w/o proof.

Step 5: Verify Construction Meets Specification

Confirm constructed figure satisfies all original reqs.

  1. Check each constraint from Step 1 vs. constructed figure:
  1. Count degrees of freedom. Constructed figure should have exactly number of free params implied by spec. Extra dof → spec under-determined. None + construction fails → spec over-determined / contradictory.
  1. Test w/ specific coords (optional but rec'd 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. Doc verification result w/ clear pass/fail each constraint.

→ Every constraint from original spec verified, construction confirmed correct. Coord check (when done) matches geometric argument.

If err: Constraint fails → trace back through construction → find erroneous step. Common causes: incorrect intersection choice (wrong branch of circle-line intersection), sign err in coord verification, or missing auxiliary construction.

Check

Traps

→

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.