From 0a61ad295540ddd59eba8a0f540dc05fa609553d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?charlotte=20=F0=9F=8C=B8?= Date: Fri, 24 Apr 2026 18:18:23 -0700 Subject: [PATCH 1/2] Add math constants. --- crates/processing_pyo3/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/processing_pyo3/src/lib.rs b/crates/processing_pyo3/src/lib.rs index 2e889c0..0e336cc 100644 --- a/crates/processing_pyo3/src/lib.rs +++ b/crates/processing_pyo3/src/lib.rs @@ -572,6 +572,18 @@ mod mewnala { #[pymodule_export] const F12: u32 = 301; + // Math constants + #[pymodule_export] + const PI: f32 = std::f32::consts::PI; + #[pymodule_export] + const TWO_PI: f32 = std::f32::consts::TAU; + #[pymodule_export] + const HALF_PI: f32 = std::f32::consts::FRAC_PI_2; + #[pymodule_export] + const QUARTER_PI: f32 = std::f32::consts::FRAC_PI_4; + #[pymodule_export] + const TAU: f32 = std::f32::consts::TAU; + // color space constants for color_mode() #[pymodule_export] const SRGB: u8 = 0; From a9ed25e31a1eec4ce7b8e2feef4a213221b33c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?charlotte=20=F0=9F=8C=B8?= Date: Fri, 24 Apr 2026 18:20:18 -0700 Subject: [PATCH 2/2] Add math constants. --- crates/processing_pyo3/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/processing_pyo3/src/lib.rs b/crates/processing_pyo3/src/lib.rs index 0e336cc..9c1881c 100644 --- a/crates/processing_pyo3/src/lib.rs +++ b/crates/processing_pyo3/src/lib.rs @@ -583,6 +583,10 @@ mod mewnala { const QUARTER_PI: f32 = std::f32::consts::FRAC_PI_4; #[pymodule_export] const TAU: f32 = std::f32::consts::TAU; + #[pymodule_export] + const DEG_TO_RAD: f32 = std::f32::consts::PI / 180.0; + #[pymodule_export] + const RAD_TO_DEG: f32 = 180.0 / std::f32::consts::PI; // color space constants for color_mode() #[pymodule_export]