fastApproximateAtan.js 601 B

12345678910111213141516
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "float czm_fastApproximateAtan(float x) {\n\
  3. return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n\
  4. }\n\
  5. float czm_fastApproximateAtan(float x, float y) {\n\
  6. float t = abs(x);\n\
  7. float opposite = abs(y);\n\
  8. float adjacent = max(t, opposite);\n\
  9. opposite = min(t, opposite);\n\
  10. t = czm_fastApproximateAtan(opposite / adjacent);\n\
  11. t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\n\
  12. t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\n\
  13. t = czm_branchFreeTernary(y < 0.0, -t, t);\n\
  14. return t;\n\
  15. }\n\
  16. ";