<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function <EOL> import math <EOL> from . sixing import * <EOL> from . . base import excepting <EOL> from . consoling import getConsole <EOL> console = getConsole ( ) <EOL> def blend0 ( d = <NUM_LIT:0.0> , u = <NUM_LIT:1.0> , s = <NUM_LIT:1.0> ) : <EOL> """<STR_LIT>""" <EOL> d = float ( abs ( d ) ) <EOL> u = float ( abs ( u ) ) <EOL> s = float ( abs ( s ) ) <EOL> v = d - u <EOL> if v >= s : <EOL> b = <NUM_LIT:0.0> <EOL> elif v <= <NUM_LIT:0.0> : <EOL> b = <NUM_LIT:1.0> <EOL> else : <EOL> b = <NUM_LIT:1.0> - ( v / s ) <EOL> return b <EOL> Blend0 = blend0 <EOL> def blend1 ( d = <NUM_LIT:0.0> , u = <NUM_LIT:1.0> , s = <NUM_LIT:1.0> ) : <EOL> """<STR_LIT>""" <EOL> v = float ( abs ( u * s ) ) <EOL> a = float ( abs ( d ) ) <EOL> if a >= v or v == <NUM_LIT:0.0> : <EOL> b = <NUM_LIT:1.0> <EOL> elif a < v / <NUM_LIT> : <EOL> b = <NUM_LIT> * ( a * a ) / ( v * v ) <EOL> else : <EOL> b = <NUM_LIT:1.0> - ( <NUM_LIT> * ( a - v ) * ( a - v ) ) / ( v * v ) <EOL> return b <EOL> Blend1 = blend1 <EOL> def blend2 ( d = <NUM_LIT:0.0> , u = <NUM_LIT:1.0> , s = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> d = float ( d ) <EOL> u = float ( u ) <EOL> s = float ( abs ( s ) ) <EOL> b = <NUM_LIT:1.0> - math . exp ( - s * ( d * d ) / ( u * u ) ) <EOL> return b <EOL> Blend2 = blend2 <EOL> def blend3 ( d = <NUM_LIT:0.0> , u = <NUM_LIT:1.0> , s = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> d = float ( d ) <EOL> u = float ( u ) <EOL> s = min ( <NUM_LIT:1.0> , float ( abs ( s ) ) ) <EOL> b = <NUM_LIT:1.0> - s ** ( ( d * d ) / ( u * u ) ) <EOL> return b <EOL> Blend3 = blend3 </s>
