POV-Ray : Newsgroups : povray.general : Fitting a gothic trefoil into an equilateral triangle Server Time
24 Dec 2024 13:23:12 EST (-0500)
  Fitting a gothic trefoil into an equilateral triangle (Message 1 to 10 of 28)  
Goto Latest 10 Messages Next 10 Messages >>>
From: LibraryMan
Subject: Fitting a gothic trefoil into an equilateral triangle
Date: 12 Jun 2003 15:25:01
Message: <web.3ee8d340930262bc738e706a0@news.povray.org>
I am trying to figure out, because my geometry is weak, how to create a
Gothic trefoil design (http://www.newyorkcarver.com/geometry/Trifoil.htm)
fitting "comfortably" within another equilateral arch
(http://www.newyorkcarver.com/geometry/equilarch.htm).

Or, put another way, how to fit three mutually equidistant congruent circles
such that each circle is tangent to two adjacent sides of an equilateral
triangle.
Maybe someone could help me express the numeric relationships based on an
eq. triangle with one side = "x"?

Thanks!


Post a reply to this message

From: Jellby
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 12 Jun 2003 18:09:41
Message: <3ee8fa24@news.povray.org>
Among other things, LibraryMan wrote:

> I am trying to figure out, because my geometry is weak, how to create a
> Gothic trefoil design (http://www.newyorkcarver.com/geometry/Trifoil.htm)
> fitting "comfortably" within another equilateral arch
> (http://www.newyorkcarver.com/geometry/equilarch.htm).
> 
> Or, put another way, how to fit three mutually equidistant congruent
> circles such that each circle is tangent to two adjacent sides of an
> equilateral triangle.
> Maybe someone could help me express the numeric relationships based on an
> eq. triangle with one side = "x"?


- Circles with radius R.
- Centers of circles form a equilateral triangle ABC of side L
- All 3 circles are tangent to a "circumscribed" triangle abc of side l
- Circle centered in A touches abc in P and Q.
- aPA is a triangle with angles of 30, 90 and 60 degrees, one leg (PA) is R, 
the other leg (aP) should be easy to calculate: sin(30)/R=sin(60)/aP
- The outer's triangle side (ab) is: aP+AB+Sb = 2*aP+L
- The relationship between R and L should be easy too: sin(60)=L/(2*R)
- I may be mistaken.

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From:
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 12 Jun 2003 23:51:10
Message: <3ee94a2e$1@news.povray.org>
// Hi LibraryMan,
//
// here is some code for you to play with; the radius of the circles
// can be specified:
//
//    Side * (sqrt(3)-1)/4   circles are mutually touching
//    Side * sqrt(3)/9       circles intersect in midpoint ("true gothic")
//    Side * sqrt(3)/6       circles have max. size (all are equal)
//
// The distance of the centers (distance AB as named in your link) is
//
//    Side-2*sqrt(3)*Radius
//
//
//
// Sputnik
//
//
// ----------------------------

// fr### [at] computermuseumfh-kielde
// ----------------------------


// +W640 +H480 -F +D +A0.1

// macro for trefoil ====================================================

#macro Trefoil (Side, Radius) // lower left corner at origin

  #local R = 0.005; // "Linewidth"/2

  #local Height  = sqrt(3)/2*Side;

  #local Corner1 = <Side/2, Height, 0>; // top corner
  #local Corner2 = 0; // bottom left corner
  #local Corner3 = Side*x; // bottom right corner

  #local Center  = <Side/2, Height/3, 0>; // triangle

  #local Center1 = <Side/2, Height-2*Radius, 0>; // top circle
  #local Center2 = <sqrt(3)*Radius, Radius, 0>; // bottom left circle
  #local Center3 = <Side-sqrt(3)*Radius, Radius, 0>; // bottom right circle

  union {
    union {
      sphere { Corner1, R }
      sphere { Corner2, R }
      sphere { Corner3, R }
      cylinder { Corner1, Corner2, R }
      cylinder { Corner2, Corner3, R }
      cylinder { Corner3, Corner1, R }
      texture { pigment { color green 1 } finish { ambient 1 } }
      }
    union {
      torus { Radius, R rotate 90*x translate Center1 }
      torus { Radius, R rotate 90*x translate Center2 }
      torus { Radius, R rotate 90*x translate Center3 }
      texture { pigment { color red 1 } finish { ambient 1 } }
      }
    // "}" omitted to allow application of transformations

  #end//macro Trefoil


// simple scene with trefoils ===========================================

Trefoil ( 1  , 1*(sqrt(3)-1)/4 ) translate <-1.6,  0.2  , 1> } // small
Trefoil ( 2  , 2*sqrt(3)/9     ) translate <-1  , -1    , 1> } // gothic
Trefoil ( 1  , 1*sqrt(3)/6     ) translate < 0.6,  0.2  , 1> } // large

light_source { <-1500, 2500, -2000>, color rgb 1 }

camera { orthographic up 3*y right 4*x }


// END ==================================================================


Post a reply to this message

From: LinuxLibrarian
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 13 Jun 2003 08:59:00
Message: <3ee9ca94@news.povray.org>
Jellby wrote:
> 
> - Circles with radius R.
> - Centers of circles form a equilateral triangle ABC of side L
> - All 3 circles are tangent to a "circumscribed" triangle abc of side l
> - Circle centered in A touches abc in P and Q.
> - aPA is a triangle with angles of 30, 90 and 60 degrees, one leg (PA) is R, 
> the other leg (aP) should be easy to calculate: sin(30)/R=sin(60)/aP
> - The outer's triangle side (ab) is: aP+AB+Sb = 2*aP+L
> - The relationship between R and L should be easy too: sin(60)=L/(2*R)
> - I may be mistaken.
> 

Looks great, and thanks, but... What's the "S" in Sb? :-}


Post a reply to this message

From: LinuxLibrarian
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 13 Jun 2003 09:01:27
Message: <3ee9cb27@news.povray.org>

> // Hi LibraryMan,
> //
> // here is some code for you to play with; the radius of the circles
> // can be specified:
> //
> //    Side * (sqrt(3)-1)/4   circles are mutually touching
> //    Side * sqrt(3)/9       circles intersect in midpoint ("true gothic")
> //    Side * sqrt(3)/6       circles have max. size (all are equal)
> //
> // The distance of the centers (distance AB as named in your link) is
> //
> //    Side-2*sqrt(3)*Radius
> //
> //
> //
> // Sputnik
> //
> //
> // ----------------------------

> // fr### [at] computermuseumfh-kielde
> // ----------------------------
> 
> 
> // +W640 +H480 -F +D +A0.1
> 
> // macro for trefoil ====================================================
> 
> #macro Trefoil (Side, Radius) // lower left corner at origin
> 
>   #local R = 0.005; // "Linewidth"/2
> 
>   #local Height  = sqrt(3)/2*Side;
> 
>   #local Corner1 = <Side/2, Height, 0>; // top corner
>   #local Corner2 = 0; // bottom left corner
>   #local Corner3 = Side*x; // bottom right corner
> 
>   #local Center  = <Side/2, Height/3, 0>; // triangle
> 
>   #local Center1 = <Side/2, Height-2*Radius, 0>; // top circle
>   #local Center2 = <sqrt(3)*Radius, Radius, 0>; // bottom left circle
>   #local Center3 = <Side-sqrt(3)*Radius, Radius, 0>; // bottom right circle
> 
>   union {
>     union {
>       sphere { Corner1, R }
>       sphere { Corner2, R }
>       sphere { Corner3, R }
>       cylinder { Corner1, Corner2, R }
>       cylinder { Corner2, Corner3, R }
>       cylinder { Corner3, Corner1, R }
>       texture { pigment { color green 1 } finish { ambient 1 } }
>       }
>     union {
>       torus { Radius, R rotate 90*x translate Center1 }
>       torus { Radius, R rotate 90*x translate Center2 }
>       torus { Radius, R rotate 90*x translate Center3 }
>       texture { pigment { color red 1 } finish { ambient 1 } }
>       }
>     // "}" omitted to allow application of transformations
> 
>   #end//macro Trefoil
> 
> 
> // simple scene with trefoils ===========================================
> 
> Trefoil ( 1  , 1*(sqrt(3)-1)/4 ) translate <-1.6,  0.2  , 1> } // small
> Trefoil ( 2  , 2*sqrt(3)/9     ) translate <-1  , -1    , 1> } // gothic
> Trefoil ( 1  , 1*sqrt(3)/6     ) translate < 0.6,  0.2  , 1> } // large
> 
> light_source { <-1500, 2500, -2000>, color rgb 1 }
> 
> camera { orthographic up 3*y right 4*x }
> 
> 
> // END ==================================================================
> 
> 
Thanks, I'll play with this too! (not to confuse people, but LibraryMan 
and LinuxLibrarian are the same person, but LibraryMan is my screen name 
for when I'm posting via the web interface to the newsgroup)
--LinuxLibrarian


