Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # rgb_sine_by_1000.py
- from math import sin, radians
- def deg2sine(deg):
- deg = deg % 360
- return min(255,int(sin(radians(deg))*256))
- e = 180/1000.0
- b1000_to_sine_255 = {i:deg2sine(i*e) for i in range(0, 1001)}
- for i in range(0, 1001):
- print(i,':',b1000_to_sine_255[i])
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement