Seven of the city’s top science and math teachers, including three from Queens, know the formula for success in the classroom.

They accepted Sloan Awards for Excellence in Teaching Science and Mathematics this week for using creative methods to inspire students to make the grade and pursue careers in their field.

For Thomas Sangiorgi, a Regents chemistry teacher at Townsend Harris High School, this means being a human target.

The 46-year-old educator lets his students throw plastic foam balls at him in order to demonstrate the collision theory. The only way to score a point is to hit him in the head with one.

“You need the right amount of energy and the right amount of aim,” said Sangiorgi, a teacher of 19 years. “The students love the idea of throwing a ball at a teacher.”

The imaginative demonstration is one of many that have made Sangiorgi a living legend at the Flushing school, Sloan officials said.

Other lessons include shooting balled up socks in the air through a makeshift acetylene cannon to show an organic chemistry reaction.

“The louder it is, the more applause I get. It’s pretty nifty,” he said. “And at that point, I’ve got their attention. They want to know what they just saw.”

Yunseon Esther Kim of Francis Lewis High School and Dorina Cheregi of Newcomers High School were also awarded this year.

Kim, an integrated algebra teacher, was lauded for her eight years of “patience, perseverance and gift for lucid mathematical explanation,” according to Sloan officials.

“Ms. Kim is someone who puts in every ounce of her being toward helping kids,” said Francis Lewis

High School Principal David Marmor. “She stays late. She tutors on her free time. She’s a fantastic math teacher. She’s had phenomenal success.”

Kim has also helped two-thirds of her second-year algebra students pass their Regents exams after they failed their first year, Marmor and Sloan officials said.

Cheregi, a Romanian immigrant, has dedicated more than 17 years to teaching basic and advanced math to new immigrant teens. She is credited for her honors students’ 92 percent pass rate on the AP Calculus test, according to award officials.

“To have that role model in the school is really wonderful,” said Newcomers Principal Orlando Sarmiento. “It gives the kids a very concrete example of excellence and how to use education to be successful in the United States.”

The seven winners in the city, chosen by a panel of distinguished science and math educators, are being honored in a ceremony Wednesday by the Alfred P. Sloan Foundation, a philanthropic nonprofit organization, and Fund for the City of New York.

Each teacher received $5,000 and another $2,500 for their school’s science and math programs. This is the program’s fifth year.

Other winners were Charlene Chan of the Manhattan Center for Science and Mathematics, Eloise Thompson of DeWitt Clinton High School, Elisabeth Jaffe of Baruch College Campus High School and Eleanor Terry of the High School of Telecommunication Arts and Technology.