circle_packing_apollonian — MATH construct op

• Data kinds: कोई नहीं → table (केवल arguments से तय होने वाला op — यह कोई image या data input नहीं लेता)

• Call: import fullseye as fs; fs.ledger.circle_packing_apollonian(curvatures=(-1.0, 2.0, 2.0, 3.0), depth=4, min_curvature=0.0) (implementation को सीधे call करना हो तो import mathops; mathops.circle_packing_apollonian(curvatures=(-1.0, 2.0, 2.0, 3.0), depth=4, min_curvature=0.0), registry से लेना हो तो opsmath.get("circle_packing_apollonian"))

उपयोग

Descartes quadruple से Apollonian gasket — हर circle एक theorem।

> नीचे का विस्तृत विवरण मूल text में है — सारांश और headings का अनुवाद हो चुका है।

Four mutually tangent circles satisfy the Descartes circle theorem

(k1 + k2 + k3 + k4)**2 == 2 * (k1**2 + k2**2 + k3**2 + k4**2)

where k = 1/r is the curvature (negative for the enclosing circle). The theorem is quadratic in k4, so a triple of mutually tangent circles has two solutions and the second is k4' = 2*(k1+k2+k3) - k4; recursing on that reflection fills the gasket. The centres follow the complex form k4*z4 = k1*z1 + k2*z2 + k3*z3 +- 2*sqrt(k1*k2*z1*z2 + ...), so no geometry is fitted — every circle is produced by an exact algebraic step.

★Why this earns its place: the drawing carries its own proof. Each circle can be checked against Descartes to machine precision, tangency is |z_i - z_j| == |r_i +- r_j| exactly, and an integral quadruple stays integral for ever — start from (-1, 2, 2, 3) and every curvature in the infinite packing is an integer (Lagarias-Mallows-Wilks). A drawing routine that is slightly wrong cannot keep integers integral.

Parameters

curvatures : 4 floats

A Descartes quadruple. The default (-1, 2, 2, 3) is the smallest

integral gasket. Must satisfy the theorem to 1e-9 relative.

depth : int >= 0

Reflection levels. Level 0 is the four seed circles; each further level

adds 4 * 3**(level-1), so the total is 2 * 3**depth + 2.

min_curvature : float

Drop circles smaller than 1/min_curvature (0 = keep all).

Returns a table: x, y, radius, curvature, depth (the enclosing circle has negative curvature and positive radius).

Raises ValueError: not four curvatures; the quadruple does not satisfy Descartes; every curvature negative or zero (no packing); depth negative or so large the packing exceeds the cap; non-finite input.

HALCON: no operator.

पूरी family का input contract (fail-closed)

mathops के सभी ops गणना से पहले input की जाँच करते हैं (कुछ भी चुपचाप पास नहीं होता):

• complex input से ValueError — float64 में ज़बरदस्ती बदलने पर imaginary part चुपचाप छूट जाता है (numpy केवल ComplexWarning देता है और "सही दिखने वाला पर गलत" real number लौटाता है)। .real/.imag/abs() स्पष्ट रूप से लिखें, या complex data संभालने वाले complexops का उपयोग करें।

• masked array (masked elements वाला) से ValueError — mask हटाकर नीचे के raw values इस्तेमाल करने वाला implicit conversion अस्वीकार है। भरना है या हटाना है, यह स्पष्ट रूप से बताएँ।

• हर input पर NaN/Inf से ValueError (गिनती बताकर अस्वीकार — क्योंकि यह पूरे परिणाम में फैल जाता है)।

• Shape सख़्त है: 1-D और 2-D को implicit रूप से promote या broadcast नहीं किया जाता (vector slot में matrix या matrix slot में vector देने पर ValueError; reshape स्पष्ट रूप से करें)।

• Size की सीमा: matrix लेने वाले ops और stat_histogram के bins, mathops.MAX_ELEMENTS (2^26 ≈ 6.7 करोड़ elements) से अधिक होने पर ValueError देते हैं।

उपयोग की विस्तृत guide

• math_metrology family guide

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• poc_theorems_as_pictures — py -3.11 examples/poc_theorems_as_pictures.py

वे अगले ops जिनसे type जुड़ता है (table को input के रूप में लेते हैं)

dynsys_poincare_section · dwt_inverse · chebyshev_eval_nd

इसी category के (construct)

ford_circles · phyllotaxis_pattern · neighbour_index_gaps · ifs_fractal · ifs_similarity_dimension · space_filling_curve · curve_locality


*Provenance: mathops.py — MATH operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.