| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library sunflower; | 5 library sunflower; |
| 6 | 6 |
| 7 import 'dart:math'; | 7 import 'dart:math'; |
| 8 import 'dom.dart'; | 8 import 'dom.dart'; |
| 9 | 9 |
| 10 const String ORANGE = "orange"; | 10 const String ORANGE = "orange"; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 context.clearRect(0, 0, MAX_D, MAX_D); | 67 context.clearRect(0, 0, MAX_D, MAX_D); |
| 68 for (var i = 0; i < seeds; i++) { | 68 for (var i = 0; i < seeds; i++) { |
| 69 final num theta = i * TAU / PHI; | 69 final num theta = i * TAU / PHI; |
| 70 final num r = sqrt(i) * SCALE_FACTOR; | 70 final num r = sqrt(i) * SCALE_FACTOR; |
| 71 final num x = centerX + r * cos(theta); | 71 final num x = centerX + r * cos(theta); |
| 72 final num y = centerY - r * sin(theta); | 72 final num y = centerY - r * sin(theta); |
| 73 new SunflowerSeed(x, y, SEED_RADIUS).draw(); | 73 new SunflowerSeed(x, y, SEED_RADIUS).draw(); |
| 74 } | 74 } |
| 75 notes.textContent = "$seeds seeds"; | 75 notes.textContent = "$seeds seeds"; |
| 76 } | 76 } |
| OLD | NEW |