bland 0.1.0

Pure-Rust library for paper-ready, monochrome, hatch-patterned technical plots in the visual tradition of 1960s-80s engineering reports.
Documentation
//! Polar projection helpers.
//!
//! When a figure has projection [`Projection::Polar`], series data is
//! interpreted as `(θ, r)` pairs (θ in **radians**) and projected through
//! `(θ, r) → (r·cos θ, r·sin θ)` before applying the Cartesian scales.

/// Project `(θ, r)` (polar, radians) to `(x, y)` (Cartesian).
pub fn project(theta: f64, r: f64) -> (f64, f64) {
    (r * theta.cos(), r * theta.sin())
}

/// Inverse of [`project`]: Cartesian → `(θ, r)`.
pub fn from_xy(x: f64, y: f64) -> (f64, f64) {
    (y.atan2(x), (x * x + y * y).sqrt())
}

/// Returns `(thetas, rs)` tracing a full circle of radius `r`. Useful
/// for concentric reference rings on a polar plot.
pub fn circle(r: f64, n: usize) -> (Vec<f64>, Vec<f64>) {
    let n = n.max(3);
    let step = std::f64::consts::TAU / n as f64;
    let thetas: Vec<f64> = (0..=n).map(|i| i as f64 * step).collect();
    let rs = vec![r; n + 1];
    (thetas, rs)
}