Advertisement
Matthen

Roll a coin around another

Aug 5th, 2011
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. coin = Import[
  2. "http://3.bp.blogspot.com/_Cgkg7Ju_kac/SmW4JlWNayI/AAAAAAAABqY/\
  3. WZd6s5QFuvM/s400/nasa_Appolo+40+years+coin+bronze_reverse.jpeg"];
  4.  
  5. mask = Graphics[{Disk[{0, 0}, 0.85]}, PlotRange -> {{-1, 1}, {-1, 1}}];
  6. undermask =
  7. Graphics[{Inset[coin, {Center, Center}, {Center, Center}, 2],},
  8. PlotRange -> {{-1, 1}, {-1, 1}}];
  9.  
  10. coinimg = SetAlphaChannel[undermask, ColorNegate@mask];
  11.  
  12. Manipulate[
  13. Graphics[{
  14. Inset[coinimg, {0, 0}, {Center, Center}, 0.75],
  15. Rotate[
  16. Inset[coinimg, 0.634 {Cos[t], Sin[t]}, {Center, Center}, 0.75],
  17. 2 t]
  18. }, PlotRange -> {{-1, 1}, {-1, 1}}, ImageSize -> {400}]
  19. , {t, 0, 2 Pi}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement