Converting 360 Spherical to Equirectangular

See ExampleScripts- convert_to_pixels

The script is designed to convert 3D eye-tracking data from Cartesian coordinates (x, y, z) to 2D coordinates on an equirectangular projection, commonly used in 360° videos or panoramic images. Specifically, it's converting these coordinates to pixel coordinates on an equirectangular frame. Here's a breakdown of what each part of the script does:

This conversion is useful when you need to map 3D gaze data onto a 2D representation of a 360° environment, such as overlaying gaze points onto a 360° video frame. The pixel coordinates tell you where on the 2D frame the person was looking, based on their 3D gaze direction.