// Last edited on 2019-04-05 18:06:12 by stolfi #macro halo(ctr,rad,Q,i) // Halo for an ion at center {ctr}, radius {rad}, charge {Q}. // Let's try a halo volume equal to a constant {Vc} times the atom volume: #local Vc = 1.0; #local Va = 4*pi/3 * rad*rad*rad; #local Vh = Vc * Va; #local rh = cbrt(Vc + 1.0)*rad;n // We want the color of the halo near the atom to be proportional to {Q}. // If the halo is emission/extinction the color will be #local L = 2*sqrt(rh*rh - rad*rad); // Length of halo chord near atom. #local #local s = sqrt(sqrt(abs(Q))); #local rh = (1 + (i+1.0)/abs(Q))*rad; // Radius of halo. #if (Q > 0) #local color = < 1.000, 0.700, 0.400 >; // Limiting color of positive halo. #else #local color = < 0.400, 0.700, 1.000 >; // limiting color of negative halo. #end