You can try to see how long each functies does to complete. Be doing this it becomes clear what is slow I think. I don't think It's your circle drawing stuff but the ray intersection stuff.