Nasa mission specialist Karl Zielinski (Olek Krupa) and 'computer' Mary Jackson (Janelle Monáe) in Hidden Figures.
Washington - One of the most gratifying qualities of Hidden Figures is how it bursts onto the screen like a shot of distilled, exhilarating joy.

This bracing movie, about a group of brilliant African-American women whose scientific and mathematical skills helped Nasa launch its space exploration programme in the 1950s and 60s, gets off to a spirited start, sharing with viewers a little-known chapter of history as inspiring as it is intriguing.

After a brief prologue, when we meet Katherine Johnson as a teenage maths prodigy, the film catches up with her in 1961, when she’s a young widow working at Nasa’s Langley facility in Virginia, as a “computer”, sharing a ride to work with her colleagues Dorothy Vaughan and Mary Jackson.

The fact that these gifted women are played by the equally gifted Taraji P Henson, Octavia Spencer and Janelle Monáe, respectively, says all you need to know about a movie propelled by their salty and affecting performances. Far from a dry scientific tutorial or historical treatise, Hidden Figures is a warm, lively, often funny depiction of women whose brains and work ethics were indefatigable, even in the face of racism and sexism.

Adapted by Theodore Melfi and Allison Schroeder from Margot Lee Shetterly’s book and directed by Melfi, Hidden Figures takes place at the height of the space race in the early 1960s, when the Soviets are winning the competition to get a manned mission into orbit, and when the pressure is on to get astronaut John Glenn (Glen Powell) and his colleagues in the Mercury programme into their own supercharged tin cans. Although Nasa is strictly segregated, Katherine is the most gifted computer on the site.

She’s sent to work with Al Harrison (Kevin Costner), who’s annoyed when she disappears frequently throughout the day but is impressed by her impeccable results.

It turns out she’s running a mile-and-a-half to use the “coloured only” bathroom, a sequence played for both laughs and wincing disbelief in Hidden Figures. Just think how much has been lost, the movie suggests, over centuries of depriving ourselves of the brains, talents and leadership of more than half our population?

Those ideas weave their way gracefully through Hidden Figures, which centres mostly on Katherine, but includes effective scenes of Dorothy teaching herself to program a new piece of technology called the IBM, and Mary pursuing her engineering degree at a local all-white high school. Some of the film’s most stirring scenes feature the hackneyed conceit of clueless white folk being enlightened by their African-American educators.

If characters played by Jim Parsons and Kirsten Dunst seem too cruel to be true, they feature in some of the film’s most bluntly effective scenes. Costner is ideally suited to play Harrison, portrayed here as a man too focused and distracted to have time for petty prejudices.

Attractively shot and designed and driven along by a catchy score by Pharrell Williams (who’s also a producer), Hidden Figures is pure pleasure. Hidden Figures is out in cinemas on Friday.