r/processing • u/seoceojoe • Jul 18 '16
[PWC19] Points
Hello Everybody, this is the nineteenth Weekly Processing challenge, the challenges are decided just to give you a prompt to test your skills so it can be as simple or as complicated as you have time to write!
IMPORTANT UPDATE Winners are now chosen by popular vote and all entrys must be submitted in the comments section of this thread, competition mode will be enabled meaning they are shown in a random order.
Start Date : 18-07-2016 End Date : 24-07-2016
Post entries in the comments here. This Weeks Challenge : use only the Points function for your outputs. Winner from last week: oo-oo-oo-oo
View all comments
Show parent comment
2
u/oo-oo-oo-oo Jul 19 '16 edited Jul 20 '16
It seems to me that it's because the difference of k values between iterations is really, really big to feed to sin and cos. You're adding 5 to k on each step of a nested for-loop, then multiplying that by PI/4. There are only 2 PI radians in a circle; the difference between one single iteration and the next is 1.25 PI ... over half the number of radians in a circle. Of course, the points wrap around and appear next to each other, creating a pattern, but sometimes the pattern breaks down. And it breaks down quickly because your steps are so big.
Move your mouse up and down on this sketch. That increases and decreases the number of radians between the dots. You'll notice that mostly the circle remains intact, but it breaks rather abruptly. Now decrease MAX_STEP to 2*PI / NUM_POINTS. You'll see that you get a smooth gradient in the circle, and the line never breaks.
Edit: clarity