Code covered by the BSD License  

Highlights from
throw body with mouse

image thumbnail
from throw body with mouse by Maxim Vedenyov
It throws body in gravitation. Initial velocity defined by pointer velocity.

update_in_main
function update_in_main

global xys xa1 ya1 hfl0

xa=xys(1,:)+xa1;
ya=xys(2,:)+ya1;

set(hfl0,'Xdata',xa,'Ydata',ya);

Contact us at files@mathworks.com