int incircle(float px, float py, float cx, float cy, float r){ return hypot(px-cx,py-cy)0.5?1-p[0]:p[0]; y=p[1]>0.5?1-p[1]:p[1]; float d=1.0/(2.0*Rivets); for(int c=0; c0){ float dist=hypot(x-cx, y-cy)/Size; Bump = Height * sqrt(1 - dist*dist) + Wear * noise("uperlin", p); Gloss = 0.2 * (1 - Wear * (1 - dist)); } }