How exactly do you compute a spiral mathematically? Is it an algorithm?