Skip to content

Commit 0a61ad2

Browse files
committed
Add math constants.
1 parent e3ceaa5 commit 0a61ad2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • crates/processing_pyo3/src

crates/processing_pyo3/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,18 @@ mod mewnala {
572572
#[pymodule_export]
573573
const F12: u32 = 301;
574574

575+
// Math constants
576+
#[pymodule_export]
577+
const PI: f32 = std::f32::consts::PI;
578+
#[pymodule_export]
579+
const TWO_PI: f32 = std::f32::consts::TAU;
580+
#[pymodule_export]
581+
const HALF_PI: f32 = std::f32::consts::FRAC_PI_2;
582+
#[pymodule_export]
583+
const QUARTER_PI: f32 = std::f32::consts::FRAC_PI_4;
584+
#[pymodule_export]
585+
const TAU: f32 = std::f32::consts::TAU;
586+
575587
// color space constants for color_mode()
576588
#[pymodule_export]
577589
const SRGB: u8 = 0;

0 commit comments

Comments
 (0)