From 991eb835f383baec52cd848ebe0d60ca2cf70363 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Wed, 9 Apr 2025 18:40:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=8C=20=D0=BF=D1=80=D0=BE=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D1=81=D1=82=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index b0d382b..3d963fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,6 @@ use sdl3::pixels::Color; use sdl3::render::{FPoint, WindowCanvas}; use std::f32::consts::PI; use std::ops; -use std::ops::Add; use std::time::Duration; const SIZE: u32 = 400; @@ -96,19 +95,6 @@ impl Point2D { Point2D::new(cos * scale, sin * scale) } - pub fn to_polar(p: Point2D) -> Point2D { - let len = p.y.hypot(p.x); - let cos = p.x / len; - let sin = p.y / len; - let x = cos.acos(); - let mut y = sin.asin(); - let mb_sin = x.sin(); - if y.signum() != mb_sin.signum() { - y = -y; - } - Point2D::new(x, y) - } - pub fn to_sdl(&self) -> FPoint { FPoint::new(self.x + SIZE as f32, self.y + SIZE as f32) } @@ -146,9 +132,6 @@ impl Point2D { // canvas.draw_points(&points).unwrap() canvas.draw_points(&points[..]).unwrap(); } - fn requires_slice<'a, T: Into<&'a [FPoint]>>(arg: T) { - let slice: &[FPoint] = arg.into(); - } } impl ops::AddAssign for Point2D {