There’s a new, old way of calculating the mass of distant stars. Astronomers at the Space Telescope Science Institute used observations from the Hubble Space telescope to test and ultimately confirm Einstein’s general theory of relativity and use it to calculate the mass of white dwarf stars.

They were also able to use it to verify the theory that the radius of a white dwarf is determined by its mass. The research completed by Kailash Sahu at the STScI in Maryland said the method, tested on the white dwarf star Stein 2051B matched previous hypothetical predictions, NASA said.

Read: Can Planets Near Red Dwarf Stars Support Life? NASA Says Don't Bet On It

Einstein’s theory of general relativity says really large objects in space can warp space-time, which people experience as the gravity we feel on Earth. Space-time is the idea that space and time are interconnected and that events don’t always occur at the same time everywhere. This also explains how light curves around objects and acts as a lens for what’s behind it, called gravitational microlensing. So astronomers can use this to see distant galaxies or stars.

The Hubble telescope caught this happening with white dwarf star Stein 2051B when it passed in front of a distant star that the telescope was observing. When it passed it bent the light from the star and made it look as though it was at a different point in space than it was. But astronomers knew the actual location of the star and were able to use that difference due to the deflection to measure the white dwarf’s mass.

hubble measurement
An illustration showing the observed deflection of light the Hubble telescope captured. NASA

This means the researchers found a new direct way to determine the mass of white dwarfs based on observations. The mass of some white dwarfs can be determined by measuring the orbital motion of the star if it has a companion and if the other star in the double star system isn’t too far away. In the case of Stein 2051B, its companion a red dwarf was too far away for an accurate measurement to be taken with this method.

Read: This Is The Process Of Becoming A NASA Astronaut, According To NASA

Sahu described the microlensing measuring technique as a highly dependable one, “It’s like placing the star on a scale: The deflection is analogous to the movement of the needle on the scale,” NASA said.

The researchers involved in the study carefully watched Stein 2051B for two years, waiting for it to move into position in front of the background star. They observed this happen seven times over the two years, which allowed them to make the measurements that led to the findings. They had to measure the movements of the star very carefully using its velocity and direction to catch it at the exact moment it passed the background star.

The peer-reviewed article on the research and findings were published in the journal Science on Wednesday.