Euclid book I Proposition 1: Construct an equilateral triangle given a straight line

classic Classic list List threaded Threaded
5 messages Options
HJH
Reply | Threaded
Open this post in threaded view
|

Euclid book I Proposition 1: Construct an equilateral triangle given a straight line

HJH
This post was updated on .
Hello Hilaire

I'd like to do the construction of an equilateral triangle with DrGeo scripting. The construction is from Euclid's elements book I.


Construction of an equilateral triangle

Title: The First Six Books of the Elements of Euclid
http://www.gutenberg.org/files/21076/21076-h/21076-h.htm

PROP. I.—Problem.
On a given finite right line (AB) to construct an equilateral triangle.
http://www.gutenberg.org/files/21076/21076-h/images/f012.png


The code so far:

| c ptA ptB ptC ptD ptE ptG ptH segC rayAB rayBA lineAB lineAC lineCB circleA circleB helpLineColor |

 helpLineColor := Color white.

 c := DrGeoCanvas new.
 ptA := c point: -1@0.
 ptA name: 'A'.
 ptB := c point: 1@0.
 ptB name: 'B'.
 segC := c segment: ptA to: ptB.
 
 circleA := c circleCenter: ptA to: ptB.
 circleB := c circleCenter: ptB to: ptA.

 ptC := c intersectionOf: circleB and: circleA.
 ptC name: 'C'.

 lineAB := c line: ptA to: ptB.
 lineAB color: helpLineColor.

 rayBA := c ray: ptB to: ptA.
 rayBA color: helpLineColor.

 rayAB := c ray: ptA to: ptB.
 rayAB color: Color green.


 ptD := c intersectionOf: circleA  and: lineAB.
 ptD name: 'D'.

 ptE := c intersectionOf: rayAB  and: circleB.
 ptE name: 'E'.

 lineAC := c line: ptA to: ptC.
 lineAC color: helpLineColor.
 
 ptG := c intersectionOf: circleA  and: lineAC.
 ptG name: 'G'.

 lineCB := c line: ptB to: ptC.
 lineCB color: helpLineColor.


 ptH := c intersectionOf: circleB  and: lineCB.
 ptH name: 'H'.

 c segment: ptA to: ptC.
 c segment: ptB to: ptC.


The result:
The result of the DrGeo code : equilateral triangle construction


The problems:

a) I want the helper lines to be invisible:

        helpLineColor := Color transparent.

    does not work; so I use

        helpLineColor := Color white.
 
    But this gives the problem that some of the point marks (the small red squares) have a white line
    crossing them.


b) How do I get point E : the intersection of the ray with origin A going to B with circle B?


c) The z-order of the lines. The helper lines are 'over' the segment AB. How do I bring the segment AB
    to the top?


Regards

Hannes



References:

Title: The First Six Books of the Elements of Euclid
http://www.gutenberg.org/files/21076/21076-h/21076-h.htm
Annotated.

http://farside.ph.utexas.edu/Books/Euclid/Elements.pdf   p.8
(bilingual - greek and english, no annotations)

https://mathcs.clarku.edu/~djoyce/elements/bookI/bookI.html
The proposition: https://mathcs.clarku.edu/~djoyce/elements/bookI/propI1.html
Reply | Threaded
Open this post in threaded view
|

Re: Euclid book I Proposition 1: Construction an equilateral triangle given a straight line

Hliaire Fernandes
Administrator
Hi Hannes,

Regarding your questions, follow some indications:

Question a)
You want to hide an object, so you just send the #hide message to it.
https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#index-Smalltalk-sketch_002c-object-attributes

Question b)
Use the #altIntersectOf:and: message to construct the second intersection point.
https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#index-altIntersectionOf_003aand_003a-on-DrGeoCanvas

Question c)
You can't. Just change the order of construction of your items.

Hilaire
HJH
Reply | Threaded
Open this post in threaded view
|

Re: Euclid book I Proposition 1: Construction an equilateral triangle given a straight line

HJH
Hello Hilaire

Thank you for answering the questions. This allowed me to come up with an updated script which I post below together with the sketch as a result.

A fourth question: how can I control the font size of the names of the points?


| c ptA ptB ptC
circleA circleB
ptD ptE ptG ptH
segAB rayAB rayBA
lineAB lineAC lineCB |

 c := DrGeoCanvas new.

 "Given is a segment AB"
 ptA := c point: -1@0.
 ptA name: 'A'.

 ptB := c point: 1@0.
 ptB name: 'B'.

 segAB := c segment: ptA to: ptB.

 "Use two circles to get point C"
 circleA := c circleCenter: ptA to: ptB.
 circleB := c circleCenter: ptB to: ptA.

 ptC := c intersectionOf: circleB and: circleA.
 ptC name: 'C'.

 "The equilateral triangle is given by the points A,B and C.
  thus construct the segments."
 c segment: ptA to: ptC.
 c segment: ptB to: ptC.


 "-- get additional points D, E, G and H with hidden helper lines"
 rayBA := c ray: ptB to: ptA.
 ptD := c altIntersectionOf: circleA  and: rayBA.
 ptD name: 'D'.
 rayBA hide.

 rayAB := c ray: ptA to: ptB.
 ptE := c altIntersectionOf: circleB  and: rayAB.
 ptE name: 'E'.
 rayAB hide.

 lineAC := c line: ptA to: ptC.
 ptG := c intersectionOf: circleA  and: lineAC.
 ptG name: 'G'.
 lineAC hide.

 lineCB := c line: ptB to: ptC.
 ptH := c intersectionOf: circleB  and: lineCB.
 ptH name: 'H'.
 lineCB hide.

Euclid Elements Book I Proposition 1


Could you please have a look at the code and comment it.
Do you have an idea to make it simpler or more easily readable?
Later I suggest that I add the example (together with others) to the documentation chapter 5.
https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#Smalltalk-sketches-by-example

--Hannes
HJH
Reply | Threaded
Open this post in threaded view
|

Re: Euclid book I Proposition 1: Construction an equilateral triangle given a straight line

HJH
Point F needs to be added as well

"second intersection point of the circles"
 ptF := c altIntersectionOf: circleB and: circleA.
 ptF name: 'F'.
HJH
Reply | Threaded
Open this post in threaded view
|

Re: Euclid book I Proposition 1: Construction an equilateral triangle given a straight line

HJH
This post was updated on .
https://www.tate.org.uk/art/artworks/turner-lecture-diagram-euclids-elements-of-geometry-book-1-propositions-1-and-4-d16995

Prepared in connection with his lectures as Professor of Perspective at the Royal Academy, Turner’s diagram of various geometrical figures is based on an illustration in Samuel Cunn’s Euclid’s Elements of Geometry (London 1759, book 1, plate 1, Propositions 1 and 4).

The left figure illustrates Proposition 1,
‘Problem: To describe an equilateral triangle upon a given finite right line’,


while the right describes Proposition 4:

William Turner

Creative Commons Licence CC-BY-NC-ND 3.0 (Unported), Photo © Tate Gallery