merman-render 0.5.0

Headless layout + SVG renderer for Mermaid (parity-focused; upstream SVG goldens).
Documentation
//! Precomputed trig tables for strict Mermaid parity.
//!
//! Upstream Mermaid (flowchart-v2) generates stadium arc points via
//! `generateCirclePoints(centerX, centerY, radius, 50, startAngle, endAngle)`, where
//! `Math.cos/Math.sin` are evaluated on V8 `Number` values.
//!
//! These constants store `(cos(angle), sin(angle))` for the exact angle sequence produced by:
//! - `startAngleRad = (startAngle * Math.PI) / 180`
//! - `endAngleRad   = (endAngle   * Math.PI) / 180`
//! - `angleStep     = (endAngleRad - startAngleRad) / (numPoints - 1)`
//! - `angle         = startAngleRad + i * angleStep` for `i = 0..numPoints-1`
//!
//! The values were generated from Node.js (V8) and are used to avoid platform `libm` drift that
//! shows up at the 1e-13 scale in strict SVG `data-points` parity.

#![allow(clippy::excessive_precision)]

#[rustfmt::skip]
pub(crate) const STADIUM_ARC_90_270_COS_SIN: [(f64, f64); 50] = [
    (6.1232339957367660e-17f64, 1.0000000000000000f64),
    (-0.064070219980712828f64, 0.99794539275033634f64),
    (-0.12787716168450589f64, 0.99179001382324616f64),
    (-0.19115862870137215f64, 0.98155915699106533f64),
    (-0.25365458390950718f64, 0.96729486303902945f64),
    (-0.31510821802362066f64, 0.94905574701066864f64),
    (-0.37526700487937409f64, 0.92691675734602175f64),
    (-0.43388373911755806f64, 0.90096886790241915f64),
    (-0.49071755200393757f64, 0.87131870412338952f64),
    (-0.54553490121054860f64, 0.83808810489184071f64),
    (-0.59811053049121599f64, 0.80141362186795662f64),
    (-0.64822839530778820f64, 0.76144595836913453f64),
    (-0.69568255060348638f64, 0.71834935009772760f64),
    (-0.74027799707531539f64, 0.67230089026131701f64),
    (-0.78183148246802969f64, 0.62348980185873359f64),
    (-0.82017225459695564f64, 0.57211666012216988f64),
    (-0.85514276300534608f64, 0.51839256831052516f64),
    (-0.88659930637300011f64, 0.46253829024083526f64),
    (-0.91441262301581239f64, 0.40478334312239406f64),
    (-0.93846842204976022f64, 0.34536505442130810f64),
    (-0.95866785303666058f64, 0.28452758663103273f64),
    (-0.97492791218182362f64, 0.22252093395631450f64),
    (-0.98718178341445006f64, 0.15959989503337960f64),
    (-0.99537911294919823f64, 0.096023025907681941f64),
    (-0.99948621620068789f64, 0.032051577571655165f64),
    (-0.99948621620068789f64, -0.032051577571654923f64),
    (-0.99537911294919823f64, -0.096023025907681261f64),
    (-0.98718178341445018f64, -0.15959989503337890f64),
    (-0.97492791218182362f64, -0.22252093395631428f64),
    (-0.95866785303666069f64, -0.28452758663103206f64),
    (-0.93846842204976044f64, -0.34536505442130744f64),
    (-0.91441262301581250f64, -0.40478334312239378f64),
    (-0.88659930637300022f64, -0.46253829024083504f64),
    (-0.85514276300534620f64, -0.51839256831052494f64),
    (-0.82017225459695609f64, -0.57211666012216933f64),
    (-0.78183148246802991f64, -0.62348980185873337f64),
    (-0.74027799707531583f64, -0.67230089026131645f64),
    (-0.69568255060348660f64, -0.71834935009772738f64),
    (-0.64822839530778908f64, -0.76144595836913387f64),
    (-0.59811053049121621f64, -0.80141362186795650f64),
    (-0.54553490121054915f64, -0.83808810489184038f64),
    (-0.49071755200393780f64, -0.87131870412338941f64),
    (-0.43388373911755829f64, -0.90096886790241903f64),
    (-0.37526700487937453f64, -0.92691675734602164f64),
    (-0.31510821802362132f64, -0.94905574701066842f64),
    (-0.25365458390950829f64, -0.96729486303902923f64),
    (-0.19115862870137260f64, -0.98155915699106533f64),
    (-0.12787716168450658f64, -0.99179001382324605f64),
    (-0.064070219980712856f64, -0.99794539275033634f64),
    (-1.8369701987210297e-16f64, -1.0000000000000000f64),
];

