APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Image reflection

Return to the EJS Modeling forum
Login to post to this thread

want to reflect a 2D image
Javier Mas
5 Posts

Hello I need some help. I have added a rocket as a 2D image inside a Plotting Panel. The rocket moves along the x axis in the positive direction with some variable speed v. A soon as the velocity turns negative I would like the rocket image to flip so as to point always in the direction of movement.
I have tried with the transformation editor in the Transform element of the popup panel. In it I see an item called Matrix Transf. It is a 2*3 matrix and I have not been able to  make it work.
I guess at some point I would need to insert a -1 for a reflection in the y axis, in the form Math.signum(v) or so. Can somebody help me?. Thanks a lot.

Current Replies - View all
Re: want to reflect a 2D ...   (Francisco Esquembre - )
OSP Projects:
Open Source Physics - EJS Modeling
Physlet Physics
Physlet Quantum Physics
STP Book