Skip to content

Instantly share code, notes, and snippets.

@mrflip
Last active January 12, 2026 08:07
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):

@Eddy119
Copy link

Eddy119 commented May 8, 2020

Well, to construct a 13-gon, you have to trisect a certain angle... check http://web.archive.org/web/20151219180208/http://apollonius.math.nthu.edu.tw/d1/ne01/jyt/linkjstor/regular/7.pdf out for 3θ (3 times the desired angle) or https://commons.wikimedia.org/wiki/File:01-Dreizehneck-N%C3%A4herung.svg for a very good approximation... I tried to do both but I just couldn't...

@Eddy119
Copy link

Eddy119 commented May 8, 2020

Once we know how to approximately trisect an angle well enough to trick the website, we can pretty much make all of the polygons up to 40 except 23, 25, 29, 31

@Eddy119
Copy link

Eddy119 commented May 8, 2020

41, 43, 47, 53, 59, 67, 71... basically all the prime numbers that are neither fermat primes nor pierpoint primes

@Eddy119
Copy link

Eddy119 commented May 8, 2020

51-gon should be constructible as it is 17*3 and (2^n)*, 3* or 5* (7, 9, 11, 13, 19 , 37) should be approximately constructible as 7, 9, 11 is already done and 13, 19, 37 are pierpoint primes

@Eddy119
Copy link

Eddy119 commented May 8, 2020

Should be recognised by website except Bold:
2 (...)
3 (fermat no.)
4 (2^2)
5 (fermat no.)
6 (3*2)
7 (approx. constructible, pierpoint prime)
8 (2^3)
9 (3^2, approx. const.)
10 (5*2)
11 (approx. constructible as shown by me)
12 (3*2^2)
13 (should be approx. const. , please share, pierpoint)
14 (7*2, approx. const.)
15 (7*5)
16 (2^4)
17 (fermat prime, next fermat is 257)
18 (9*2, approx. )
19 (pierpoint, should be approx. const., please share)
20 (5*2^2)
21 (7*3, should be approx. please share)
22 (11*2)
23 (not pierpoint, if someone can approximate this, congrats, please share) 2025 update: @Doomslug682 did it below! copying for redundancy
24 (3*2^3)
25 (5*5, not pierpoint, if someone can approximate this, congrats, please share) 2025 update: also by Doomslug682 above, backup
26 (13*2, please share 13)
27 (9*3, should be approx. const., please share)
28 (7*2^2)
29 (not pierpoint, please share)
30 (5*2*3, please share)
31 (not pierpoint, please share)
32 (2^5)
33 (11*3, approx, please share)
34 (17*2)
35 (7*5, approx const because one is pierpoint and other is fermat)
36 (2*2*3*3, approx)
37 (pierpoint, approx)
38 (19*2, please share)
39(13*3)
40 (5*2^3) ...
41 (not pierpoint, please share)
42 (7*2*3, please share)
Italic involves trisecting an angle and Bold can't be made either by bisecting nor trisecting

@mrflip
Copy link
Author

mrflip commented May 10, 2020

Thanks Eddy! I'll batch these up at some point. I found a new (for me) trick when stellating a polygon to fill out the edges: a diameter of the circle goes through the points of the star, so if your construction can naturally have two diameters with enough of an angle spread you can avoid drawing a circle to reflect the vertices off. You can see that in the 20-gon solution I just put up, where it saves one move.

@Eddy119
Copy link

Eddy119 commented May 10, 2020

I'm not sure how floating point math works but I guess it results in some less approximate constructions being recognised and some more approximate constructions not being recognised.

@Ian-Zander
Copy link

Ian-Zander commented May 2, 2025

Could you use the spiral of Theodorus to create any-sided* shape?

@Ian-Zander
Copy link

@Doomslug682
Copy link

7-gon (made from 14-gon)
7-gon

23-gon (made by trigonometry [taking the tangent])
23-gon

25-gon (trig)
25-gon

@Doomslug682
Copy link

Doomslug682 commented Sep 10, 2025

26-gon (half of 13-gon)
26-gon

27-gon (trig)
27-gon

28-gon (from 14-gon)
28-gon

@Doomslug682
Copy link

30-gon (from 5-gon)
30-gon

32-gon (from 16-gon)
32-gon

33-gon (from 11-gon)
32-gon

@Eddy119
Copy link

Eddy119 commented Sep 10, 2025

nice!
seems like 27-gon isn't recognized tho?
(I'm alive, i don't even remember what i did 5 years ago fully)

@Eddy119
Copy link

Eddy119 commented Sep 10, 2025

Next challenge is 23-gon and 25-gon in origin 😈

@Eddy119
Copy link

