j starting from 0, handling MemoryError
changed norm by c.dot(c), removed old TODO
using tmp variables to avoid sin() and cos() calls inside the for loops
using tmp variables to avoid sin() and cos() calls inside the for loops
using tmp variables to avoid sin() and cos() calls inside the for loops