Skip to main content

Module complex

Module complex 

Source
Expand description

Complex numbers, quaternions, and iterative fractal evaluation.

Provides:

  • Complex — fully-featured complex number arithmetic
  • Quaternion — 3D rotation quaternion with SLERP and expmap
  • Fractal samplers: Mandelbrot, Julia, BurningShip, Newton, Lyapunov
  • Color mapping utilities for escape-time fractals

Structs§

BurningShip
Complex
A complex number z = re + im·i.
EscapeResult
Result of an escape-time fractal iteration.
JuliaParams
Julia set: z → z^power + c where c is fixed.
LyapunovFractal
Computes the Lyapunov exponent for a logistic-map-like system. The sequence string alternates between two parameter values A and B.
MandelbrotParams
Parameters for the generalized Mandelbrot set: z → z^power + c.
NewtonFractal
Newton’s method fractal for a polynomial p(z)/p’(z). Converges to roots; color by which root was reached.
Quaternion
Unit quaternion for 3D rotation: q = w + xi + yj + zk.

Enums§

FractalPalette
Maps an EscapeResult to RGBA color.