Timeline for Simulating a polygon
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 14, 2015 at 10:38 | vote | accept | RE60K | ||
| Apr 14, 2015 at 10:36 | comment | added | RE60K | @EvanBechtol the dX and dY change with time and much | |
| Apr 14, 2015 at 0:56 | history | edited | rolfl | CC BY-SA 3.0 | floating float sunk. |
| Apr 14, 2015 at 0:04 | history | edited | 200_success | CC BY-SA 3.0 | indentation |
| Apr 14, 2015 at 0:02 | comment | added | Evan Bechtol | Nice, I wasn't aware of that :) I'll have to remember this! | |
| Apr 14, 2015 at 0:00 | comment | added | rolfl | @EvanBechtol - Thanks, appreciate the compliment. About the 'declare it outside the loop', that's not going to impact memory allocation. How the java runtime decides to optimize that is hard to predict, and should not matter. The general rule is to declare variables in their narrowest scope. I would not recommend anything different. | |
| Apr 13, 2015 at 23:56 | comment | added | Evan Bechtol | As a side note: it would be better for memory to declare dX and dY outside the for loop in the paintCurves method. Otherwise it is re-created every single iteration. Not a big deal, but when extrapolating the program it conserves memory :) Great answer btw! | |
| Apr 13, 2015 at 23:46 | history | edited | rolfl | CC BY-SA 3.0 | add summary call. |
| Apr 13, 2015 at 22:53 | history | answered | rolfl | CC BY-SA 3.0 |