From left, Taraji P. Henson), Octavia Spencer, and Janelle Monáe in Hidden Figures (Hopper Stone/Twentieth Century Fox)

When we first meet the main protagonists, they are stranded by the road in 1960s Hampton, Virginia, due to mechanical problems with their car. A police officer pulls up. Segregation is still the law of the land here, and the three black women—Katherine Goble (later Johnson), played by Taraji P. Henson, Mary Jackson (Janelle Monáe), and Dorothy Vaughan (Octavia Spencer)—are nervous about how the white police officer will treat them, and, indeed, their initial interactions hint at possible abuses of power to come.

But then the cop learns that all three work as mathematicians for NASA at a time when the United States and the Soviet Union are locked in a battle for domination of space. He expresses concern about what will happen if the Soviets win. After Dorothy fixes the car, the policeman insists on providing them with a personal escort, at high speed and sirens blaring, so they can get to the base on time.

It’s a remarkable sequence that establishes the women’s traits: Dorothy is practical; Mary is fiery and temperamental, nearly getting them into trouble by running her mouth; and Katherine is the dreamer. But it also suggests that the racial divide of that time was not absolutely insurmountable. All it took was a threat serious enough to motivate everyone, regardless of skin color and gender, to start looking past differences.

Based on real-life trailblazing women, the three work as “computers,” the term for NASA’s flesh-and-blood female mathematicians. However, despite their considerable abilities, they meet resistance as a result of institutionalized racism. Mary, who assists on the Project Mercury capsule’s heat shield, entertains ambitions of becoming an engineer herself. But that would require night classes at a segregated high school. Similarly, Dorothy is consistently passed over for a supervisor’s title, even though she manages the African Americans and essentially does the same job as the white women’s supervisor (Kirsten Dunst).

As for Katherine, she lands a role assisting the flight research team, thanks to her knowledge of analytical geometry. On her very first day, she serves herself from the communal coffee pot. By the second, there is a separate pot labeled “colored,” which no one bothers to either fill or plug in.

Allison Schroeder and director Theodore Melfi’s screenplay uses the Soviet menace to argue against denying the three women of their successes. After all, each one’s work could help tip the Cold War in the United States’ favor, and, as such, racism arguably puts the very future of the American way in jeopardy. The discrimination they face may not be as visceral as in a film such as Selma, but it is nevertheless omnipresent and demoralizing. In a development that makes Katherine especially sympathetic, she must walk half a mile every time she needs to relieve herself, as there are no “colored” restrooms in the flight researchers’ building. Her lengthy disappearances culminate with a haranguing by her boss, Al Harrison (Kevin Costner), who is oblivious to her predicament.

By and large, white people seem to have nothing personal against the women but are simply upholding the separation that has long been in place. Yet the film argues that even if they are not actively perpetrating racism, their obliviousness can be just as harmful. Despite the previously mentioned incidents, however, the film is not at all soul crushing, lightened throughout by scenes of the women’s personal lives: motherhood, attending church, socializing with each other outside of office hours.

Hidden Figures’ greatest asset is its marquee actresses, especially Henson and Spencer. As Johnson, considered a pioneer in the fields of computing and space science, Henson plays someone decidedly more reserved than her best-known roles (including Loretha “Cookie” Lyon in Empire). Yet she does get to cut loose with a furiously righteous speech. Meanwhile, Spencer’s character knows when to resort to courtesy versus saying exactly what’s on her mind, leading to delightfully humorous moments.

Other effective casting additions include Moonlight’s Mahershala Ali as a love interest for Katherine and Glen Powell as the late astronaut John Glenn, whose core of decency leads to our rooting for him in the face of plainly dangerous flight scenarios. (For those interested, the recent documentary Fight for Space also touches on this important chapter in the history of NASA.)

Ironically, the release of Hidden Figures takes place just before the ushering in of a presidential regime with a less-than-progressive reputation toward minorities. But as uncertain as things may look right now, this mainstream film reminds us of how far America has come since the days of legal segregation, and of our capacity to overcome what divides us. If for no other reason than that, it’s the triumphant historical crowd-pleaser we need right now.

Directed by Theodore Melfi
Written by Allison Schroeder and Melfi, based on Margot Lee Shetterly’s nonfiction book
Released by Twentieth Century Fox
USA. 127 min. Rated PG
With Taraji P. Henson, Octavia Spencer,Janelle Monáe, Kevin Costner, and Kirsten Dunst