Taraji P. Henson hates math, and Octavia Spencer has a paralyzing fear of calculus, but that didn’t stop either actress from playing two of the most important mathematicians the world hasn’t ever known.
Both women are starring in “Hidden Figures,” a forthcoming film that tells the astonishing true story of female African-American mathematicians who were invaluable to NASA’s space program in the Jim Crow South in the early 1960s.
Ms. Henson plays Katherine Johnson, a math savant who calculated rocket trajectories for, among other spaceflights, the Apollo trips to the moon. Ms. Spencer plays her supervisor, Dorothy Vaughan, and the R&B star Janelle Monáe plays Mary Jackson, a trailblazing engineer who worked at the agency, too.
Slated for wide release in January, the film is based on the book of the same title, to be published this fall, by Margot Lee Shetterly. The author grew up knowing Ms. Johnson in Hampton, Va., but only recently learned about her outsize impact on America’s space race.
“I thought, oh my God, what is this we’re hearing here?” Ms. Shetterly said, recalling the moment a few years back when her father, a retired research scientist, casually mentioned Ms. Johnson’s life work. Her next thought: Why haven’t we heard about it before?
“Hidden Figures” comes as Hollywood is under mounting pressure to diversify its offerings after this year’s much criticized largely all-white Oscars race. And, while this picture has been in the works for several years, and the corresponding book for years before that, its filmmakers know it will invariably be lumped into post-#OscarsSoWhite chatter.
“It’s not a reactionary movie,” said Ted Melfi, the film’s director, “but it will be seen as one, which is unfortunate.”
Its evolution began two years ago, when the producer Donna Gigliotti, who won an Academy Award for “Shakespeare in Love,” made an offer on the book’s rights a day after reading Ms. Shetterly’s proposal.
For Ms. Gigliotti, the “Hidden Figures” story line had everything and more: the Cold War, the space race, the damages of segregation and racial and gender inequality, all set against the country’s burgeoning civil rights struggles.
Desperate to get ahead of the Russians, the nation’s space agency had hired the brainiest people it could find, among them Ms. Johnson, who, in 1937, graduated from college in West Virginia summa cum laude at 18. But, for years at the agency, women often worked in separate rooms from men, and the white women were segregated from the black women, who were known as “colored computers.” Ms. Johnson’s push to be heard by the men — her calculations, once they heeded her, proved invaluable — lies at the film’s narrative core.
“I knew the story was gold,” Ms. Gigliotti said.
As did, it seems, most everyone involved in the film.
Ms. Spencer said yes without pause, despite having initially mistaken the script as a work of too-good-to-be-true fiction.
Mr. Melfi (“St. Vincent”) heard about the plotline and cursed. At the time, he was deep in talks to direct the next “Spider-Man,” and knew he would have to back out because “Hidden Figures” was too good to pass up.
Ms. Monáe found the story a thrilling revelation, albeit a slightly troubling one. “Just think about how many other stories are hidden that we don’t know about,” she said, speaking from her Atlanta home.
And the hip-hop impresario Pharrell Williams, who grew up near Hampton, and was obsessed by space, clambered aboard, partly by sheer will, after learning about the story from his producing partner.
“She knew I was going to lose my mind upon hearing about it,” Mr. Williams said. “And when I did, we got on the phone with everybody, and we begged.” He became a producer on the film (other producers on the project include Peter Chernin, Jenno Topping and Mr. Melfi), has written songs for it and is working with Hans Zimmer on the score.
Earlier this month, days before the production wrapped here, Ms. Gigliotti along with the principal cast members squeezed in time between takes to talk about the film.
They were shooting downtown, in the old Georgia Archives building, a looming marble block, nicknamed the White Ice Cube, that was built in the ’60s and shuttered after engineers determined it was steadily sinking into the ground. For this film, which also stars Kevin Costner and Jim Parsons, the building was standing in for the Langley Research Center in Virginia. In the fusty air inside, amid snaking cables and extras dressed like squares from 1961, portable air-conditioners fought a mighty and futile battle with Atlanta’s wilting heat.
Ms. Gigliotti sat before a monitor, headphones on, glued to a scene being shot in an adjacent room. Kirsten Dunst, who plays a NASA supervisor, was fixing Ms. Henson with an acid stare. “They’ve never had a colored in here before Katherine,” she said coolly, “Don’t embarrass me.”
Ms. Henson blanched, turned and was about to walk through a nearby door when her handbag got stuck on the doorknob. Mr. Melfi called cut.
“Did I steal that or what?” Ms. Henson asked sarcastically, throwing an expletive in.
The role of Ms. Johnson is a meaty one, as well as a departure, for Ms. Henson, who is coming off the most dazzling year of her career. In January, she collected a Golden Globe for her portrayal of Cookie, the brazen, razor-tongued matriarch on Fox’s nighttime soap “Empire.”
As grateful as Ms. Henson is for pop culture’s adulation of Cookie, she’s somewhat weary of being constantly associated with her. (Mr. Melfi has wanted to work with her since her Oscar-nominated turn in “The Curious Case of Benjamin Button” in 2008.)