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: lookang on December 11, 2009, 03:18:51 pm



Title: How to make for Trail to connected true for angle 0 to 360 but not jump 360-0?
Post by: lookang on December 11, 2009, 03:18:51 pm
How to make for Trail to connected true for angle  0 to 360 but not jump 360-0?

Hi Ejs Professional learning community,

i want to make the graph points connected from 0 to 360 only, the jump from 360 to 0 shows a "undesired" line back to 0.(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1381.0;attach=1552;image)

the variable ctadegree0360 has values from 0 to 359.9 and will increase to 360 which becomes 0.

i can't use the trick "_isPlaying" because it didn't pause
i also can't use the trick "ctadegree0360 <= 360" because depending on the speed of rotation, by the point 350 the next point could have jump to 5 degree.

any tips? Thanks! ;D
 


Title: Re: How to make for Trail to connected true for angle 0 to 360 but not jump 360-0?
Post by: Fu-Kwun Hwang on December 11, 2009, 04:07:04 pm
The value for angle, e.g. cta, should be increasing from 0...350, ... 360, 361...
Why the value jump back to zero? You must have added some code to make the change.
Add a variable for "connection" property for trace, and add code to change it's value from true to false when you do not want connected line.