Advertisement
here2share

# rgb_sine_by_1000.py

Jul 5th, 2022
675
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None
  1. # rgb_sine_by_1000.py
  2.  
  3. from math import sin, radians
  4.  
  5. def deg2sine(deg):
  6.     deg = deg % 360
  7.     return min(255,int(sin(radians(deg))*256))
  8.  
  9. e = 180/1000.0
  10. b1000_to_sine_255 = {i:deg2sine(i*e) for i in range(0, 1001)}
  11.  
  12. for i in range(0, 1001):
  13.     print(i,':',b1000_to_sine_255[i])
  14.     print()
Advertisement
RAW Paste Data Copied
Advertisement