Thabit Ibn Qurra, On Inscribing a Regular Heptagon in a Circle, props. 17, 18. Blue are added notes. Click on the diagram for the appropriate situation, or use the general diagram.

Theorem 17, dividing a line according to the needed specifications.

Theorem 18, the construction of the regular heptagon from the appropriately divided line.

For Abu Sahl's analysis and construction using conic sections (10th cent.), cf. J.L. Berggren, Episodes in the Mathematics of Islam (New York, Springer, 1986).

Theorem 17

(diagram 1)
So we postulate a square with A, B, G, D on it and we lead side AB in a straight line in the direction of A to E and we join the diagonal BG. And we fix the end point of the ruler at point D and its other end point on line AE where it divides AE at point Z and triangle ZAH is equal to triangle GTD. And from point T we lead a line KTL parallel to AG.
Notes on the construction: this can be effected through conic sections. Archimedes may have done that, but the text as the Arabs (and we) have it treats the matter as a neusis or convergence construction. One can see that the construction is possible by considering that:

(diagram 2)

As H approaches A, ZAH is smaller than TDG
As H approaches G, ZAH is larger than TDG

(diagram 3)
Hence, if we wiggle DZ, Z eventually will hit a position so that ZAH = TDG.

(diagram 4)
Then I say that the area of AB by KB is equal to the square of ZA, and that the area of ZK by AK is equal to the square of KB, and that each of the two lines BK, ZA is longer than line AK.

and again that each of the segments AZ, BK is greater than AK

(diagram 5)
And that is because the area of GD by TL is equal to the area of ZA by AH.
GD*TL = ZA*AH since triangles EAZ and TDG are equal and 1/2 GD*TL = 1/2 ZA*AH

Then the ratio of line GD, I mean AB, to ZA is as the ratio of AH to TL.
GD : ZA = AH : TL and GD = AB =>
1.    AB : ZA = AH : TL

(diagram 6)
And because each of the triangles ZAH, ZKT is similar to triangle TLD,
(diagram 7)
the ratio of AH to TL is as the ratio of ZA to LD, I mean KB.
AH : TL = ZA : LD and LD = KB =>
2.    AH : TL = ZA : KB
3.    AB : ZA = ZA : KB (from (1) and (2)

(diagram 8)
And also the ratio of TL, I mean AK, to KT, I mean KB, is as the ratio of LD, I mean KB, to ZK.
TL : KT = LD : ZK and TL = AK and KT = KB (each since BG is the diagonal of a square, with TL = LG = AK) and LD = KB =>
4    AK : KB = KB : ZK

(diagram 4)
Then the area of AB by KB is equal to the square of ZA, and the area of ZK by AK is equal to the square of KB, and each of the two lines ZA, KB is longer than line AK, and that is what we wanted.
(The last part is not actually proved, but is obvious. We need a lemma: a*c = b2 and a < c => a < b < c. Hence, ZK > AK, so that by 4 and the lemma, KB > AK; and AB > KB, so that by 3 and the lemma, AZ > KB, and, as was just shown, KB > AK, whence AZ > AK)

Lemma: a*c = b2 and a < c => a < b < c.
proof: Let a*c = b2 and a < c.
Suppose b < a. Then b2 < a2.
Let c-a = d, whence b2 = a*c = a2 + a*d < a2.
Suppose b > c. Then b2 > c2.
Let c-a = d, whence b2 = a*c = c2 - c*d > c2


Theorem 18

We now want construct a circle divided into seven equal parts.

(diagram 1)
Well let us draw AB with known end points and we distinguish on it two points G, D where the area of AD by GD is equal to the square of DB, and the area of GB by DB is equal to the square of AD and each of lines AG, DB is longer than GD, as is known in the previous construction.

(diagram 2)
And from lines AG, GD, DB, we construct a triangle GED with side GE equal to line AG and side DE equal to line DB. And we join AE, EB, and we circumscribe about triangle AEB circle AEBHZ, and we lead out lines EG, ED in a straight line to the circumference, let them fall on points Z, H. We join BZ and we lead out line GT from G to the intersection.

(diagram 3)
Since sides AG, GE of triangle AGE are equal., angle EAG is equal to angle AEG and arc AZ to arc EB.

(diagram 4)
And because the area of AD by GD is equal to the square of DB, I mean DE, triangle AED is similar to triangle GED and angle DAE is equal to angle GED and arc ZE is equal to arc EB
AD*GD = DB2 = DE2 => AD : DE = DE : GD and EDG is common.

So, the three arcs EB, AZ, ZH are equal to each other.

(diagram 5)
And ZB is parallel to AE, and angle GAE, I mean GED, is equal to angle DBT.
ZB is parallel to AE because arc BE = arc AZ (or any of several other reasons). GAE = DBT because of alternating interior angles, and hence,

(diagram 6)
And because angle GED is equal to angle DBT and angle GDE to angle TDB, and line ED to line DB, GD equals DT. and GE equals TB, and one circle goes through the four points B, E, G, T.
The construction of the circle follows from ED : DT = BD : DG, which follows from the homologous terms being equal.

(diagram 7)
Then because the area of GB by DB is equal to the square of AG, I mean EG, and line GB is equal to TE and DB is equal to DE, the area of TE by ED is equal to the square of EG, triangle TEG is similar to triangle GED and angle DGE is equal to angle ETG.
(since GB = TE or GD+DB = ED+DT, and DB = DE) =>
TE : EG = EG : ED and GED is common.

But angle DGE equals twice angle GAE, so that angle GTE equals twice angle GAE.
DGE is the external angle of GEA so that DGE = GEA + GAE = 2GAE

(diagram 8)
And angle GTD is equal to angle DBE, so that angle DBE equals twice angle GAE and arc AE is double arc EB.
GTD = DBE because they are both angles of arc EG.
DBE = BED because DB = DE.

And because angle DEB equals angle DBE, arc HB is also double arc EB.

(diagram 9)
And each of the arcs AE, BH is divided in two equal halves which are equal and are equal to arc EB.

And so circle AEBHZ is divided into seven equal parts, and that is what we wanted.

(diagram 10)