Just before takeoff, Air Force and Navy fliers chosen to bomb Libya Monday punched cockpit keyboards to tell their planes' computers the latitudes and longitudes of the flights' starting points. Otherwise, the pilots might miss their targets and become lost returning home.

The F111 fliers at two bases in Britain faced an exhausting, 14-hour flight of 2,700 miles each way. Their legs might go numb from sitting in one position that long. They would wiggle their hips, sit on one side of the hard seat and then the other to keep the blood moving while they flew.

Still, some would be so stiff that they would have to be lifted out of their cockpits after landing.

During the long run to Libya and back, the F111s could be put on automatic pilot. But their human pilots would have to stay alert to maneuver the swing-wing bombers to an exact place in the sky several times to meet a hose nozzle suspended from a flying gasoline station, an Air Force tanker.

Their Navy A6 counterparts had been taken so closely to Libya on aircraft carriers that the pilots would not have to "plug," or refuel, several times like the F111 fliers. After the bombing runs, however, the Navy pilots would have to find their aircraft carrier in the dark, never an easy task, then land on its matchbox deck while plunging from the sky at 150 mph.

Air Force tankers took off first, forming a string of refueling stations along the circuitous F111 route over the Atlantic and Mediterranean. The Air Force and Navy bombers were under orders to time takeoffs and flights so they would be above Libya simultaneously and could race in and away before the Libyan air force or antiaircraft gunners could respond.

Before takeoff, crews of both types of bombers had studied maps and pictures of targets around Tripoli and Benghazi. They marked check points along the route in hopes of flying a precise course, although the computerized wizardry of their planes' "black boxes" would do most of the navigating and bombing.

The heart of the A6 "smart" bombing system is in its big nose and a white basketball-like device hanging under it. The nose houses radar that can see a target more than 100 miles away. The heat-seeking and laser gear in the basketball does not come into play until the A6 is about 25 miles from the target.

F111 and A6 radar see such big objects as buildings clearly in the dark and sketch their profiles on cockpit scopes. The radar cannot produce clear images of small targets, such as antiaircraft guns and fighter planes on the ground.

If everything is working, the computerized bombing systems in each type of plane can hit a building with a single bomb but not destroy those near it. Defense Secretary Caspar W. Weinberger said this is one reason that large buildings were chosen as targets in Libya, reducing the risk of "collateral damage."

The F111 and A6 air crews were trained to follow elaborate procedures before dropping the so-called "smart" bombs.

Those methods required the A6 bombardier, for example, to match the radar profile of his target displayed from 100 miles away with one he had studied before takeoff. As the bomber, thundering at almost 500 mph, moved within 25 miles of the target shown on his radar scope, the A6 bombardier would start "mixing paint."

This consists of activating the basketball's heat-receiving gear, which displays heat from the targeted building as a black-and-white profile on a separate cockpit screen.

The bombardier would maneuver buttons and knobs to fine-tune the radar and heat sensor, the latter called forward-looking infrared (FLIR). If the two sets of images matched those programmed into the computer as the target, the pilot and bombardier would shoot a laser beam from the basketball when the plane came within about fives miles of the building. The building was now "painted."

With luck, the heat image would be so distinct that the bombardier could focus in his scope's cross hairs a chosen window of the building. If the cross hairs slipped off the window as the plane maneuvered, he could move them back into position by jiggling a "joy stick" with his left hand.

With the building "designated" by the laser beam, the pilot would punch buttons instructing the computer to take command of the bomb drop.

After the pilot and bombardier confirmed the target, the computer, calculating the plane's speed and drift, would release bombs at the precise moment required for a direct hit.

A seeking device in the nose of a 500-pound, 1,000-pound or 2,000-pound bomb would find the laser beam and ride it through the building window before the bomb exploded.

If, in reading his radar and FLIR scopes, the bombardier mistook an embassy or a house for his target, the "smart" bomb would do what it was told and destroy the wrong target, causing collateral damage that President Reagan said the attackers sought to avoid.

Bombs struck buildings in Libya not on the target list, including the French Embassy, but whether the "smart" bombs went awry or these buildings were damaged by stray Libyan fire remains at issue.