Draw a sphere: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: added/changed comments and whitespace, simplified and optimized a function, used a template for the output. |
m →{{header|REXX}}: added a comment that shows an alternative syntax. |
||
Line 3,962:
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>0 then dot=0 /*if positive, make it zero*/ /*◄■■■■ same as: dot=max(0, dot) */
if dot>0 then dot=0 /*if positive, make it zero*/
b=-dot**k + ambient /*calculate the brightness.*/
|