MuPAD Pro Computing Essentials, 2nd Edition

Example 8.2 Class Curve2d

In this example I show how the Curve2d class can be used to produce a hypocycloid.

R := 3:
r := 0.5:

Hp := plot::Curve2d(
  [(R-r)*cos(t) + r*cos((R-r)*t/r),
   (R-r)*sin(t) - r*sin((R-r)*t/r)],
   t = 0..2*PI,
   Color = [0, 0, 0],
   LineWidth = 0.41
):

Circle := plot::Curve2d(
   [R*cos(t),R*sin(t)],
   t = 0..2*PI,
   Color = [0.2, 0.2, 0.2],
   LineWidth = 0.25
):

plot(
   Hp, Circle,
   Scaling = Constrained,
   BackgroundColor = [0.8, 0.8, 0.8],
   Footer = "Hypocycloid", 
   GridVisible = TRUE,
   GridLineStyle = Solid,
   GridLineColor = [0.0, 0.0, 1.0]
)

 

© Miroslaw Majewski, Abu Dhabi,  Update  26-10-2004