Fix spawn angle
This commit is contained in:
parent
0a56c6f83f
commit
ac6e176801
@ -1,3 +1,4 @@
|
|||||||
|
use std::f32::consts::PI;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::io;
|
use std::io;
|
||||||
@ -99,7 +100,7 @@ impl<R: Rng, S: Storage, W: Walker<R>> DLASystem<R, S, W> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn spawn_particle(&mut self) {
|
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 (x, y) = (self.add_circle * theta.cos(), self.add_circle * theta.sin());
|
||||||
let position = Position(x as i32, y as i32);
|
let position = Position(x as i32, y as i32);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user