Advertisement
matbiz01

shore

Jun 23rd, 2023
834
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 1 0
  1. import numpy
  2. from numpy import exp
  3.  
  4.  
  5. xVals = [2, 8, 14, 20, 26]
  6.  
  7. for y in range(32):
  8.     total = 0j
  9.     for x in xVals:
  10.         total += exp(-numpy.pi * y * x * 1j / 16)
  11.        
  12.    
  13.     if numpy.real(total) < 1e-7:
  14.         total = complex(0, numpy.imag(total))
  15.     if numpy.imag(total) < 1e-7:
  16.         total = complex(numpy.real(total), 0)
  17.     print(y, total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement