Better cos + sin calculation