#[rustfmt::skip]
pub(crate) const STADIUM_ARC_270_450_COS_SIN: [(f64, f64); 50] = [
    (-1.8369701987210297e-16f64, -1.0000000000000000f64),
    (0.064070219980712481f64, -0.99794539275033634f64),
    (0.12787716168450619f64, -0.99179001382324605f64),
    (0.19115862870137224f64, -0.98155915699106533f64),
    (0.25365458390950707f64, -0.96729486303902945f64),
    (0.31510821802362016f64, -0.94905574701066886f64),
    (0.37526700487937420f64, -0.92691675734602175f64),
    (0.43388373911755795f64, -0.90096886790241926f64),
    (0.49071755200393752f64, -0.87131870412338963f64),
    (0.54553490121054804f64, -0.83808810489184105f64),
    (0.59811053049121587f64, -0.80141362186795673f64),
    (0.64822839530778820f64, -0.76144595836913465f64),
    (0.69568255060348594f64, -0.71834935009772793f64),
    (0.74027799707531561f64, -0.67230089026131679f64),
    (0.78183148246802969f64, -0.62348980185873371f64),
    (0.82017225459695564f64, -0.57211666012217000f64),
    (0.85514276300534575f64, -0.51839256831052571f64),
    (0.88659930637300000f64, -0.46253829024083537f64),
    (0.91441262301581228f64, -0.40478334312239417f64),
    (0.93846842204976022f64, -0.34536505442130822f64),
    (0.95866785303666058f64, -0.28452758663103245f64),
    (0.97492791218182351f64, -0.22252093395631464f64),
    (0.98718178341445006f64, -0.15959989503337971f64),
    (0.99537911294919812f64, -0.096023025907682510f64),
    (0.99948621620068789f64, -0.032051577571655290f64),
    (0.99948621620068789f64, 0.032051577571654805f64),
    (0.99537911294919823f64, 0.096023025907681137f64),
    (0.98718178341445018f64, 0.15959989503337924f64),
    (0.97492791218182362f64, 0.22252093395631417f64),
    (0.95866785303666080f64, 0.28452758663103195f64),
    (0.93846842204976066f64, 0.34536505442130694f64),
    (0.91441262301581250f64, 0.40478334312239372f64),
    (0.88659930637300022f64, 0.46253829024083493f64),
    (0.85514276300534608f64, 0.51839256831052527f64),
    (0.82017225459695586f64, 0.57211666012216966f64),
    (0.78183148246802991f64, 0.62348980185873337f64),
    (0.74027799707531594f64, 0.67230089026131634f64),
    (0.69568255060348694f64, 0.71834935009772705f64),
    (0.64822839530778920f64, 0.76144595836913376f64),
    (0.59811053049121632f64, 0.80141362186795639f64),
    (0.54553490121054926f64, 0.83808810489184027f64),
    (0.49071755200393791f64, 0.87131870412338930f64),
    (0.43388373911755840f64, 0.90096886790241903f64),
    (0.37526700487937464f64, 0.92691675734602152f64),
    (0.31510821802362143f64, 0.94905574701066842f64),
    (0.25365458390950840f64, 0.96729486303902912f64),
    (0.19115862870137271f64, 0.98155915699106533f64),
    (0.12787716168450669f64, 0.99179001382324605f64),
    (0.064070219980712967f64, 0.99794539275033634f64),
    (3.0616169978683831e-16f64, 1.0000000000000000f64),
];