Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

SphericalToEquirect.m 578 B

123456789101112131415161718192021222324252627
  1. % SphericalToEquirect.m
  2. %
  3. % This function converts spherical coordinates to equirectangular coordinates
  4. % (pixels).
  5. function [xEq, yEq] = SphericalToEquirect(horRads, verRads, widthPx, heightPx)
  6. xEq = (horRads / (2 * pi)) * widthPx;
  7. yEq = (verRads / pi) * heightPx;
  8. if (yEq < 0)
  9. yEq = -yEq;
  10. xEq = xEq + widthPx/2;
  11. end
  12. if (yEq >= heightPx)
  13. yEq = 2 * heightPx - yEq -1;
  14. xEq = xEq + widthPx/2;
  15. end
  16. if (xEq < 0)
  17. xEq = widthPx + xEq - 1;
  18. end
  19. if (xEq > widthPx)
  20. xEq = xEq - widthPx;
  21. end
  22. end