Here's the code. I have indicated the \j1 and \j2 lines with long arrows on the right.
Code: Select all
Code, edit and compile here:
\documentclass[tikz]{standalone}\usepackage{fp}\usetikzlibrary{math, fixedpointarithmetic}\begin{document}\begin{tikzpicture}[fixed point arithmetic]% Variables% j1, m1, j2, m2: Input spin vectors% jtot, mtot: Input total spin vector% jitot, mitot, mi1, mi2: Temporary spin vector values for the coeff function% blocks: Number of coefficient boxes% dw, dh: Number of cells per per box% aoldx, aoldy: Coordinates of the top right of the last coeefficient grid% anewx, anewy: Coordinates of the top right of the new coefficient grid% num: Number to be converted to fraction% r: Returned fraction% w, h: Width and height of one cell% n, d: Throw-away integers% c, i, j, k, hm1, p, q, s, wjtot: Throw-away variables% Program Block\tikzmath {% Convert A Decimal To A Fractionfunction f(\num) {integer \n, \d;\stop=0;for \k in {1,...,200} {\a=\k*\num;if \stop==0 then {if int(abs(\a))==abs(\a) then {if \k==1 then {\n=\num; let \r="\n"; \stop=1; }else {\n=\a; \d=\k; let \r="\n/\d"; \stop=1; };};};};return \r;};function coeff(\jitot,\mitot,\mi1,\mi2) {\j1=1/2; \j2=1/2; %<--------------------------------------------------------------------\s=0;for \ki in {0,...,0} {\s=\s+1/((\ki)!*(\j1+\j2-\jitot-\ki)!*(\j1-\mi1-\ki)!*(\j2+\mi2-\ki)!*(\jitot-\j2+\mi1+\ki)!*(\jitot-\j1-\mi2+\ki)!);};
-Dan