/** * A class that contains various mathematical constants. */ export class Constants { /** * A small value used for comparing floating-point numbers. * Can be used for precision comparisons in mathematical calculations. */ static readonly DELTA: number = 1e-12; /** * The mathematical constant pi (approximately 3.14159). * Can be used for calculations involving circles, angles, and trigonometry. */ static readonly PI: number = Math.PI; /** * The mathematical constant tau, which is equal to 2 * pi (approximately 6.28318). * Can be used as a more convenient representation of the circle constant. */ static readonly TAU: number = 6.2831853071795865; /** * The mathematical constant e (approximately 2.71828). * Can be used for calculations involving exponential growth and decay. */ static readonly E: number = Math.E; /** * The square root of 5 (approximately 2.23607). * Can be used in calculations involving the golden ratio and Fibonacci numbers. */ static readonly SQRT5: number = 2.2360679774997897; /** * The square root of 3 (approximately 1.73205). * Can be used in calculations involving equilateral triangles and hexagons. */ static readonly SQRT3: number = 1.7320508075688772; /** * The square root of 2 (approximately 1.41421). * Can be used in calculations involving right triangles and diagonal lengths. */ static readonly SQRT2: number = Math.SQRT2; /** * The square root of 1/2 (approximately 0.70711). * Can be used in calculations involving scaling and normalization. */ static readonly SQRT1_2: number = Math.SQRT1_2; /** * The twelfth root of 12 (approximately 1.05946). * Can be used in calculations involving musical intervals and pitch ratios. */ static readonly TWELFTH_SQRT12: number = 1.0594630943592953; /** * The cube root of 3 (approximately 1.44225). * Can be used in calculations involving exponential functions and logarithms. */ static readonly CSQRT3: number = 1.4422495703074084; /** * The cube root of 2 (approximately 1.25992). * Can be used in calculations involving exponential functions and logarithms. */ static readonly CSQRT2: number = 1.2599210498948732; /** * The super golden ratio (approximately 1.46557). * Can be used in calculations involving aesthetics and design. */ static readonly SUPER_GOLDEN_RATIO: number = 1.4655712318767680; /** * The golden ratio (approximately 1.61803). * Can be used in calculations involving aesthetics, design, and proportions. */ static readonly GOLDEN_RATIO: number = 1.6180339887498948; /** * The silver ratio (approximately 2.41421). * Can be used in calculations involving aesthetics, design, and proportions. */ static readonly SILVER_RATIO: number = 2.414213562373095; }