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

Function wave

example_code/item_046.py:53–59  ·  view source on GitHub ↗
(amplitude, steps)

Source from the content-addressed store, hash-verified

51import math
52
53def wave(amplitude, steps):
54 step_size = 2 * math.pi / steps
55 for step in range(steps):
56 radians = step * step_size
57 fraction = math.sin(radians)
58 output = amplitude * fraction
59 yield output
60
61
62print("Example 2")

Callers 2

item_046.pyFile · 0.85
complex_waveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected