$Author: leiser $
$Id: EpiAndHypocycloid.nb 1764 2009-10-18 16:54:47Z leiser $
$LastChangedDate: 2009-10-18 18:54:47 +0200 (Sun, 18 Oct 2009) $

About:
This notebook lets the student manipulate epi- and hypocycloids.
The code is totally straight forward and canonical without any 
tricks or particular originality.
For background information on the maths see eg:
http://en.wikipedia.org/wiki/Hypocycloid
http://en.wikipedia.org/wiki/Epicycloid
http://de.wikipedia.org/wiki/Zykloide#Epi-_und_Hypozykloide

(* CELL WITH TABS AND MANIPULATE(S) *)

TabView[{

(* First Tab *)
Style["Epi- und Hypozykloide",titleStyle]->
Column[{
(* First Row (Header and Explanation Button *)

Row[{
Button[Style["Hinweise",9],
CreateDocument[
TextCell[Pane[Column[{
(* Explanation Texts *)
TextCell["\nWas zeigt die Visualisierung?",{explanationHeaderStyle}],
TextCell[Row[
{"Die Visualisierung zeigt, wie eine Epi- bzw. Hypozykloide entsteht.\n\n",
Style["Epizykloide\n",Bold],
"Eine Epizykloide ist die Kurve, welche entsteht, wenn ein kleinerer Kreis aussen entlang der Umfangslinie eines grösseren Kreises rollt und man einen bestimmten Punkt des kleineren Kreises betrachtet.\n\n",
Style["Hypozykloide\n",Bold],
"Eine Hypozykloide ist analog die Kurve, welche entsteht, wenn der kleinere Kreis innerhalb des grösseren entlang dessen Umfangslinie rollt.\n\n",
"Sie können in der Animation den Radius des kleineren Kreises verändern.\n","Unter dem Zeitparameter haben Sie Tasten um die Animation zu Starten/Stoppen, die Geschwindigkeit oder Richtung zu verändern, usw.\n\n",
Style["Variante\n",Bold],
"Zusätzlich können Sie auch die Distanz des Punktes vom Radius des kleineren Kreises so verändern, dass er nicht mehr notwendig ein Punkt des kleineren Kreises ist. Dann spricht man nicht mehr von einer Epi- bzw. Hypozkloide, sondern von einer ",
Style["Epitrochoide",Italic],
" bzw. ",
Style["Hypotrochoide",Italic],".\n"
}
],explanationStyle]
(* more, if necessary ... *)
(* End Explanation Texts *)
}]]],(* End TextCell *)
WindowFrame->"Normal",WindowSize->{650,500},WindowTitle->"Hinweise"
],(* End CreateDocument *)
ImageSize->{80,20}] },(* End Button *)
ImageSize->{680,25},Background->RGBColor[0.9,0.9,0.9],Alignment->{Right,Top}
],(* End Row *)

(* Second Row: Manipulate element *)
Manipulate[

Dynamic[
Show[
{
(* the large circle: *)
ParametricPlot[{a1+R*Cos[t],a2+R*Sin[t]},{t,0,2*Pi}],
(* the small circle: *)
If[type=="Hypozykloide",
ParametricPlot[{a1+r*Cos[t]+(R-r)*Cos[tMax],a2+r*Sin[t]+(R-r)*Sin[tMax]},{t,0,2*Pi}],
ParametricPlot[{a1+r*Cos[t]+(R+r)*Cos[tMax],a2+r*Sin[t]+(R+r)*Sin[tMax]},{t,0,2*Pi}]
],
Graphics[{ (* center of small circle *)
If[type=="Hypozykloide",
Point[{a1+(R-r)*Cos[tMax],
a2+(R-r)*Sin[tMax]}],
Point[{a1+(R+r)*Cos[tMax],
a2+(R+r)*Sin[tMax]}]
]
}],
(* the cycloid: *)
If[type=="Hypozykloide",
ParametricPlot[
{a1+(R-r)*Cos[t]+d*r*Cos[((R-r)/r)*t],
a2+(R-r)*Sin[t]-d*r*Sin[((R-r)/r)*t]
},{t,0,tMax},PlotStyle->{Red}],
ParametricPlot[
{a1+(R+r)*Cos[t]-d*r*Cos[((R+r)/r)*t],
a2+(R+r)*Sin[t]-d*r*Sin[((R+r)/r)*t]
},{t,0,tMax},PlotStyle->{Red}]
],
Graphics[{ (* moving point on cycloid *)
PointSize[0.01],Red,
If[type=="Hypozykloide",
Point[{a1+(R-r)*Cos[tMax]+d*r*Cos[((R-r)/r)*tMax],
a2+(R-r)*Sin[tMax]-d*r*Sin[((R-r)/r)*tMax]
}],
Point[{a1+(R+r)*Cos[tMax]-d*r*Cos[((R+r)/r)*tMax],
a2+(R+r)*Sin[tMax]-d*r*Sin[((R+r)/r)*tMax]
}]
]
}],
Graphics[{ (* line segment between center of smaller circle and moving point on cycloid *)
Line[
{If[type=="Hypozykloide",
{a1+(R-r)*Cos[tMax],
a2+(R-r)*Sin[tMax]},
{a1+(R+r)*Cos[tMax],
a2+(R+r)*Sin[tMax]}
],
If[type=="Hypozykloide",
{a1+(R-r)*Cos[tMax]+d*r*Cos[((R-r)/r)*tMax],
a2+(R-r)*Sin[tMax]-d*r*Sin[((R-r)/r)*tMax]
},
{a1+(R+r)*Cos[tMax]-d*r*Cos[((R+r)/r)*tMax],
a2+(R+r)*Sin[tMax]-d*r*Sin[((R+r)/r)*tMax]
}
]
}]
}]

},
Axes->True,Background->RGBColor[1,1,1],ImagePadding->20,PlotRange->{{-2R,2R},{-2R,2R}},
ImageSize->{450,450}
]
],
"",
{{type,"Hypozykloide",""},{"Hypozykloide","Epizykloide"},ControlType->RadioButtonBar,Appearance->"Vertical"},
"\n",
(*
Style[" Nur ganzzahlige Verhältnisse R/r zulassen:",textStyle],
{{intOnly,True,""},{True,False},ControlType->Checkbox},
*)
Style[" Radius des kleinen Kreises:",textStyle],
{{r,R/4,""},If[intOnly, Table[-R/k,{k,-20,-2}],Table[R-(1/k),{k,2,100}]],ControlType->Slider},
Style[" Distanz Punkt - kleiner Kreis:",textStyle],
{{d,1,""},0,2,0.1},
Style[" Zeitparameter:",textStyle],
{{tMax,0.001,""},0.001,If[intOnly,2*Pi+0.1,12*Pi+0.1], 0.1,Appearance->"Open"}
,

SaveDefinitions->True,AppearanceElements->None,Paneled->False,ControlPlacement->Left,
TrackedSymbols:>{r,type},
Initialization:>
(
(* INITIALIZATIONS *)
(* Styles *)
titleStyle := {FontFamily ->"Verdana",14,Bold, RGBColor[0.35,0.35,0.35],Background->RGBColor[1,1,1,0]};
tagAtRight := {FontFamily ->"Verdana",12,Bold, RGBColor[0,33/255,66/255],Background->RGBColor[1,1,1,0],TextAlignment->{Right,Top}};
textStyle := {FontFamily ->"Verdana",10,Bold, RGBColor[0.35,0.35,0.35],Background->RGBColor[1,1,1,0],AutoIndent->False,ParagraphIndent->0,TextJustification->1};
explanationStyle := {FontFamily ->"Times",14,Plain, RGBColor[0.35,0.35,0.35],Background->RGBColor[1,1,1,0],AutoIndent->False,ParagraphIndent->0,TextJustification->1};
explanationHeaderStyle := {FontFamily ->"Times",16,Bold, RGBColor[0.35,0.35,0.35],Background->RGBColor[1,1,1,0],AutoIndent->False,ParagraphIndent->0,TextJustification->1};
mathStyle := {FontFamily ->"Times",14,Bold, RGBColor[0.35,0.35,0.35],Background->RGBColor[1,1,1,0],AutoIndent->False,ParagraphIndent->0,TextJustification->1};
plotLabelStyle := {FontFamily ->"Times",14,Plain, RGBColor[0.35,0.35,0.35],Background->RGBColor[1,1,1,0]};

(* Structures and Data *)
intOnly:=True;
a1:=0;
a2:=0;
R:=1


(* END INITIALIZATION PART *)
)
] (* End Manipulate *)
(* End Second Row *)
}] (* End Column *)
(* End First Tab *)


},Background->RGBColor[0.95,0.95,0.95 ](* TabView Background *),ImageSize->{730,550}
] (* End TabView *)

(* END OF CELL WITH TAB AND MANIPULATE(S) *)

2009, Projekt LEMUREN, Lernen Multimedial, Departement Mathematik, ETH Zürich | Licence: CC-BY-SA

$LastChangedDate: 2009-10-18 18:54:47 +0200 (Sun, 18 Oct 2009) $