Post a reply to this message

From: Jellby
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 13 Jun 2003 10:38:19
Message: <3ee9e1db@news.povray.org>
Among other things, LinuxLibrarian wrote:

> Jellby wrote:
>> 
>> - Circles with radius R.
>> - Centers of circles form a equilateral triangle ABC of side L
>> - All 3 circles are tangent to a "circumscribed" triangle abc of side l
>> - Circle centered in A touches abc in P and Q.
>> - aPA is a triangle with angles of 30, 90 and 60 degrees, one leg (PA) is
>> R, the other leg (aP) should be easy to calculate: sin(30)/R=sin(60)/aP
>> - The outer's triangle side (ab) is: aP+AB+Sb = 2*aP+L
>> - The relationship between R and L should be easy too: sin(60)=L/(2*R)
>> - I may be mistaken.
>> 
> 
> Looks great, and thanks, but... What's the "S" in Sb? :-}

It would be one the point where the circle centered on B touches the ab 
side. Have you drawn it?

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: LibraryMan
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 14 Jun 2003 11:15:01
Message: <web.3eeb3b98a1d38d6b738e706a0@news.povray.org>
Jellby wrote:

>It would be one the point where the circle centered on B touches the ab
>side. Have you drawn it?

I thought that was what you might mean, but wanted to make sure, since you
assigned letters to all the other points you specifically referenced....
:-)
--Mark


Post a reply to this message

From: LinuxLibrarian
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 17 Jun 2003 19:56:40
Message: <3eefaab8@news.povray.org>

> // Hi LibraryMan,
> //
> // here is some code for you to play with; the radius of the circles
> // can be specified:
> //
> //    Side * (sqrt(3)-1)/4   circles are mutually touching
> //    Side * sqrt(3)/9       circles intersect in midpoint ("true gothic")
> //    Side * sqrt(3)/6       circles have max. size (all are equal)
> //
> // The distance of the centers (distance AB as named in your link) is
> //
> //    Side-2*sqrt(3)*Radius
> //
> //
> //
> // Sputnik
> //
> //
> // ----------------------------

> // fr### [at] computermuseumfh-kielde
> // ----------------------------
> 
> 
> // +W640 +H480 -F +D +A0.1
> 
> // macro for trefoil ====================================================
> 
> #macro Trefoil (Side, Radius) // lower left corner at origin
> 
>   #local R = 0.005; // "Linewidth"/2
> 
>   #local Height  = sqrt(3)/2*Side;
> 
>   #local Corner1 = <Side/2, Height, 0>; // top corner
>   #local Corner2 = 0; // bottom left corner
>   #local Corner3 = Side*x; // bottom right corner
> 
>   #local Center  = <Side/2, Height/3, 0>; // triangle
> 
>   #local Center1 = <Side/2, Height-2*Radius, 0>; // top circle
>   #local Center2 = <sqrt(3)*Radius, Radius, 0>; // bottom left circle
>   #local Center3 = <Side-sqrt(3)*Radius, Radius, 0>; // bottom right circle
> 
>   union {
>     union {
>       sphere { Corner1, R }
>       sphere { Corner2, R }
>       sphere { Corner3, R }
>       cylinder { Corner1, Corner2, R }
>       cylinder { Corner2, Corner3, R }
>       cylinder { Corner3, Corner1, R }
>       texture { pigment { color green 1 } finish { ambient 1 } }
>       }
>     union {
>       torus { Radius, R rotate 90*x translate Center1 }
>       torus { Radius, R rotate 90*x translate Center2 }
>       torus { Radius, R rotate 90*x translate Center3 }
>       texture { pigment { color red 1 } finish { ambient 1 } }
>       }
>     // "}" omitted to allow application of transformations
> 
>   #end//macro Trefoil
> 
> 
> // simple scene with trefoils ===========================================
> 
> Trefoil ( 1  , 1*(sqrt(3)-1)/4 ) translate <-1.6,  0.2  , 1> } // small
> Trefoil ( 2  , 2*sqrt(3)/9     ) translate <-1  , -1    , 1> } // gothic
> Trefoil ( 1  , 1*sqrt(3)/6     ) translate < 0.6,  0.2  , 1> } // large
> 
> light_source { <-1500, 2500, -2000>, color rgb 1 }
> 
> camera { orthographic up 3*y right 4*x }
> 
> 
> // END ==================================================================
> 
> 
Following up after your explanation about the unintentional personal 
reply, I appreciate your offer to give further explanation.  I realized 
after my original posting of the question that it's theoretically 
possible to have numerous (even infinite?) possibilities for circles 
within a triangle which fit the parameters I mentioned.  The circles 
could be infinitely small and still fit, being tangent to both sides 
surrounding a vertex.
The 2nd configuration you listed, with the radius equal to Side * 
sqrt(3)/9 , was of course the one I had in mind, but how did you figure 
out the math?  Just curious -- I rendered it and it works, sure, so I'm 
not "looking a gift horse in the mouth"
Thanks,
Mark


Post a reply to this message

From:
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 23 Jun 2003 19:57:06
Message: <3ef793d2$1@news.povray.org>
Hi Mark,

here is "The Making of '#macro Trefoil'"; names starting with an
uppercase letter refer to variables in the code of my last post.

(don't underestimate the importance of the first two of the following
points!)


1. Find out the given and wanted elements (lengths, angles, ...)
   and choose descriptive names for them

You asked for inscribing circles into an equilateral triangle, so all
of its angles are 60 degrees. The length of its sides is given; this
length got the name 'Side'. Obviously the triangle is to be erected
over a horizontal line, so it has a top corner ('Corner1'), a bottom
left corner ('Corner2') and a bottom right corner ('Corner3').
Because the problem has an infinite number of solutions, I decided
to use the radius 'Radius' of the circles as independent variable
and to calculate their midpoints 'Center1', ... , 'Center3'.


2. Choose a coordinate system

Usually the math is easier when many coordinates are 0 or 1: multiplying
by 1 is trivial, by 0 even more; adding of 0 is trivial; squaring 0 or 1
is the same as doing nothing; and so on.
If there is a mirror symmetry with respect to a line/point, then very often
(but not always) this line/point is well suited as coordinate axis/origin.
Sometimes it is easier to solve a standard problem and then transform
it to the required proportions; for example (in POV style): instead
of sphere{C,R ... } use sphere{0,1 ... scale R translate C}.

The trefoil is a problem in plane geometry, so I only use x- and y-
coordinates and set all z=0 (I will leave them out here, but had written
these zeros in the code).
Because circles are to be put into the *corners* of the outer triangle,
I decided to use a corner (Corner2) as origin, so
   Corner2=<0,0>
Corner3 sits on the x-axis, so
   Corner3=<Side,0>.


3. Make a drawing of the geometric situation

In most cases, an approximate scetch without large obvious errors will
suffice. Use thick lines for every known element. Don't believe everything
you see! The drawing can't prove anything, its sole purpose is to trigger
the intuition and to keep track of the known and the not-yet-known
elements. Do this even for very simple situations.
(Please do this *now* to make it easy to follow the following explanations!)


4. Look for properties that allow application of geometric theorems

Very often symmetries, right angles, congruent triangles and parallels
are the key for a solution. If you have none, create them by erecting
perpendiculars, drawing parallels etc.
This is the inspiration part of the solution of geometric problems.


5. Find out relevant elements (coordinates, lengths, angles, ...) until all
   wanted elements are known

This is the transpiration part of the solution of geometric problems.

[ top corner ]
The first step in the trefoil problem is to find the top corner. Due to
the triangle's mirror symmetry with respect to the perpendicular from
the top corner,
   Corner1.x=Side/2.
The y-coordinate is the Height of the triangle, found by the law of
pythagoras in the right-angled triangle
   top point -- bottom left point -- midpoint of base line
so we get
   Height^2 + (Side/2)^2 = Side^2
Solving for Height gives
   Height = sqrt( Side^2 + Side^2/4 ) = sqrt(3)/2*Side

[ centers ]
Now look at the midpoint 'Center2' of a circle touching the sides
emanating from Corner2. Due to symmetry of this circle and the triangle
with respect to the line through Corner2 and Center2, the angle between
this line and the x-axis is 30 degrees (60/2). Now imagine a new point:
the mirror image 'M' of Center1 with respect to the x-axis. The triangle
   Corner2 -- Center1 -- M
has 30+30 degrees at Corner1 (x-axis symmetry), its other two angles are
equal (same symmetry). So all angles are 60 degrees, i.e. this triangle
is equilateral. The vertical side obviously has a length=2*Radius, and
because of the equilaterality, the other sides have the same length. The
part of the x-axis within this triangle is a height of this triangle, and
as seen above with the outer triangle, height=sqrt(3)/2*length_of_side.
But this height of the small triangle is the x-coordinate of Center2!
So we have
   Center2.x = sqrt(3)/2 * 2*Radius = sqrt(3)*Radius
