Imagine when Derrick Williams figures out the triangle.

“I’m still messing up a lot of the plays — just playing off instinct,’’ Williams said. “Teammates are finding me in open spots and [I’m] knocking down shots. I pretty much know, honestly, half the offense. I’m still making a lot of mistakes. I have to watch a lot of film, have to learn from that. I’m a big film guy.’’

Williams, viewed as a big draft bust since being selected No. 2 in 2011, was regarded as Knicks president Phil Jackson’s most irresponsible offseason signing at two years, $9.5 million. All the enigmatic forward has done is become the Knicks’ leading scorer the past two exhibitions — dropping 23 points Friday in Washington and 21 against the 76ers on Monday. Sure, he’s committed nine turnovers in the process, including six against Philly, but the triangle wasn’t learned in a day.

In contrast, shooting guard Arron Afflalo was hailed as the Knicks’ most economical free-agent signing at two years, $16 million. Afflalo has yet to make his Knicks debut because of a hamstring strain, and he is expected miss his fourth straight preseason game Friday against the Celtics.

The 6-foot-8 Williams, sporting a set of braids this fall, is the Knicks’ most athletic player, scoring in transition, on dunks and from 3-point range. Jackson said last month Williams was a good fit with Carmelo Anthony, interchangeable players at the 3 and 4. The bigger revelation is Williams can be the sixth man spark plug when Anthony gets a breather.

“I’m trying to be dynamic, man, and be all over the court,’’ said Williams, who has shot 15-of-23 in the last two contests. “That’s what Coach wants me to do. I take on the challenge of playing two, three spots and want to learn them and show how versatile I am. It’s really showing the first couple of games.’’

At the age of 24, the Arizona product finally feels he’s being used in a more prominent offensive role and likes the triangle’s “equal opportunity’’ nature.

“That’s something we did lack on the team,’’ Williams said of his high-flying traits. “I can bring that: running in transition, running on the wing, pick and pops, everywhere on the court. That’s why I got drafted, not being stuck in the corner.’’

Williams spent two mediocre seasons in Minnesota before traded to Sacramento at the start of his third season in November 2013. He credits Kings coach George Karl for helping him improve over last season’s final 30 games. But Karl was fine letting Williams flee.

Williams relished first-time free agency, but he never heard from Sacramento on July 1.

“Nope. I didn’t really care,’’ Williams said. “I knew where I wanted to go.’’

Williams said he coveted being part of “a rebuilding process’’ and the Knicks franchise’s “prestige.’’

“When I got drafted, they picked me, I didn’t pick them,’’ Williams said. “I chose to be here. Phil wanted me here. Derek Fisher wanted me here. As soon as I was done with the meeting, I called my agent 10 minutes after and said: ‘I’m signing up.’ ’’

Turnovers and inconsistent defense could linger as issues once the regular season commences Oct. 28 in Milwaukee. In July, a source close to Karl lamented Williams’ low basketball IQ and expressed concern he could master Jackson’s convoluted scheme.

But Anthony saw signs of this Williams explosion when they scrimmaged informally in September and the LA product arrived in superb shape.

“I don’t think I’m surprised,’’ Anthony said. “You guys don’t see what we’ve seen throughout training camp, practice. It’s paying off. He came into camp in great condition and shape. Coming here really challenged him to see how good a shape he can get in.’’

Fisher loves Williams’ ability to play multiple positions and believes if nurtured, Williams will soar at the Garden like never before.

“We believe if we can make him feel comfortable here and that he’s valued not just as a basketball player but as a man and that we’re behind him 100 percent, we can create a program around him that will help him be at his best,’’ Fisher said.