\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)
Roulette Curves with GNU/Linux
1) Introduction
2) Overview of Roulette Mathematics
Any curve in the complex plane is described using a real parameter, t.
Z(t) = f(t) + i * g(t)
A circle, with center at xc, i * yc is:
(%i1) | kill ( all ) $ |
(%i1) | circ ( t , R , xc , yc ) : = R · cos ( t ) + %i · R · sin ( t ) + xc + %i · yc ; |
\[\operatorname{ }\operatorname{circ}\left( t\operatorname{,}R\operatorname{,}\ensuremath{\mathrm{xc}}\operatorname{,}\ensuremath{\mathrm{yc}}\right) \operatorname{:=}R \cos{(t)}+i R \sin{(t)}+\ensuremath{\mathrm{xc}}+i \ensuremath{\mathrm{yc}}\]
(%i3) |
load
(
draw
)
$
set_draw_defaults
(
xrange
=
[
−
3
,
3
]
,
yrange
=
[
−
3
,
3
]
,
proportional_axes
=
xy
,
grid
=
true
,
nticks
=
400
,
background_color = light_yellow , xlabel = "Real Axis" , ylabel = "Imaginary Axis" ) $ |
(%i8) |
kill
(
t
)
$
R
:
1
$
xc
:
1
$
yc
:
1
$
wxdraw2d ( parametric ( realpart ( circ ( t , R , xc , yc ) ) , imagpart ( circ ( t , R , xc , yc ) ) , t , 0 , 2 · %pi ) , title = "Circle with Complex Parameterization" ) $ |
\[\operatorname{ }\]
To ensure a no-slip condition, the arc-lengths of both curves must be equal as the parameters t and u evolve. This condition is established by equating the two expressions for arc-length, which we will call sfx(t) and sro(u), and then solving for u as a function of t: u = u(t). If the solution cannot be obtained analytically then a numerical solution is found for each value of t as the roulette is generated.
Initially, the two curves are in contact with fx(0) = ro(0) and fx'(0) = ro'(0), that is the functions and their first derivatives are equal.
Also, the magnitudes of the first derivatives must be equal at every point:
|fx'(t)| = |ro'(u(t))|.
If an analytical u(t) can't be found then a value for the first derivative of the rolling curve, ro'(u(t)), must be determined at each point. The later examples will show how this done.
Given all the above conditions, the roulette equation is:
roul(t) = fx(t) + (p - ro(u(t))) * fx'(t)/ro'(t)
The complex point, p, actually generates the roulette and it can be located on the rolling curve or anywhere else. We can view the plane containing the rolling curve, as well as the point p that is located anywhere, as actually rolling (or rotating) and carrying both the rolling curve and p with it.
To make all the above clear, we will consider perhaps the simplest roulette, that of a circle rolling on a line, with the line being the x-axis (or real axis) and the circle being located initially at the complex point 0, i * R.
3) A Simple Roulette: Circle Rolling on Line
(%i1) |
kill
(
all
)
$
define ( ro ( u , R , xc , yc ) , trigsimp ( R · ( cos ( u − %pi / 2 ) + %i · sin ( u − %pi / 2 ) ) + xc + %i · yc ) ) ; |
\[\operatorname{ }\operatorname{ro}\left( u\operatorname{,}R\operatorname{,}\ensuremath{\mathrm{xc}}\operatorname{,}\ensuremath{\mathrm{yc}}\right) \operatorname{:=}i \ensuremath{\mathrm{yc}}+\ensuremath{\mathrm{xc}}+R \sin{(u)}-i R \cos{(u)}\]
(%i4) |
assume
(
R
>
0
,
u
>
=
0
)
$
define ( dro ( u , R ) , diff ( ro ( u , R , xc , yc ) , u ) ) ; define ( sro ( u , R ) , integrate ( cabs ( dro ( u , R ) ) , u ) ) ; |
\[\operatorname{ }\operatorname{dro}\left( u\operatorname{,}R\right) \operatorname{:=}i R \sin{(u)}+R \cos{(u)}\]
\[\operatorname{ }\operatorname{sro}\left( u\operatorname{,}R\right) \operatorname{:=}R u\]
(%i5) | fx ( t ) : = t + %i · 0 ; |
\[\operatorname{ }\operatorname{fx}(t)\operatorname{:=}t+i 0\]
(%i7) |
define
(
dfx
(
t
)
,
diff
(
fx
(
t
)
,
t
)
)
;
define ( sfx ( t ) , integrate ( cabs ( dfx ( t ) ) , t ) ) ; |
\[\operatorname{ }\operatorname{dfx}(t)\operatorname{:=}1\]
\[\operatorname{ }\operatorname{sfx}(t)\operatorname{:=}t\]
(%i11) |
R
:
1
$
xc
:
0
$
yc
:
1
$
wxdraw2d ( color = red , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , − 3 , 3 ) , color = blue , parametric ( realpart ( ro ( u , R , xc , yc ) ) , imagpart ( ro ( u , R , xc , yc ) ) , u , 0 , 2 · %pi ) , title = "Initial Conditions for Circle on Line" ) $ |
\[\operatorname{ }\]
(%i13) |
kill
(
t
,
u
,
R
,
xc
,
yc
)
$
define ( ut ( t , R ) , rhs ( solve ( sfx ( t ) = sro ( u , R ) , u ) [ 1 ] ) ) ; |
\[\operatorname{ }\operatorname{ut}\left( t\operatorname{,}R\right) \operatorname{:=}\frac{t}{R}\]
(%i16) |
define
(
ro
(
t
,
R
,
xc
,
yc
)
,
trigsimp
(
R
·
(
cos
(
ut
(
t
,
R
)
−
%pi
/
2
)
+
%i
·
sin
(
ut
(
t
,
R
)
−
%pi
/
2
)
)
+
xc
+
%i
·
yc
)
)
;
assume ( R > 0 , u > = 0 ) $ define ( dro ( t , R ) , diff ( ro ( t , R , xc , yc ) , t ) ) ; |
\[\operatorname{ }\operatorname{ro}\left( t\operatorname{,}R\operatorname{,}\ensuremath{\mathrm{xc}}\operatorname{,}\ensuremath{\mathrm{yc}}\right) \operatorname{:=}i \ensuremath{\mathrm{yc}}+\ensuremath{\mathrm{xc}}+R \sin{\left( \frac{t}{R}\right) }-i R \cos{\left( \frac{t}{R}\right) }\]
\[\operatorname{ }\operatorname{dro}\left( t\operatorname{,}R\right) \operatorname{:=}i \sin{\left( \frac{t}{R}\right) }+\cos{\left( \frac{t}{R}\right) }\]
(%i20) |
xc
:
0
$
yc
:
R
$
fx ( 0 ) ; ro ( 0 , R , xc , yc ) ; |
\[\operatorname{ }0\]
\[\operatorname{ }0\]
(%i22) |
imagpart
(
dfx
(
0
)
)
/
realpart
(
dfx
(
0
)
)
;
imagpart ( dro ( 0 , R ) ) / realpart ( dro ( 0 , R ) ) ; |
\[\operatorname{ }0\]
\[\operatorname{ }0\]
(%i24) |
cabs
(
dfx
(
t
)
)
;
trigsimp ( cabs ( dro ( t , R ) ) ) ; |
\[\operatorname{ }1\]
\[\operatorname{ }1\]
4) Generating the Roulette
(%i28) | p : 0 + %i · 2 ; R : 1 $ ; xc : 0 $ yc : R $ |
\[\operatorname{(p) }2 i\]
(%i29) | define ( roul ( t ) , fx ( t ) + ( p − ro ( t , R , xc , yc ) ) · dfx ( t ) / dro ( t , R ) ) ; |
\[\operatorname{ }\operatorname{roul}(t)\operatorname{:=}\frac{-\sin{(t)}+i \cos{(t)}+i}{i \sin{(t)}+\cos{(t)}}+t\]
(%i30) |
wxdraw2d
(
xrange
=
[
−
2
,
10
]
,
yrange
=
[
−
1
,
3
]
,
color = blue , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , − 2 , 10 ) , color = red , parametric ( realpart ( ro ( t , R , xc , yc ) ) , imagpart ( ro ( t , R , xc , yc ) ) , t , 0 , 2 · %pi ) , color = darkgreen , parametric ( realpart ( roul ( t ) ) , imagpart ( roul ( t ) ) , t , 0 , 4 · %pi ) , point_type = 7 , points [ [ realpart ( p ) ] , [ imagpart ( p ) ] ] , title = "Circle Rolling on Line" ) $ |
\[\operatorname{ }\]
(%i32) |
trigsimp
(
realpart
(
roul
(
t
)
)
)
;
trigsimp ( imagpart ( roul ( t ) ) ) ; |
\[\operatorname{ }\sin{(t)}+t\]
\[\operatorname{ }\cos{(t)}+1\]
(%i37) |
R
:
1
$
;
xc
:
0
$
yc
:
R
$
p : %i · R · 5 / 2 ; define ( roul ( t ) , fx ( t ) + ( p − ro ( t , R , xc , yc ) ) · dfx ( t ) / dro ( t , R ) ) ; |
\[\operatorname{(p) }\frac{5 i}{2}\]
\[\operatorname{ }\operatorname{roul}(t)\operatorname{:=}\frac{-\sin{(t)}+i \cos{(t)}+\frac{3 i}{2}}{i \sin{(t)}+\cos{(t)}}+t\]
(%i38) |
wxdraw2d
(
xrange
=
[
−
2
,
10
]
,
yrange
=
[
−
1
,
3
]
,
color = blue , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , − 2 , 10 ) , color = red , parametric ( realpart ( ro ( t , R , xc , yc ) ) , imagpart ( ro ( t , R , xc , yc ) ) , t , 0 , 2 · %pi ) , color = darkgreen , parametric ( realpart ( roul ( t ) ) , imagpart ( roul ( t ) ) , t , 0 , 4 · %pi ) , point_type = 7 , points [ [ realpart ( p ) ] , [ imagpart ( p ) ] ] , title = "Circle Rolling on Line with Point Off Curve" ) $ |
\[\operatorname{ }\]
(%i43) |
R
:
1
$
;
xc
:
0
$
yc
:
R
$
p : %i ; define ( roul ( t ) , fx ( t ) + ( p − ro ( t , R , xc , yc ) ) · dfx ( t ) / dro ( t , R ) ) ; |
\[\operatorname{(p) }i\]
\[\operatorname{ }\operatorname{roul}(t)\operatorname{:=}\frac{i \cos{(t)}-\sin{(t)}}{i \sin{(t)}+\cos{(t)}}+t\]
(%i44) |
wxdraw2d
(
xrange
=
[
−
2
,
10
]
,
yrange
=
[
−
1
,
3
]
,
color = blue , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , − 2 , 10 ) , color = red , parametric ( realpart ( ro ( u , R , xc , yc ) ) , imagpart ( ro ( u , R , xc , yc ) ) , u , 0 , 2 · %pi ) , color = darkgreen , parametric ( realpart ( roul ( t ) ) , imagpart ( roul ( t ) ) , t , 0 , 4 · %pi ) , point_type = 7 , points [ [ realpart ( p ) ] , [ imagpart ( p ) ] ] , title = "Circle Rolling on Line with Point at Center" ) $ |
\[\operatorname{ }\]
(%i48) |
kill
(
t
,
R
,
xc
,
yc
,
p
)
$
define ( roul ( t ) , fx ( t ) + ( p − ro ( t , R , xc , yc ) ) · dfx ( t ) / dro ( t , R ) ) ; trigsimp ( realpart ( roul ( t ) ) ) ; trigsimp ( imagpart ( roul ( t ) ) ) ; |
\[\operatorname{ }\operatorname{roul}(t)\operatorname{:=}\frac{-i \ensuremath{\mathrm{yc}}-\ensuremath{\mathrm{xc}}-R \sin{\left( \frac{t}{R}\right) }+i R \cos{\left( \frac{t}{R}\right) }+p}{i \sin{\left( \frac{t}{R}\right) }+\cos{\left( \frac{t}{R}\right) }}+t\]
\[\operatorname{ }-\sin{\left( \frac{t}{R}\right) } \ensuremath{\mathrm{yc}}-\cos{\left( \frac{t}{R}\right) } \ensuremath{\mathrm{xc}}+p \cos{\left( \frac{t}{R}\right) }+t\]
\[\operatorname{ }-\cos{\left( \frac{t}{R}\right) } \ensuremath{\mathrm{yc}}+\sin{\left( \frac{t}{R}\right) } \ensuremath{\mathrm{xc}}-p \sin{\left( \frac{t}{R}\right) }+R\]
(%i53) |
R
:
1
$
xc
:
0
$
yc
:
R
$
p : − %i · 1 / 2 ; wxdraw2d ( xrange = [ − 2 , 10 ] , yrange = [ − 1 , 3 ] , color = blue , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , − 2 , 10 ) , color = red , parametric ( realpart ( ro ( u , R , xc , yc ) ) , imagpart ( ro ( u , R , xc , yc ) ) , u , 0 , 2 · %pi ) , color = darkgreen , parametric ( realpart ( roul ( t ) ) , imagpart ( roul ( t ) ) , t , 0 , 4 · %pi ) , point_type = 7 , points [ [ realpart ( p ) ] , [ imagpart ( p ) ] ] , title = "General Roulette Equation Applied" ) $ |
\[\operatorname{(p) }-\frac{i}{2}\]
\[\operatorname{ }\]
5) Parting Comments
Maxima/wxMaxima will assist in eliminating the burdensome derivations and allow us to concentrate solely on the mathematical concepts.
Analytical equations of the roulettes are not always possible, but numerical routines, also provided by Maxima/wxMaxima, will allow us to easily visualize any roulette.
The subsequent examples will assume familiarity with the methods of this introduction and we will not be as detailed in the development as we are here.
Created with
wxMaxima.
Modified and embedded by L.A.P.