Simple programming techniques / tricks in Mathematica for making graphics for the math book? [closed]

Here is a simple/basic way to do the first one:

Graphics[{

 (* The dashed circle segment *)
 {
  Dashing[{.04, .01}], 
  Darker[Orange], 
  AbsoluteThickness[2], 
  Circle[{0, 0}, 1, {1, 2 \[Pi]}]
 },

 (* The solid circle segment *)
 {
  Orange, 
  AbsoluteThickness[2], 
  Circle[{0, 0}, 1, {0, 1}]
 },

 (* The radial lines and the small circle segment *)
 Line[{{0, 0}, {1, 0}}],
 Line[{{0, 0}, {Cos[1], Sin[1]}}],
 Circle[{0, 0}, .2, {0, 1}],

 (* Various text labels *)
 {
  Text[Style["\[Theta]", 24], .3 {Cos[.5], Sin[.5]}], 
  Text[Style["s", 24], 1.1 {Cos[.5], Sin[.5]}], 
  Text[Style["r", 24], {.5, -.1}]
 }
}]

Mathematica graphics

The following is the exact same thing, but wrapped in Manipulate and parameterized
on the angle alpha:

Manipulate[
 Graphics[{
  {Dashing[{.04, .01}], Darker[Orange], AbsoluteThickness[2], 
  Circle[{0, 0}, 1, {\[Alpha], 2 \[Pi]}]},
  {Orange, AbsoluteThickness[2], Circle[{0, 0}, 1, {0, \[Alpha]}]},
  Line[{{0, 0}, {1, 0}}],
  Line[{{0, 0}, {Cos[\[Alpha]], Sin[\[Alpha]]}}],
  Circle[{0, 0}, .2, {0, \[Alpha]}],
  {Text[Style["\[Theta]", 
  24], .3 {Cos[\[Alpha]/2], Sin[\[Alpha]/2]}], 
  Text[Style["s", 24], 1.1 {Cos[\[Alpha]/2], Sin[\[Alpha]/2]}], 
  Text[Style["r", 24], {.5, -.1}]}
 }],
{{\[Alpha], 1}, 0, 2 \[Pi]}]

If you move the slider, the content will change accordingly:

Mathematica graphics

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)