I'm trying to write a simple program which draws a line from the centre of the screen to a randomised point within the window. Then, I want to (for now) draw an ellipse somewhere along that line, using the y-intercept formula y=mx+b to track the line's slope. So far, so good.
However, now I want to ensure that this ellipse isn't drawn too close to the centre. I used a while loop to check the distance between the ellipse's centre coordinates and the centre of the screen, but it's quite regularly, though not always, getting stuck in an infinite loop. It seems x and y are fairly often being assigned / calculated to 100.0 (i.e. the centre of the screen). Code below (beware of infinite looping if you decide to run it):
I thought I'd allowed for the infinite loop by randomising x within the while loop, re-calculating y, then reassigning nodeProx to the new distance, however, it spits out 0.0 for nodeProx and can't change despite the reassignment within the while loop.
I'm relatively new to Processing and my maths is extremely rusty. I suspect it's a maths problem over a programming problem, but after managing to get to this point, I'm a little stuck.
Can anyone see the error of my ways? Is there a simpler solution for drawing a random point along a randomly-generated line?
The
processing.exe shortcut can be pinned to the taskbar in Windows 7 like most programs. However, when the program's actually opened, it opens a second instance of the icon which doesn't have the option to 'pin to taskbar' when right clicked
After a bit of research, it seems the application
processing.exe opens the process
javaw.exe.
I imagine the issue is similar to
this forum post about an identical Eclipse issue (specifically, comment 21 and below). I imagine Processing's
.ini file equivalent is
processing.txt (Users>[username]AppData>Roaming>Processing) but can't see any options to edit to try to reproduce the steps in the Eclipse forum post.
Anyone have any suggestions or workarounds to pin the open Processing program to the taskbar?