NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
January 26, 2021, 11:01:33 am

"It is not the strongest of the species that survive, but the one most responsive to change." ..."Darwin(1809-1882, English naturalist Evolution)"

 Pages: [1]   Go Down
 Author Topic: How to make for Trail to connected true for angle 0 to 360 but not jump 360-0?  (Read 5160 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member

Offline

Posts: 1796

http://weelookang.blogspot.com

 « Embed this message on: December 11, 2009, 03:18:51 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

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.

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!

 undesiredline.PNG (16.54 KB, 983x345 - viewed 548 times.) « Last Edit: December 11, 2009, 03:41:54 pm by lookang » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3086

 « Embed this message Reply #1 on: December 11, 2009, 04:07:04 pm » posted from:Taipei,T'ai-pei,Taiwan

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.
 Logged
 Pages: [1]   Go Up
"It is not the strongest of the species that survive, but the one most responsive to change." ..."Darwin(1809-1882, English naturalist Evolution)"