Advertisement
Matthen

Ellipse Construction

Feb 22nd, 2015
1,359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Manipulate[
  2. Module[{p1, p2, p3},
  3. p1 = a {Cos[\[Theta]], Sin[\[Theta]]};
  4. p2 = a {Cos[\[Theta]], 0};
  5. p3 = p2 + b {Cos[\[Theta]], Sin[\[Theta]]};
  6. Show[
  7. Graphics[{
  8. Thickness[0.005],
  9. {Darker@Red, Circle[{0, 0}, a]},
  10. {Darker@Green, Circle[p2, b]},
  11. Line[{{0, 0}, p1, p2, p3}],
  12. PointSize[Medium],
  13. Point[{{0, 0}}],
  14. {Darker@Red, Point[p1]},
  15. {Darker@Green, Point[p2]},
  16. {RGBColor[0.01, 0.4, 0.5], Point[p3]}
  17. }, PlotRange -> (a + b), ImagePadding -> 10],
  18. ParametricPlot[
  19. {(a + b) Cos[\[Theta]t], b Sin[\[Theta]t]}, {\[Theta]t,
  20. If[\[Theta] > 2 Pi, \[Theta] - 2 Pi, 0],
  21. If[\[Theta] > 2 Pi, 2 Pi + 0.001, Max[\[Theta], 0.001]]},
  22. PlotStyle -> Directive[Thick, RGBColor[0.01, 0.4, 0.5]]
  23. ]
  24. ]
  25. ],
  26. {\[Theta], 0, 4 Pi}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement