// Examples

See it. Copy it.
Make it yours.

Every example is a complete, runnable diagram. Copy the code, paste it into the app, and start exploring from there.

Foundations

Circle & circumference points

A circle defined by centre and radius, with two points placed at given angles. The building block of most geometric constructions.

circle-points.gs
axes A: ((-5, 5), (-5, 5)) grid G: (A, 1) point O: (0, 0, teal, 4) circle C: (O, 3, teal, 1.5, teal.alpha(0.06)) pointOn P: (C, 45, amber, 5) pointOn Q: (C, 160, violet, 5) label lO: (O, "O", teal, 11) label lP: (P, "P", amber, 11) label lQ: (Q, "Q", violet, 11)
GeoScript logo
Foundations

Right triangle with angle marker

A triangle defined by three points, a square angle marker at the right angle, and labelled vertices. The standard geometry diagram starter.

right-triangle.gs
axes A: ((-2, 7), (-2, 6)) grid G: (A, 1) point A: (0, 0, mint, 4) point B: (5, 0, mint, 4) point C: (0, 4, mint, 4) triangle T: (A, B, C, mint, 1.5, mint.alpha(0.08)) angle θ: (B, A, C, orange, 2, 0.4, "square") label lA: (A, "A", mint, 11) label lB: (B, "B", mint, 11) label lC: (C, "C", mint, 11)
A B C
Constructions

Triangle centres

The three classical centres of a triangle — circumcenter, incenter, and centroid — each computed by the type system from the same three vertices. No coordinates guessed.

triangle-centres.gs
axes A: ((-5, 5), (-4, 5)) grid G: (A, 1) point P1: (-3, -2, violet, 5) point P2: ( 4, -1, violet, 5) point P3: ( 0, 4, violet, 5) triangle T: (P1, P2, P3, violet, 1.5, violet.alpha(0.07)) circumcircle cc: (P1, P2, P3, teal, 1.5, teal.alpha(0.05)) incircle ic: (P1, P2, P3, orange, 1.5, orange.alpha(0.1)) circumcenter O: (P1, P2, P3, teal, 5) incenter I: (P1, P2, P3, orange, 5) centroid G: (P1, P2, P3, rose, 5) label lO: (O, "circumcenter", teal, 10) label lI: (I, "incenter", orange, 10) label lG: (G, "centroid", rose, 10)
circumcenter incenter centroid
Constructions

Pythagorean theorem

A 3-4-5 right triangle with coloured squares on each side. Area labels via dot-access to each square's centre. The classic visual proof of a² + b² = c².

pythagoras.gs
axes A: ((-5, 9), (-5, 9)) grid G: (A, 1) point A: (0, 0, teal, 5) point B: (4, 0, teal, 5) point C: (4, 3, teal, 5) triangle T: (A, B, C, teal, 2, teal.alpha(0.1)) angle sq: (A, B, C, white, 1.5, 0.4, "square") squareOn sqA: (A, B, "left", rose, 1.5, rose.alpha(0.15)) squareOn sqB: (B, C, "left", orange, 1.5, orange.alpha(0.15)) squareOn sqC: (C, A, "left", violet, 1.5, violet.alpha(0.15)) label la: (sqA.center, "16", rose, 20) label lb: (sqB.center, "9", orange, 20) label lc: (sqC.center, "25", violet, 20)
A B C 16 9 25
Functions

Area between sin(x) and cos(x)

Two function curves with their intersection points found numerically and used as integral bounds. The crossings are referenceable as points — their x coordinates feed directly into the integral.

area-between-curves.gs
axes A: ((-1, 7), (-2, 2)) grid G: (A, 1) ticks T: (A, 1) fn F1: (sin(x), teal, 2) fn F2: (cos(x), amber, 2) crossing C1: (F1, F2, 0, white, 5) crossing C2: (F1, F2, 4, violet, 5) integral I1: (F1, C1.x, C2.x, true, teal.alpha(0.2), 1) integral I2: (F2, C1.x, C2.x, true, amber.alpha(0.2), 1) label l1: (C1, "π/4", white, 10) label l2: (C2, "5π/4", violet, 10) label lF1: ((5.5, 0.8), "sin(x)", teal, 11) label lF2: ((5.5, 0.3), "cos(x)", amber, 11)
π/4 5π/4 sin(x) cos(x)
Functions

Derivative & tangent line

The diff type computes the derivative numerically at a given x and optionally draws the tangent line. The slope is readable via dot access — pipe it into a label to display the value.

derivative.gs
axes A: ((-2, 4), (-1, 6)) grid G: (A, 1) fn F: (x^2, violet, 2) diff D1: (F, -1, tangent=true, color=teal, size=1.5) diff D2: (F, 1, tangent=true, color=amber, size=1.5) diff D3: (F, 2, tangent=true, color=rose, size=1.5) label l1: (D1, "slope=-2", teal, 10) label l2: (D2, "slope=2", amber, 10) label l3: (D3, "slope=4", rose, 10)
slope=-2 slope=2 slope=4