I have a line that is plotted using user input:
plot(xClic, yClic,'');
hold on
% Compute y intercept for slope of 1
b = yClic*xClic;
% Plot the line between the click point and the y intercept
batBeam=plot([xClic,0],[yClic,b],'b');
The limit of the x and y axis is 100. The line stops plotting when x=0 and y=whatever or when x=whatever and y=0.
How do I make a reflective boundary that activates once the line ends at (0,y) or (x,0) that stops after two bounces. For trouble visualizing, think of a laser boucing off a mirror.
This should happen at the endpoint. The line should have the same slope and move in the opposite direction.
Best Answer