minseok
๐ Release BioPhys 6.0 Grand Master: 16GB (14.89GB) Gemma-4 100% Devour, Ecosystem Evolution, Solar MoE, SNN Autoregressive SDK, Dynamic PhaseVM
be99550 | // ๐ ์ธ๋ถ ์ค์๊ฐ ์ ํธ ๋ฐ ํ๋ ์ฃผ์ ๋ชจ๋ (src/live_streamer.rs) | |
| use std::f32::consts::PI; | |
| pub struct LiveSignalStreamer { | |
| pub time: f32, | |
| pub frequency: f32, | |
| } | |
| impl LiveSignalStreamer { | |
| pub fn new(freq: f32) -> Self { | |
| LiveSignalStreamer { time: 0.0, frequency: freq } | |
| } | |
| /// ์ค์๊ฐ ์๊ณ์ด ๊ณ ์กฐํ(Harmonics) ์ ํธ ์์ฑ | |
| pub fn generate_harmonic_wave(&mut self, size: usize) -> Vec<f32> { | |
| self.time += 0.05; | |
| let mut wave = Vec::with_capacity(size * size); | |
| for y in 0..size { | |
| for x in 0..size { | |
| let dx = (x as f32) / (size as f32) * 2.0 - 1.0; | |
| let dy = (y as f32) / (size as f32) * 2.0 - 1.0; | |
| let dist = (dx * dx + dy * dy).sqrt(); | |
| // ์ค์ฌ์์ ํผ์ ธ๋๊ฐ๋ ์ฌ์ธํ + ๊ณ ์ฃผํ ๊ฐ์ญ | |
| let signal = (dist * self.frequency * 2.0 * PI - self.time * 5.0).sin() * 0.8; | |
| wave.push(signal); | |
| } | |
| } | |
| wave | |
| } | |
| /// ํน์ ์ขํ์ ์๊ฐ์ ์ธ ์ธ๋ถ ์๋์ง ์ถฉ๊ฒฉํ(Impulse) ์ฃผ์ | |
| pub fn inject_shockwave(grid: &mut [f32], size: usize, center_x: usize, center_y: usize, energy: f32) { | |
| if center_x < size && center_y < size { | |
| let idx = center_y * size + center_x; | |
| grid[idx] += energy; | |
| } | |
| } | |
| } | |