MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / wave_cascading

Function wave_cascading

example_code/item_046.py:146–153  ·  view source on GitHub ↗
(amplitude_it, steps)

Source from the content-addressed store, hash-verified

144
145print("Example 9")
146def wave_cascading(amplitude_it, steps):
147 step_size = 2 * math.pi / steps
148 for step in range(steps):
149 radians = step * step_size
150 fraction = math.sin(radians)
151 amplitude = next(amplitude_it) # Get next input
152 output = amplitude * fraction
153 yield output
154
155
156print("Example 10")

Callers 1

complex_wave_cascadingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected