How can we show the paths of three light beams in Mathematica which bounce back after hitting the parabola, in a single plot? Suppose we have the following code

Clear[f, x]; 
f[x_] = x^2/8; 
{x[t_], y[t_]} = {t, f[t]}; 
parabola = ParametricPlot[{x[t], y[t]}, {t, -4, 4}, PlotStyle -> {{Blue, Thickness[0.01]}}, AxesLabel -> {"x", "y"}];

beam[t_] := Vector[{x[t], y[t]} - {x[t], 6}, Tail -> {x[t], 6}, VectorColor -> Red]; 
Show[parabola, beam[1], beam[2], beam[3], PlotRange -> All]
  • 3
    $\begingroup$ Your code doesn't run. It is unclear what Vector is because it isn't a built-in function. Please also define parabola. $\endgroup$ – C. E. May 26 at 7:43
  • $\begingroup$ Now I think it would work. $\endgroup$ – Khuram Shahzad May 26 at 7:55
  • $\begingroup$ see Wolfram Demonstrations >> Reflection in a Parabolic Mirror $\endgroup$ – kglr May 26 at 8:27
  • $\begingroup$ In that Demonstration, all three rays emerge from a single source. Here I have three different sources. $\endgroup$ – Khuram Shahzad May 26 at 8:42
  • $\begingroup$ The demonstrations are often "cute" and show off the skill of the person who created the demonstration to display a graphical result, but they often do not include material in a form that is easy to take and use for other purposes. At best it sometimes seem they let you know something is possible. But to incorporate the ideas into another project seems to often require reverse engineering to try to recover the thought process used so that you can implement a solution to a different problem. If the demonstrations were encouraged to include usable code at the bottom they might be more useful. $\endgroup$ – Bill May 26 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.