First Look. Taraji P. Henson, Octavia Spencer, and Janelle Monáe in ‘Hidden Figures.’

Taraji P. Henson, Octavia Spencer, Janelle Monae

Taraji P. Henson, Octavia Spencer, and Janelle Monáe star in the upcoming film Hidden Figures. The movie centers around a little known group of black women scientists and master mathematicians who helped NASA win the space race. The group included Katherine Johnson, Mary Jackson, Dorothy Vaughan, Kathryn Peddrew, Sue Wilder, Eunice Smith and Barbara Holley. The women worked in a segregated unit from the 1940’s to the 1960’s.

Henson stars as Johnson, Spencer plays her supervisor, Dorothy Vaughan, and Monáe plays Mary Jackson, an engineer who also worked at NASA, and was considered to be a trailblazer.

Speaking to the New York Times, which recently shared some stills from Hidden Figures, Henson revealed that she immersed herself in the role of Katherine Johnson, and even performed complex mathematical computations.

The part challenged Ms. Henson in unexpected ways. She fizzes with energy, and containing it all to play Ms. Johnson left her exhausted at day’s end. She used moments between takes as release valves, breaking into impromptu dances and letting her wit rip.

She also labored, fruitlessly, to understand Ms. Johnson’s intricate calculations, going so far as to skip Beyoncé’s May 1 concert at the Georgia Dome to do her math homework. “It makes my heart palpitate, the math,” she said.

It was an aversion she shared, to a degree, with Ms. Spencer, who happens to like basic math but goes blank when it comes to calculus. Luckily for all, Mr. Melfi said, the film is “math lite.”

Hidden Figures, which is based on the forthcoming book of the same name by Margot Lee Shetterly hits is expected to his theaters in early 2017.