geometry - Spherical coordinates: range choice - best practices & performance -
i writing code deals coordinate systems, geometry , other similar stuff. know is, in general, common/practical/efficient way storing spherical coordinates, regarding common calculations on them. it:
theta - [0, 180) phi - [0, 360)
or
theta - [-90, 90) phi - [-180, 180)
or other?
(the above coordinates expressed in radians clarity, keep them in radians improve speed, since math functions implemented radians.)
i know mathematical aspect, irrelevant, wondering if choice result in easier or more efficient implementation.
a couple of thoughts:
the representations indeed mathematically equivalent. converting 1 other cost couple of floating point additions, pi/2 , pi, respectively. cost of additions on common hardware pales in comparison of trigonometry, reverse trig, multiplication/division, , square-root calculations common in arithmetic of sphere geometry.
there large body of arithmetic text regarding sphere geometry developed on years dealing navigation on earth. text uses latitude/longitude coordinate system, of -90..+90 , -180..+180, respectively. use known formulas without conversion, might want stick coordinate system.
Comments
Post a Comment