Fix spawn angle

This commit is contained in:
Joshua Coles 2023-03-03 16:08:57 +00:00
parent 0a56c6f83f
commit ac6e176801

View File

@ -1,3 +1,4 @@
use std::f32::consts::PI;
use std::fs::File;
use std::io::Write;
use std::io;
@ -99,7 +100,7 @@ impl<R: Rng, S: Storage, W: Walker<R>> DLASystem<R, S, W> {
}
fn spawn_particle(&mut self) {
let theta = self.rng.gen_range(0f32..1.0);
let theta = self.rng.gen_range(0f32..1.0) * 2.0 * PI;
let (x, y) = (self.add_circle * theta.cos(), self.add_circle * theta.sin());
let position = Position(x as i32, y as i32);