During the era of US racial segregation, a handful of black female mathematicians managed to break social barriers and propel the US space agency to new heights - and soon their story will be a major motion picture.
This remarkable story has been told in the book "Hidden Figures" by Margot Lee Shetterly, which was published in September.
The movie comes out in January, starring Taraji P. Henson -- known for her role in the TV series "Empire" and for her Oscar nomination in the 2008 film "The Curious Case of Benjamin Button" -- and Octavia Spencer, who won an Academy Award for Best Supporting Actor in 2011 film "The Help."
Some of the female mathematicians worked with the author's father, an engineer at NASA's Langley Research Center in Virginia, a southern US state where racial segregation was the norm.
Shetterly, herself an African-American, was born in 1969 and remembers the women as "normal" middle-class types, the mothers of friends who serve peanut butter sandwiches to kids.
The mathematicians provided pivotal contributions to the US space program, starting in the 1940s through to the 1960s, when the nation first sent men to orbit and then walk on the Moon.
It was not until Shetterly's husband heard about the women, during a visit with Shetterly's father, that she realized their story could -- and should -- be written in book form.
"My husband was like, 'Wait a minute, I cannot believe this. How can nobody knows the story?" she recalled in an interview with AFP.
- Urgent need for mathematicians -
The heroines of the story are Dorothy Vaughan, Katherine Johnson and Mary Jackson.
The US involvement in World War II in 1941 opened the door to them, Shetterly said.
The country needed engineers and scientists to come up with new technologies to help planes fly higher and faster.
But segregation was still a reality.
There were dozens of African-Americans, both male and female, working as mathematicians and physicists for the US space program, even as they were forced to use separate bathrooms from whites, and were barred from the same restaurants and schools frequented by whites.
The black women mathematicians at the center of "Hidden Figures" were nicknamed "colored computers," working apart from the rest of the math unit in the west wing of the Langley Research Center.
By the end of the war, there were around 25 black women and two white managers in the unit.
Soon, however, there was a new war, as the Cold War broke out between the United States and the Soviet Union.
The USSR launched its first satellite, Sputnik, in 1957, raising the stakes for the United States in the space race.
By 1958, NASA was formed, gathering all the nation's space activities and the Langley Research Center was in charge of the Mercury project, the first US manned space program.
It was then that the black mathematicians were integrated with the rest of NASA and tasked with making complex calculations about rocket launches.
In 1959, Katherine Johnson -- played in the movie by Henson -- and a white colleague were the first to calculate the parameters of the first sub-orbital flight in 1961 of astronaut Alan Shepard, the first American in space.
They also calculated John Glenn's course, as the first American to orbit the Earth in 1962.
According to the book, in 1962, Glenn asked that Johnson herself re-check the figures one last time before he embarked on the mission.
Johnson's math talents later helped determine the trajectory of the Apollo 11 flight that landed Neil Armstrong and Buzz Aldrin on the Moon in July 1969.
The women in the story are among about 80 black female mathematicians who worked for the US space program from 1943 to 1980 -- a time period that saw about 1,000 women employed there, far fewer than the number of men.
- Medal of Freedom -
In November 2015, US President Barack Obama gave Johnson, who is now 98, the Presidential Medal of Freedom, the highest civilian honor in the United States.
Dorothy Vaughan, played in the movie by Octavia Spencer, died in 2008.
Mary Jackson, who died in 2005, was an aeronautical engineer and is played by Janelle Monae.
"Talent is distributed among all populations, whatever the color of their skin," said Shetterly.
"Given a chance, people can excel in these fields."
She described the story of these women as "powerful source of inspiration" that "we can learn from the past, in terms of opening the doors for people to excel today."