The post is based on research from NASA's Stratospheric Observatory for Infrared Astronomy.

(Web Desk) - NASA has shared a stunning photograph on Instagram of a galaxy called M77, and has offered a brief explanation of how it has been “shaped.” For a long time, the shapes of many galaxies, including our own Milky Way, have puzzled many scientists.

The Milky Way is spiral-shaped and has arms full of stars. However, have you ever wondered how it got its shape? Well, this is the question that had baffled scientists for a long time. In its new post, the space agency has explained how magnetic fields played a huge role in shaping the various galaxies.

The post is based on research from NASA’s Stratospheric Observatory for Infrared Astronomy, or SOFIA telescope. In the caption, NASA states that “spiral galaxies like the Milky Way are shaped by magnetic fields” that are “invisible to the human eye.”

But these magnetic fields are made clearer by combining imagery from the space agency’s Hubble Space Telescope, Nuclear Spectroscopic Array, and Sloan Digital Sky Survey.

Describing the post on Instagram, NASA states, “In this image, scientists measured the magnetic fields along the spiral arms of a galaxy called M77. The fields are shown as streamlines that closely follow the circling arms. The magnetic fields align along the entire length of the massive spiral arms — 24,000 light years across — implying that the gravitational forces that created the galaxy’s shape are also compressing its magnetic field.”