Two years ago, Star Technologies Inc., a maker of high-speed scientific computer equipment based in Sterling, hovered at the edge of a black hole.

Its main product was an affordable alternative to a supercomputer known as an array processor, a high-speed data cruncher that plugs directly into a customer's existing mainframe or minicomputer to process data, images or signals. Its main customers were oil companies, which used computers outfitted with array processors to locate new production fields by analyzing seismic data. Star was gaining in sales daily, even though it hadn't yet turned a profit.

Then the bottom fell out of the oil industry, and Star suffered along with it. Fiscal 1986 brought losses for Star of $20 million on revenue of just $15 million.

But Star has ascended back to a visible place in the firmament of local high-technology companies in just as dramatic a fashion. In fiscal 1987, which ended last March 31, the seven-year-old company posted a profit of $1.3 million on revenue of $44 million. For the first nine months of fiscal 1988, Star earned $1.9 million on revenue of $27.3 million.

"It's been a nice recovery," said Robert Compton, the company's chief financial officer.

Analysts say Star's recovery is the result of a corporate restructuring, hard work and expanding high-tech vistas. And last week, the company made an expansion move by agreeing to acquire Graphicon, a three-dimensional graphics products business based in the Research Triangle area of North Carolina, from General Electric Co., Star's largest customer.

"I respect Star," said Jay Willoughby, president of Hudson Capital Management Inc., a Portland money management firm that follows the company. "Two years ago, Star was in a lot of trouble, and the way they got themselves out of the soup was by putting their nose to the grindstone."

The key, Willoughby said, was that Star shifted its emphasis from the lagging oil industry to a business that the company had originally seen as a secondary market for their products: medical imaging.

Two years ago, Star began selling array processors to General Electric for use in generating images in GE's computerized axial tomography (CAT) scanners, which provide doctors with detailed X-rays of internal organs and skeletal structures. GE eventually signed a five-year, $100 million contract with Star and became an investor in the company, pumping about $6 million into the firm and buying 2 percent of its shares.

Star also made a significant management change, getting board member Robert C. Mathis, a former Air Force general and founder of a Montana-based laser business, to take over as president and chief executive last spring.

"I thought it was a pretty risky arrangement," Mathis said. "It really looked like we had some great challenges out there, and we were just recovering."

The company refinanced its debt and halved its staff to 165 employees. Today it has built back up to 200 employees, according to Compton.

In addition to medical imaging, the company has begun marketing its technology to new markets.

Defense and aerospace companies, scientists and engineers have begun to buy Star's products for a variety of applications, including providing a view of the earth through digital signals and molecular modeling on a computer screen.

Now 60 percent of Star's business is in medical imaging, well over a quarter is aerospace and defense work and the rest is in seismic and molecular modeling applications. "This business going from seismic to the medical imaging was a natural progression," said Mathis, who hopes to corner more of the $200 million-a-year market for array processors.

The acquisition of Graphicon will help the company further broaden its base. Graphicon's products will give Star is the ability to visually display the data that is produced by the array processor. For example, Star can use the Graphicon technology to provide military officers a way to turn a radar sweep of a battlefield into "very, very high quality pictures of the battlefield," Compton said.

"There are areas where we hope to marry this technology with three-dimensional graphics," Mathis said. "It's the direction we've chosen to move in ... and we think it's a very good strategic move for us."

GE officials say they sold Graphicon, a company with high growth potential, only because it did not fit in with the huge industrial conglomerate's overall strategy. But James Scott, manager of the Graphicon products business for GE said, "We are excited about Star. ... We think they are the leader in high-speed scientific computers, and we feel there is an excellent match and synergism between our Graphicon products and their processors."