Skip to content

Instantly share code, notes, and snippets.

@mrflip
Last active March 2, 2026 10:47
Show Gist options
  • Select an option

  • Save mrflip/a973b1c60f4a38fc3277ddd57ce65b28 to your computer and use it in GitHub Desktop.

Select an option

Save mrflip/a973b1c60f4a38fc3277ddd57ce65b28 to your computer and use it in GitHub Desktop.
Ancient Greek Geometry walkthrough / answers / cheats

Solutions for Ancient Greek Geometry (https://sciencevsmagic.net/geo)

Most solutions taken from the about thread. See the comments below for more additions since my last check-in.

Polygons

Circle Packs

Circumscribed Polygons

Non-Constructible Figures

Abuse of floating-point math can make the widget approve non-constructible polygons (polygons with edge count 7, 9, 11, 13, 14, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 31, 33, 35, ..., which cannot be precisely constructed using straightedge and compass):

@Furlii
Copy link

Furlii commented Jan 16, 2026

I wouldn't say it like that (6 mod 5 = 1, 25 mod 5 = 0).

More like ϕ(11) = 10 = 2 * 5. The modulo doesnt exactly say anything unless we're talking about prime-sided regular polygons.

@ILoveMath62
Copy link

ILoveMath62 commented Jan 19, 2026

11 is prime though. Since 11 is prime, it should count in this case, right?

I wouldn't say it like that (6 mod 5 = 1, 25 mod 5 = 0).

More like ϕ(11) = 10 = 2 * 5. The modulo doesnt exactly say anything unless we're talking about prime-sided regular polygons.

@ILoveMath62
Copy link

ILoveMath62 commented Jan 21, 2026

occ (origin circle circumscribed) decagon: 21 moves occ dodecagon: 18 moves

@ILoveMath62
Copy link

@ILoveMath62
Copy link

@elijahdarcydominguez-afk, your nonagon does count. The error is small enough to trick the widget.

@ILoveMath62
Copy link

Nonadecagon in 40 moves by taking tangent

@ILoveMath62
Copy link

Here’s a neusis construction of the hendecagon (took me a while to understand)

@ILoveMath62
Copy link

ILoveMath62 commented Feb 6, 2026

I will say this in the future. I can't say this now because it's not a problem right now.

We may need 3x the angle for the 97-gon, because I can't find the tangent for it with 2x the angle without floating point
getting in the way.

@ILoveMath62
Copy link

Furlii, it's been 20+ days since you last commented. Can you come back please?

@ILoveMath62
Copy link

@Ian-Zander
Copy link

im trying to get the 44-gon but no luck

@ILoveMath62
Copy link

Heptagon in 22 moves by neusis approximation

@ILoveMath62
Copy link

@ILoveMath62
Copy link

@Eddy119
Copy link

Eddy119 commented Feb 20, 2026

I saw ILoveMath62's 38 move heptadecagon (17-gon), and I managed to use Carlyle circles to construct 2cos(16pi/17), instead of 2cos(2pi/17), which let me save a move for the 17-gon in origin circle, from 41 moves to 40 moves, since halving 2cos(16pi/17) involves drawing a vertical line, which already draws the leftmost vertical side of the polygon, with the 8th and 9th vertices.

https://sciencevsmagic.net/geo/#1A0.0A1.0L1.3L2.1A6.6A0.11L10.14A0.0L12.12L25.25L1.1L28.1L9.9L4.10L24.24A12.0L41.N.41A25.42A25.6A54.1A78.28L103.103A1.120L119.103L71.N.145A25.41L177.177A1.1A177.N.232L233.251A252.271L251.251L283.1A283.252L283.252L366.271L340.347L339.347L394.366L375.375L423.394L404.404L455.423L434.434L486.455L467.467L514.486L499.499L543.338L271.271L572.340L556.556L601.572L586.586L633.601L616.616L664.633L649.649L692.664L681.681L719.692L543.719L514

I tried to do it with the non-in-origin version (double the circle that the 17-gon will be inscribed in instead of quartering the origin circle in the beginning), but it's still 38 moves, on par with ILoveMath62's previous record.

@Furlii
Copy link

Furlii commented Feb 21, 2026

nice

@ILoveMath62
Copy link

Good job! Still working on the 61-gon.

@ILoveMath62
Copy link

ILoveMath62 commented Feb 21, 2026

By the way, I have a modified fork of the gist, which contains the updated polygons like the heptadecagon in 38 moves instead of 45, triacontakaitetragon in 55 moves instead of 61, and the added triacontagon in 37 moves. (I made it like that before @Doomslug682 shared their triacontagon in 60 moves.)

@ILoveMath62
Copy link

@Eddy119, I'm still working on the 51-gon... it's taking a while...

I guess the next challenge is the 51-gon! I gave up on the 13-gon... Still looking for a nice simple construction that tricks the code...
Please send here if anyone finds one Also, anyone know how small the error has to be to trick it?

@ILoveMath62
Copy link

The 27-gon is neusis constructible without using an angle trisector.

@ILoveMath62
Copy link

@Eddy119
Copy link

Eddy119 commented Feb 21, 2026

With Carlyle circles, you can actually pick which vertex you want to construct (e.g. to star trick from); so, you can construct any of k in (2cos(k*2π/17)) in the same number of moves, which is 19 moves in origin, 17 moves 2x circle (so far).
Vertices (1, 13, 16, 4); (9, 15, 8, 2); (3, 5, 14, 12); (10, 11, 7, 6)

This is all from this 1991 paper by DeTemple titled Carlyle Circles and the Lemoine Simplicity of Polygon Constructions.

Feel free to try to find ways to reduce the number of steps, the ones above are in-origin, so 2x unit circle would be 17 moves, but maybe this can be simplified further; and then basically I bisect the (2cos(k*2π/17)), but maybe there's a trick to reduce the 3 moves involved to bisect, maybe there's a way to get both of the roots at once without having to bisect for each (e.g. 3 and 5), and maybe one of them makes it faster to star, like what I did yesterday.

Basically, to solve for sum of roots = S, product of roots = P, you need to solve the quadratic x^2-Sx+P=0, and a Carlyle circle is when you draw a circle with center (S/2, (1+P)/2) and edge (x=0,y=1), and the circle intersects at (x=roots, y=0). See https://en.wikipedia.org/wiki/Carlyle_circle

As for the 51-gon, you just have to use the vertical -1/2 line (left side of triangle) to cut between the 5th and 6th vertex, like this.
It's pretty easy, you can probably use the 3, 5, 14, 12 10, 11, 7, 6 link to build it quickly. UPDATE: This is what I'm talking about, you can finish the 51 sides. UPDATE 2: Use this, uses 6th vertex.

I'm wondering, @ILoveMath62, for approximations of polygons that can be exactly constructed with a trisector, do you have a specific angle trisection approximation technique, or do you just do different things for every polygon?

@ILoveMath62
Copy link

I don't at all. But cool though!

@Eddy119
Copy link

Eddy119 commented Feb 23, 2026

17-gon, 4x circle, 37 moves… no 2x circle drawn, (0,4) happened to be already constructed by the first Carlyle circle, used Thales’ theorem to erect perpendicular
https://sciencevsmagic.net/geo/#1A0.0A1.0L1.3L2.6A4.2L8.3L7.7L5.8A9.1L11.11L20.7L20.0L15.1L16.15A20.16A20.0A31.1A52.1L70.70A1.85L86.45L70.103A20.N.1L24.1A24.1L149.1L150.129L103.103L175.175L128.128L186.186A185.191L186.186L195.195L185.1A195.191L247.185L248.186L246.246L191.191L263.245L220.220L279.247L261.261L295.263L294.294L310.295L309.309L326.310L325.325L343.326L342.342L361.248L278.278L386.279L385.385L410.386L409.409L433.410L432.432L457.433L456.456L482.457L361.482L343

Heptadecagon aka 17-gon, in origin, 38 moves. Remove 45° line, Rotate last Carlyle circle by -90° and shift by -1/2 to reuse x=-1/2 vertical line, Uses 8th vertex.
https://sciencevsmagic.net/geo/#1A0.0A1.0L1.3L2.1A6.6A0.11L10.14A0.10L24.24A12.N.0L34.1L35.1L30.30L40.34A40.35A39.1A67.83A1.97L96.34L51.51L83.96L122.N.122A9.6L148.148A6.6A148.N.191L192
https://sciencevsmagic.net/geo/#1A0.0A1.0L1.3L2.1A6.6A0.11L10.14A0.10L24.24A12.N.0L34.1L35.1L30.30L40.34A40.35A39.1A67.83A1.97L96.34L51.51L83.96L122.N.122A9.6L148.148A6.6A148.N.191L192.208A209.218L208.208L235.1A235.235L209.209L296.218L276.274L218.218L313.276L304.304L329.313L322.322L346.329L339.339L364.346L357.357L383.364L376.376L405.275L282.282L428.296L417.417L454.428L441.441L485.454L468.468L515.485L500.500L517.515L531.531L569.383L396.405L558.558L611.396L569

Alt 38 moves in origin version that uses a different first Carlyle circle
https://sciencevsmagic.net/geo/#1A0.0A1.0L1.3L2.1A6.6A0.11L10.0L12.12L20.14A20.N.1L4.1L26.26A20.27A20.1A48.20L23.64A1.77L76.26L35.64L35.76L104.N.104A9.6L129.129A6.6A129.N.174L173.194A193.205L194.194L225.1A225.205L268.225L193.193L291.266L275.275L313.291L300.300L336.313L323.323L362.336L347.347L387.362L374.374L389.387L400.400L436.267L205.205L458.268L449.449L479.458L472.472L501.479L494.494L522.501L517.517L544.522L539.539L568.544L436.425L568

Comparing the 2 Carlyle circles for (2x)²+(2x)-4=4x²+2x-4=(-1+-sqrt(17))/4
https://sciencevsmagic.net/geo/#1A0.0A1.0L1.3L2.6A0.1A6.11L12.14A0.12L24.24A7.0L34.1L4.1L31.31L40.14A34.35A39.34A39

@ILoveMath62
Copy link

ILoveMath62 commented Feb 24, 2026

@ILoveMath62
Copy link

Since you have a heptadecagon in-origin 38 moves, maybe 36 moves could possibly exist? I'm not entirely sure...

@Eddy119
Copy link

Eddy119 commented Feb 25, 2026

I don't think so, because the x=-1/2 vertical line doesn't exist in the non-in-origin version. Drawing that line there will cost one move. I've been thinking and trying.
I suggest you think and try if you can reduce the number of moves especially during the initial setup, since the scale doesn't matter at all for non-in-origin, you can just make it any size (halving or finding perpendicular costs 3 moves); or see if you can get rid of the stepping off the starting side circle for the final star trick (prob not possible), or maybe different {17/k} stars happen to be simpler (prob not either?). I still don't fully understand the requirements for the star trick.
Another idea I had was scaling the Carlyle circles' parameters to find twice or half the roots, and/or making themselves twice or half as big, but I think the current ones are already very simple, maybe the simplest.

One concept to simplify is basically seeing if you can reuse existing points/lines/circles, as maybe some things you want is already constructed, or you can use existing ones to do a task. Extending lines don't cost a move.

Feel free to also try to reduce the number of moves for the in-origin version, maybe it's possible...

Maybe at this point even if it's possible, we'll have to basically recalculate the method, but this method might already be the simplest, as the paper title suggests. We might have simplified so much already, you can only simplify so much.

@ILoveMath62
Copy link

ILoveMath62 commented Feb 26, 2026

Heptagon by approximating the side length as sqrt(36.898)/7. Relative error of the first side: 6.8456*10⁻⁹

@ILoveMath62
Copy link

Good job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment