Use trans_flag global from sketchlib
parent
2ce3eb8195
commit
d76c19d625
|
@ -1,4 +1,5 @@
|
|||
use sketchlib::nannou;
|
||||
use sketchlib::palettes::TRANS_FLAG;
|
||||
use sketchlib::prelude::*;
|
||||
|
||||
fn main() {
|
||||
|
@ -35,18 +36,12 @@ fn model(_app: &App) -> Model {
|
|||
|
||||
const G: f64 = 6.67408e-11;
|
||||
|
||||
let palette = &[
|
||||
rgb(85.0 / 255.0, 205.0 / 255.0, 252.0 / 255.0),
|
||||
rgb(1.0, 1.0, 1.0),
|
||||
rgb(247.0 / 255.0, 168.0 / 255.0, 184.0 / 255.0),
|
||||
];
|
||||
|
||||
let mut theta = 0.0;
|
||||
|
||||
for i in 1..=256 {
|
||||
let r = 25.0 + 5.0 * i as f64;
|
||||
let m = 50000000000u64 / i;
|
||||
let curr_color = palette[i as usize % palette.len()];
|
||||
let curr_color = TRANS_FLAG[i as usize % TRANS_FLAG.len()];
|
||||
|
||||
let speed = (G * MASS_SUN as f64 / r).sqrt();
|
||||
println!("{}", speed);
|
||||
|
|
Loading…
Reference in New Issue