Eddy119 commented Sep 10, 2025

33-gon (from 11-gon) 32-gon

Wrong link? link is also 32-gon

edit: 33-gon is interesting because it's not a constructible polygon; 11 is already an approximation and trisecting that is another approximation, so hopefully @Doomslug682 comes back and gives us his 33-gon

edit 2: i just realized once you trisect a side of a 11-gon (line trisection can be done exactly), that's a 33-gon

edit 3: no it does not, if trisecting a side of a triangle gives you a nonagon, a nonagon (9-gon) would be constructible but it isn't... Doomslug682, please give us your 33-gon, even better would be explanations...

edit 4: new hypothesis: if you can approximate a non-constructible n-gon closely, you can also approximate a non-constructible n⋅m-gon, where m itself is constructible. edit/hypothesis 4.2: the n⋅m-gon will have the same amount of error as the n-gon. edit 4.1: you can overlay 2 fermat prime polygons together to get F_1 * F_2 gon, e.g. 5 * 3 for 15-gon but not 3 * 3 or 5 * 5 tho. (edit 4.1 is proven knowledge, Gauss-Wantzel Theorem) edit 4.1.1: for distinct Fermat primes p,q one can subtract integer multiples of 2π/p from 2π/q and bisect suitably to obtain 2π/(pq), so the pq-gon is constructible.

@mrflip
Copy link
Author

mrflip commented Sep 10, 2025

Good to see these still coming in.
Are any of these artifacts of floating point or are they all exact?

@Eddy119
Copy link

Eddy119 commented Sep 10, 2025

i think all non-constructible polygons should theoretically be floating point since mathematically it's not exact? I'm not sure what numbers the computer calculates and detects, but as in the main post and Wiki, constructible polygons are mathematically defined (by the "the Gauss–Wantzel theorem").

So, from the number list in the main post, I think 30-gon and 32-gon could be exact if Doomslug682 did it right (could also be approximations though, need to check actual construction to verify, at a glance I'm guessing they're exact), the rest has to be approximations

32-gon should be hard to fake, it's just bisecting an octagon repeatedly

Haven't done this in a long time...

P.S. (don't want to email ping) 23 and 25-gon might be impressive because according to past me (I forgot) trisecting angles can be very closely approximated, but 23 and 25 can't be done that way, so Doomslug682 did it some other way, I forgot everything though!

P.P.S. ugh this link is dead for me... http://web.archive.org/web/20151219180208/http://apollonius.math.nthu.edu.tw/d1/ne01/jyt/linkjstor/regular/7.pdf
P.P.P.S. it's back, seems like Internet Archive was down momentarily

@Eddy119
Copy link

Eddy119 commented Sep 10, 2025

If you look at Doomslug682's constructions of the 23-gon and 25-gon, the polygon is huge compared to the origin line, probably has to do with floating point trick, not sure

@Eddy119
Copy link

Eddy119 commented Sep 11, 2025

28-gon in 64 moves

Edit:
Also 28-gon in 64 moves,
Literally the same thing, just used circles instead of lines for the last few sides

@Eddy119
Copy link

Eddy119 commented Sep 11, 2025

26-gon in 104 moves
just got rid of the inscribed 13-gon before bisecting

@Doomslug682
Copy link

Okay, here's the 33-gon
33-gon

@Doomslug682
Copy link

I created the 23- and 25-gon by calculating the tangent of the internal angle of one side of the polygon, and then constructing two lines at right angles that had that ratio to each other to, like, 5 decimal points, than connected the loose edges and used the angle I got to construct the polygon.
As far as I know, the link for the 27-gon will not work, because it always ends up scrambled when I try to use the link. It may just be that my device (a Chromebook) is having trouble copying the link, so if you want to try to finish it yourself, the angle of the polygon is intact.
This is the link to the pattern before it went crazy. Hope this helps!

@Doomslug682
Copy link

More polygons!

38-gon
38-gon

42-gon
42-gon

60-gon
60-gon

64-gon
64-gon

96-gon
96-gon

114-gon
114-gon

@Eddy119
Copy link

Eddy119 commented Sep 11, 2025

Amazing! Based on what I see, you've discovered that there is already a 33-gon side length in that 11-gon approximation!
33-gon in 87 moves, I just did some simple optimizing of Doomslug682's 33-gon by removing the already done 11-gon etc

Floating point is weird, if there are >=2 very close points together you can only build with one of them and that might decide whether the shape is recognized or not

Maybe someone can figure out optimizing by doing mrflip's star technique;
Also next challenge is 29-gon :D
Regarding spiral of Theodorus, I have no idea.

Edit: Posted this before seeing the 23- and 25-gon explanations, and 38- more polygons, will check

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