Draw a sphere: Difference between revisions

m
→‎{{header|REXX}}: used a more idiomatic expression for getting the minimum.
m (→‎{{header|REXX}}: elided one comment, added/changed whitespace and comments, optimized sqrt function.)
m (→‎{{header|REXX}}: used a more idiomatic expression for getting the minimum.)
Line 4,191:
parse value norm(x y sqrt(rr-xx-yy) ) with v1 v2 v3
dot= s1*v1 + s2*v2 + s3*v3 /*the dot product of the Vs*/
if dot>= min(0, dot) then dot= 0 /*if positive, make it zero*/
b= -dot**k + ambient /*calculate the brightness.*/
if b<=0 then brite= shadeLen