fix implementation errors. (#1568)
fix implementation errors. (#1568)

I revised my implementation and found out that I have miss a inner loop for t.  x and y should be recalculated everytime when t is divisble by 2. I have also included a more readble source for this algorithm.
TheAlgorithms/Python