and obviously
   Center2.y = Radius
By symmetry with respect to the perpendicular from the top corner onto
the x-axis:
   Center3.x = Side - sqrt(3)*Radius
   Center3.y = Radius
As seen above,
   distance between Center2 and Corner2
   = length_of_side of the small triangle
   = 2*Radius
Because the three circles are equal,
   distance between Center1 and Corner1 = 2*Radius
I.e. Center1 is 2*Radius below Corner1, so we get
   Center1 = <Side/2, Height-2*Radius>

[ maximal Radius, minimal Radius ]
Because all triangles should lie completely inside the outer triangle,
the maximal Radius is the radius of the incircle. Then (symmetry!)
   center2_for_max_Radius.x = Side/2
Above we found
   Center2.x = sqrt(3)*Radius
For the maximal circle we get
   center2_for_max_Radius.x = sqrt(3)*max_radius
So
   Side/2 = sqrt(3)*max_radius
i.e.
   max_Radius = Side/2/sqrt(3) = Side * sqrt(3)/6
The minimal Radius obviously is zero, so all values in the range
   0 .. Side*sqrt(3)/6
are possible radii.

[ Radius of mutually touching circles ]
The circles are touching when the distance of their centers = 2*Radius.
The situation is easily analyzed by looking at Center2 and Center3:
   Center3.x - Center2.x = 2*touch_Radius [y-coordinates are equal!]
The coordinates of these centers are known:
   Side-sqrt(3)*touch_Radius - sqrt(3)*touch_Radius = 2*touch_Radius
A little calculation solves this for touch_Radius:
   Side = (2*sqrt(3)-2) * touch_Radius
   touch_Radius = Side / (2*sqrt(3)-2) [now expand by (2*sqrt(3)+2):]
   = Side * (sqrt(3)-1)/4

[ center of triangle ]
This point isn't needed for the problem, but I suggest to calculate
almost everything you can: it often gives deeper insight in the
problem, reveals unexpected relations and simplifies other steps.
In the trefoil problem, it helps finding the "true gothic" Radius.
Again because of symmetry,
   Center.x = Side/2
The bisectors of a triangle (which in this case also are angular
bisectors and heights) intersect in its center of gravity and
are divided by this point in a 2:1 ratio. This gives us
   Center.y = Height/3

[ "true gothic" Radius ]
In a "true gothic" situation, all circles meet at the Center, so
their distance from this Center = Radius. In this case, the situation
at the top is most easy:
   gothic_Center1.y - Center.y = gothic_Radius [x-coordinates are equal!]
Because
   Center1.y = Height-2*Radius
we have the special case
   gothic_Center1.y = Height-2*gothic_Radius = sqrt(3)/2*Side-2*gothic_Radius
We already found in the previous section
   Center.y = Height/3 = sqrt(3)/6*Side
Putting all this together and solving for gothic_Radius, we find
   sqrt(3)/2*Side-2*gothic_Radius - sqrt(3)/6*Side = gothic_Radius
   sqrt(3)/3*Side = 3*gothic_Radius
   gothic_Radius = sqrt(3)/9*Side


6. During the paragraph 5 implement everything at once in POV-Ray

This will reveal calculation errors and gives an exact drawing of the
situation reached so far. And it's fun!


.....

I don't know your mathematical background, so maybe this was a little bit
lengthy, but I hope this explanation will contribute to your ability to
successfully attack similar (and more complex) problems.

   Sputnik


--
----------------------------

fr### [at] computermuseumfh-kielde
----------------------------


Post a reply to this message

From: LibraryMan
Subject: Re: Fitting a gothic trefoil into an equilateral triangle
Date: 24 Jun 2003 14:15:01
Message: <web.3ef89476a1d38d6b738e706a0@news.povray.org>
INVALID_ADDRESS wrote:
>I don't know your mathematical background, so maybe this was a little bit
>lengthy, but I hope this explanation will contribute to your ability to
>successfully attack similar (and more complex) problems.
>
>   Sputnik
>
>
>--
>----------------------------

>fr### [at] computermuseumfh-kielde
>----------------------------
>

I am absolutely amazed but grateful that you took so much time out from your
own coding to write such an extensive reply!  I haven't had a chance to
look through it yet, but I wanted to make sure I thanked you before I got
distracted!  Thanks SO much!
Yet another example of why this group is so great!
--Mark


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.