Make getThetaPhi two functions to avoid allocating array

Per @WestLangley's comments.