Conversational AI · Software Development

Vibe Coding:
Circle Geometry
Calculators

A conversation with Claude · claude.ai

"Vibe coding" is a style of software development where you describe what you want in plain language, iterating conversationally rather than writing code yourself. The AI writes and revises the code; you steer by feel. Below is a real session that produced a polished, three-mode interactive geometry calculator — entirely through natural conversation.

The Session

The Conversation

You
Can you build me a web page that will give the radius of a circle given a secant to the circle and the perpendicular distance from the secant line to the circle
AI
Built A web page with two modes — center-to-secant distance and sagitta — with a toggle, a live canvas diagram, formula display, and a step-by-step derivation panel. Styled with a typographic, editorial aesthetic using Playfair Display and DM Mono fonts.
You
Please revise the web page to use only mode 2
AI
Revised Removed the mode toggle entirely. Simplified inputs to chord length L and sagitta h. Updated all labels, formula, footer, and JS to sagitta-only. Formula: r = h/2 + L²/(8h)
You
Adapt the diagram so it focuses on the chord rather than the whole circle
AI
Redesigned diagram Rewrote the canvas drawing function. Instead of scaling to fit the whole circle, the chord now fills ~75% of the canvas width. Only the relevant arc segment is shown prominently; the rest of the circle appears as a faint ghost. The sagitta h became the visual centrepiece.
You
Flip the orientation of the diagram so the center of the circle is below the chord, and make the portion of the circle above the chord prominent and the rest of the circle dotted
AI
Flipped Chord now sits near the top of the canvas, arc bulges upward above it, circle centre O sits below. The minor arc above the chord is drawn bold and solid; the major arc below is drawn dotted. If the centre falls off-canvas, a subtle "O (off-canvas)" indicator appears.
You
Offset the label L in the diagram so it is off center and below the chord
AI
Label adjusted Moved L label from centred-above to right-of-centre below the chord, clear of the sagitta line and midpoint tick.
You
Label r on the diagram, and keep the diagram fixed using the values 20 for the chord length and 2.0 for the sagitta rather than varying the diagram as the values change
AI
Fixed geometry · new label Diagram geometry fixed to L=20, h=2.0 (giving r=26) — a stable reference illustration that no longer redraws as inputs change. Added an r label positioned perpendicular to the dashed radius line using vector maths to avoid overlapping other elements.
You
Move the r label a bit farther down the radius line so it's not confused with the other parameters
AI
Nudged Moved the r label from 22px to 65px along the radius line from the chord endpoint — well clear of the chord and other labels.
You
Very nice - thanks!
AI
You're welcome! It's a clean little calculator now — fixed diagram, clear labels, and the geometry is easy to read at a glance.
You
Can you create a new calculator formatted identically to this one, but that finds the sagitta given the chord length L and radius r?
AI
New file Created sagitta-calculator.html — identical styling. Inputs: L and r. Output: h. Formula: h = r − √(r² − (L/2)²). Same fixed diagram. Four-step derivation starting from the right-triangle relationship.
You
Beautiful! Now one more variant: can you create a calculator formatted like the previous ones that calculates the chord length given the radius r and sagitta h?
AI
New file Created chord-calculator.html — same style. Inputs: r and h. Output: L. Formula: L = 2√(2rh − h²). Validation catches h > 2r. "You now have a complete matched set — each of the three variables solvable from the other two."
You
Wonderful! Now can you combine these three calculators into one, with a selection at the top to specify whether you want to find the radius, the sagitta, or the chord length
AI
Combined Created circle-geometry-calculator.html. A three-button mode selector ("Find r / Find h / Find L") switches inputs, result label, formula, derivation steps, and footer simultaneously. The diagram stays fixed throughout. All logic consolidated into a MODES config object, keeping the code clean and DRY.
You
Could you add a note in the calculator that the units of all the values are arbitrary, but must be the same (e.g., centimeters, inches, etc.)
AI
Note added Added a small note beneath the formula box: "All values share the same unit of length — centimetres, inches, metres, etc. The choice is arbitrary, but must be consistent across all three quantities."
You
Can you save this conversation as a text file as an example of "vibe coding" that I can share with friends
AI
Saved Produced vibe-coding-circle-geometry.txt — a formatted summary of the full session, the files produced, and a reflection on what makes this "vibe coding."
You
Can you change the vibe-coding text file into an equivalent html file
AI
You're reading it Converted the plain-text summary into this styled HTML document, matching the calculator's editorial aesthetic.
Output

Files Produced

circle-radius-calculator.html
Find r, given L and h
sagitta-calculator.html
Find h, given L and r
chord-calculator.html
Find L, given r and h
circle-geometry-calculator.html
All three modes in one page
vibe-coding-circle-geometry.html
This document
Reflection

What Made This "Vibe Coding"