NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: Fred Chuit on December 30, 2008, 02:59:18 pm



Title: how to move particles along a path
Post by: Fred Chuit on December 30, 2008, 02:59:18 pm
Dear EJS-users,

I am looking for a way to move a large number of particles (circles) along paths, like a chain.
If possible the particles should change colour depending on their position.
Is there a nice way in EJS to do this or do I have to work particle by particle?

Please, look at the drawing to get an idea what I mean.
Already many thanks for any help.
Regards,
Fred


Title: Re: how to move particles along a path
Post by: Fu-Kwun Hwang on December 30, 2008, 04:20:02 pm
Please check out the following applets:

    
RC circuit (DC: charge/discharge)  (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=313.msg1009#msg1009)
RLC AC circuit (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=368.msg1151#msg1151)
or
    
Rectifier circuit (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=545.msg1793#msg1793)

For color to change according to their position, you need to define an array  for color object, and set their value from coordinate.