<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD><TITLE>ADFS::HardDisc5.$.ProgDev.Roulards.Docs.CircRoulGen</TITLE></HEAD>
<BODY BGCOLOR="#ffffff" TEXT="#000000">

<BASEFONT SIZE=4>

<H1 ALIGN=CENTER><U>CIRCULAR ROULARD GENERATOR.</U></H1>

<U></U>

<P>
The purpose of this program is to generate  roulards on the outside of a circle (epicycloids).  The process is extended to allow the piont whose locus is being traced to be within or outside the rolling circle.  The goimetry is shown in Fig. 1 below:-

<U></U>

<P ALIGN=CENTER><IMG SRC="Images/CircRoulGen_HTML/Pic1" ALIGN=MIDDLE HEIGHT=496 WIDTH=572>

<P>
                                                                           <BIG>Fig. 1</BIG>

<P>
	

<P>
	O is the centre of the Large Circle around which the roulard is generated and of Radius  R.

<P>
	The Small (rolling) Circle has a Radius  r  and the "Tracing Point" P is set at a distance of kr from the  			     	centre of the Small Circle..  It is assumed that initially the point P lies on the line O - A .  After the 

<P>
	centre of the rolling circle has moved through an angle theta  the  tracing point has moved to P' .



<P>
	Co-ordinates of the <U>centre</U>  of the rolling circle (point  d)  [w.r.t. Centre  O ]  are given by:



<P>
                   			x<SUB>d</SUB>  =  (R + r) Cos theta,    y<SUB>d</SUB>  =  (R + r) Sin theta    - - - -   (1)



<P>
	Co-ordinates of point P  <U>w.r.t.  point  d</U>  are :-  



<P>
	        x<SUB>p</SUB>  =  - kr Cos (beta + theta)   ,      y<SUB>p</SUB>  =  - kr Sin (beta + theta)    - - - -  (2)



<P>
	Since the rolling circle is always in contact with the Large Circle as it rolls, the <U>circumferential</U>  distance  a --  a'  must be equal to the <U>circumferential</U> distance  c  --  c' .



<P>
	Therefore   Since   theta = c c' / R     and    beta = a a' / r    and   c c' = a a'



<P>
	we get    R.theta  =  r.beta     or    theta = r.beta/R



<P>
	[ Note:  beta will be used as the independant variable.]



<P>
	This gives:-      x<SUB>p</SUB> = k.r.Cos (beta + r.beta / R)   =  k.r.Cos(1+r/R).beta     - - - - - - (3a)



<P>
	                         y<SUB>p </SUB>= k.r.Sin (beta + r.beta / R)     =  k.r.Sin (1 + r/R). beta  - - - - - - (3b)



<P>
	Therefore the co-ordinates of  P  w.r.t  centre O are :-



<P>
                                                   X<SUB>p  </SUB>=  x<SUB>a</SUB>  -  x<SUB>p</SUB>     and     Y<SUB>p</SUB> = y<SUB>a</SUB>  -  y<SUB>p</SUB>  



<P>
	In order to finish at the starting point, and thus make a closed figure, the circumferences of the two 

<P>
	circles need to be in certain ratios.   In such a closed figure the small (generating) circle rotates n times 	

<P>
	while its centre rotates about the large circle m times. [n  and  m  are Integers].

<P>
	The ratio of n to m must be the same as that of the circumferences and hence of the radii.



<P>
				n/m  =  R/r   - - - - -  (4)



<P>
	Let a be the Integer Part of  R/r .   Then circumference of large circle  =  2pR

<P>
					        circumference of large circle  =  2pr



<P>
	When the small circle has revolved  a  times its 'track' length will be   2pra    so that it will be 'short' of 	

<P>
	the starting point on the large circle circumference by   2pR  -  2pra   =  2p<I>( </I>R -  a.r )  - - -  (5)



<P>
	When the difference is equal to the 'track length'  of one revolution of the small circle (or zero) the 

<P>
	Figure will be 'closed'.   

<P>
	When R/r  is a integer  a  =  R/r  and  a.r  =  R,  so that the figure will 'close 'after one 'circuit' of the 

<P>
	large circle. 

<P>
	When  R/r  is not an integer the small circle will have to make  m  'circuits' before 'catching up' on the 

<P>
	starting point.

<P>
	On the first 'circuit' it will be 'short' by  2p<I>( </I>R -  a.r ) ,  on the next it will be 'shorter' still  ie. by

<P>
	4p<I>( </I>R -  a.r )   etc.

<P>
	After  m  'circuits' it will be 'short' by a whole revolution of the small circle  ie.  by  2pr  so that -

<P>
	2mp<I>( </I>R -  a.r )  =  2pr    ie.  m<I>( </I>R -  a.r )  =  r   or   m = r /<I> (</I>R -  a.r )    - - - -  (6)

<P>
	This can be written as   1 /  (R/r  -  a)      But    R/r  -  a  =  b  the 'fractional' part of  R/r

<P>
	Therefore  m = 1 / b     [ <U>But  m  must be an Integer</U> ]

<P>
	The small circle then has to make one more revolution to reach the starting point.  

<P>
<U>	</U>No. of revolutions of the small circle for  m  'circuits' is-  m.a  so that the total No. of revolutions 

<P>
<U>	</U>is-  m.a + 1 .

<U></U>

<P>
<U>	</U>If  1/b  is not a integer  but we can multiply it by a integer such that the product is an integer , we can	

<P>
<U>	</U>calculate the minimum number of  'circuits' necessary to make a 'closed' figure by multiplying  m  by 

<P>
<U>	</U>the same number.

<P>
<U>	</U>eg. If  R/r were say  8.3    ie.  a = 8,    b = 0.3    we could multiply 1/b  and  m  by  3  to give  10 

<P>
<U>	</U>'circuits'  and get a closed figure.

<U></U>

<U></U>

<U></U>

<U></U>

<P>
<U>					EXTENSIONS</U>

<U></U>

<P>
	The purpose of the 'extended' algorithm is to enable the user to design a circular roulard to a wanted 	

<P>
	style and size, for use in cards etc. and framing photographs.



<P>
	Refering to the diagram it will be seen that the 'Outer' radius of the 'Ring' will be  R + (k + 1)r  and

<P>
	the 'Inner' radius  R -  (k - 1)r    [ Note that if k is less than 1 the Inner  radius will be greater than  R ].

<P>
	

<P>
	If  'Outer' radius  =  R<SUB>O  </SUB> and  'Inner' radius  =  R<SUB>I</SUB>    then we can re-arrange the above to give:-



<P>
	r = (R<SUB>O </SUB>- R<SUB>I</SUB>) / 2k      and    R =  (R<SUB>O +</SUB> R<SUB>I</SUB>) / 2   -  (R<SUB>O </SUB>- R<SUB>I</SUB>) / 2k     - - - -  (7)



<P>
	This gives:-    R/r  =  k.(R<SUB>O +</SUB> R<SUB>I</SUB>) / (R<SUB>O </SUB>- R<SUB>I</SUB>)  -  1     =      a  +  b     - - - -  (8)



<P>
	But  m  must be integer, so we start with the required sizes  (R<SUB>O  and  </SUB>R<SUB>I</SUB>) and a suitable value of  k and 

<P>
	then calculate how these would change for a range of values of  m  from  1  to  10  [range could be 

<P>
	extended].  The user can then select the best compromise, bearing in mind the changes in size and 

<P>
	the total number of loops.  If necessary another value of  k  can be tried.   All values of  m  will give a 

<P>
	closed figure but some will give one nearer to the original requires dimentsions than others and. of 

<P>
	course, a different number of loops.

<P>
	

<P>
	First we calculate 'initial' values of R  and  r  from the input dimentions and from these 'initial' values

<P>
	of  X  [ = R/r ] , a  and  b .



<P>
	For each of the (10) values of  m  we must calculate the modified values of  R<SUB>O</SUB>  and  R<SUB>I</SUB>  that are 

<P>
	similar to the above but make  m the integer required.

<P>
		

<P>
	In order to get a balance and make the 'new' ring as neer to the original requested dimensions as 

<P>
	possible we multiply the radius of the large circle by a factor  (near unity) and divide that of the small

<P>
	circle by the same factor. (p)

<P>
	

<P>
	R<SUB>N</SUB> = p.R      r<SUB>N</SUB> = r/p   Therefore  X<SUB>N</SUB> = p<SUP>2</SUP>.X    or   p<SUP>2</SUP> = X<SUB>N</SUB> / X



<P>
	For each value of  m  we make  m.b  an integer by rounding it and then calculate a 'new' value of 

<P>
	X ( = X<SUB>N </SUB> )  and from this p and hence the 'new' (modified) values of the outer and inner radii of the 

<P>
	ring.

<P>
	We also calculate the 'deviation' of the 'new' ring dimensions from the original (entered) values

<P>
	ie. the absolute value of   (X<SUB>N</SUB> / X) - 1.  The user may choose a suitably low value.



<P>
	All this selection is done, of course,  before the figure is drawn.



</BODY>
</HTML>
