The late-day sun shone brilliantly as giddy joggers, walkers and bicycle riders jammed their bodies into city parks. It was a Tuesday evening, and even the most cynical New York City dweller couldn’t help but be infected with a sense of springtime optimism, as urban oases transformed into veritable all-you-can-eat buffets.

And at the precise moment that New Yorkers forgot to watch their backs, evil struck.

At about 7:30 p.m. on May 17, a ­42-year-old woman cutting through Gorman Park in Washington Heights in Manhattan on her way home was grabbed from behind by a man holding a knife to her neck, police say.

The assailant forced the victim off a concrete path, pushed her to the ground behind a set of stairs in a secluded area, removed her pants and raped her.

Police, who distributed a sketch of the suspect after the woman reported the brutality in June, are at a loss.

But she was lucky. She survived.

This monstrous crime failed to prompt the kind of headlines — or citywide trauma — elicited after 30-year-old Karina Vetrano was sexually assaulted, police believe, and strangled on Aug. 2 by an unknown predator as she took her evening jog, alone, in a nature preserve near her home in Howard Beach, Queens.

Her battered body, found lying face-down in the tall grass and brush by her retired firefighter father, was testament to the valiant, but unsuccessful, fight she waged for her life, cops theorize.

But the earlier sexual outrage at Gorman Park should have served as a warning: Danger lurks amid the grass.

Further advancing the emerging narrative that no one, in any green space, is safe, particularly those of the fairer sex, is the also unsolved slaying Sunday of New York City Google marketing account manager Vanessa Marcotte, 27, as she took an afternoon jog on a wooded country road near her mother’s home in Princeton, Mass. Police found her body stripped naked with burns to her head, feet and hands, said a source.

Adding to the horror, authorities in New York and Massachusetts told The Post Wednesday that they haven’t ruled out a connection between the two cases of pretty brunettes who met awful ends.

“Until, like, five minutes ago, I used to go running four times a week in Prospect Park,” a 30-something woman I know from Brooklyn told me.

“Now I’d rather dodge cabs,’’ she said. “It’s safer.”

We’ve been living under the false impression that parks and woodlands, beloved by fitness buffs and folks who just want to kick back and smell the flowers, are safe havens. They’re not. In the absence of beefed-up police patrols, I’d advise parkgoers to learn self-defense, always travel with one or more buddies — or take recreation to city streets.

Officials from the administration of Mayor de Blasio are “trying to seriously downplay the numbers of [park crime] victims, which is an insult to people who were raped, murdered, robbed or assaulted’’ during a recent nine-month period, Geoffrey Croft, founder and president of NYC Park Advocates, a watchdog group, told me.

While crime around the city has plunged to near-historic lows, violent felonies — rape, murder, assault and robbery — committed in more than 1,100 parks (excluding Central Park, which has its own police precinct) have jumped by a staggering 23 percent from the beginning of July 2015 through March 2016, compared with the same period a year earlier, according to a new study called “A Walk in the Park.”

In it, NYC Park Advocates personnel analyzed data supplied by the city Police Department and determined that there were 417 major crimes — or more than one a day — in that time frame, up from 340 the previous year.

Fourteen rapes were reported, compared with 10 a year earlier. The number of murders tripled — from two to six.

It seems that those with bad intent are winning the turf war.

One afternoon this week, I saw just a scattering of female joggers, mostly in pairs, in Prospect Park — the fifth-most crime-ridden park in the city. (Flushing Meadows-Corona Park in Queens holds the No. 1 spot.)

One woman stopped just long enough to tell me, defiantly: “I have to keep coming back. They can’t have this park!”

She’s right. Mayor de Blasio, incoming Police Commissioner James O’Neill, City Council members — make fighting this crime wave a priority. Do something!

Hill’s photo oops

An enthusiastic campaign supporter sitting behind Hillary Clinton at a Florida rally this week, mugging for the TV cameras, was none other than Seddique Mateen.

He was the father of Omar Mateen, who carried out the worst mass shooting in American history at an Orlando gay nightclub in June, before being gunned down by cops.

Oops.

Clinton, who talked about the massacre, was unaware that Mateen, who wasn’t an uninvited guest, was even there, insisted a red-faced campaign official.

Talk about optics. This is sheer incompetence.

Skipping moment of booth

“Longtime @nypost readers will understand why it’s a big deal that Trump has lost @AndreaPeyser,’’ read a tweet sent out by Democratic strategist and former top Hillary Clinton aide Howard Wolfson. The Washington Post and other media outlets devoted stories to . . . me.

“I can no longer justify calling myself a Trumpkin. I’m done with The Donald,” I declared in my column published Monday.

Some readers sent me e-mails filled with angry expressions of betrayal, or begged me to reconsider. Others reported being as fed up as I am with the Republican presidential candidate’s recent unglued rantings — and this was before he made an apparent joke about “Second Amendment people’’ turning against Clinton if she’s elected president, which critics took as a threat. (He later said he meant gun-rights-types should get out and vote against her.)

A corrupt woman? Or an unserious dude?

No third-party candidates or write-in for me. For the first time in my adult life, I’m tempted to sit out a major election.

An ugly look at city’s ‘privates’

Out of New York City’s unbearably pretentious private institutions, St. Ann’s School takes the cake with a silver spoon. The arts-heavy school in Brooklyn Heights doesn’t even award grades to its preschool-through-grade-12 students.

Matt Damon tried to get three daughters into St. Ann’s this fall as his family moves back to the city from Los Angeles, but he missed the deadline. He was rejected, The Post’s Page Six reported. No celebrity exceptions!

Somehow, I think the actor/producer/screenwriter will find another snooty place to take his money. The Damon girls can’t face the indignity of attending public school.