Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Afunction[r_, x_, y_] := -x/r + (y^2 - 1)/(2 r^2)
  2.  
  3. Acurve[x_, y_] := Plot[{Afunction[r, x, y], (x^2 - 1)/2}, {r, 0, 10}, PlotRange -> {{0, 10}, {-1.5, 1.5}}]
  4.  
  5. someInfo[x_, y_] := If[(0 < x < 1 && y > 1), Text[Style[StringJoin["Just a test :nn", "r = ", ToString[NumberForm[x/(1 - x^2), {5, 4}]], " km"]], {5, -1.25}], {}]
  6.  
  7. Manipulate[Show[Acurve[x, y],
  8. PlotRange -> {{0, 10}, {-1.5, 1.5}},
  9. AspectRatio -> 1,
  10. Frame -> True,
  11. Epilog -> someInfo[x, y]],
  12.  
  13. Row[{
  14. Control[{{x, 0.8}, -1, 2, 0.001, Appearance -> {"Labeled"}}],
  15. Spacer[124],
  16. Control[{{y, 1.5}, 0, 15, Appearance -> {"Labeled"}}]
  17. }]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement