In pursuit of fleet-footed prey, the northern goshawk wings through thick forest canopies and underbrush at breakneck speeds, dipping and diving to avoid colliding with trees or other obstacles. But it can only go so fast, apparently obeying an unspoken speed limit dictated not by biology, but by the density of its environment — beyond a certain threshold, it is certain to crash into something. This is an important lesson for makers of drones and other flying objects, according to researchers at MIT and Harvard.

Most drones fly relatively slowly, especially at lower altitudes where they might encounter obstacles and require plenty of time to react. Biologists at Harvard and roboticists at MIT have been studying flight behaviors in goshawks and other birds, aiming to improve algorithms that would allow unmanned aerial vehicles to cruise more quickly through forests, urban areas or other cluttered landscapes.

Goshawks don’t necessarily see everything ahead on their path, so they must judge the density of the forest and assume they’ll find an opening. In an interview with MIT News, aeronautics professor Emilio Frazzoli aptly compares it to backcountry skiing. You don’t always know where the next tree stands, but you cruise downhill anyway and assume you’ll be able to navigate around it when the time comes. Beyond a certain speed, though, you might not have time to stop or turn before hitting the as-yet-unknown tree. So (if you’re smart) you obey an innate, self-imposed, environment-dictated speed limit. Programming this into a robot is difficult, however.

Frazzoli and some grad students devised a differential equation expressing all the possible positions of a bird at a given location at a given speed. Then they developed a model of a forest, using statistical distribution models used by ecologists. Then the team calculated the probability that a bird would hit a tree while flying at a certain speed. They figured out that for any given density of trees (or other obstacles of choice), there exists a speed above which there is no “infinite collision-free trajectory,” as MIT News explains. The bird will surely crash, because there’s no way for it to avoid the obstacles. But below that threshold, things should be fine.

“If I fly slower than that critical speed, then there is a fair possibility that I will actually be able to fly forever, always avoiding the trees,” Frazzoli said.

This theoretical speed limit equation could be extrapolated to any obstacle-filled environment — an actual forest, a city with tall buildings, and so on. So a drone could fly forever unimpeded, so long as a drone obeys its own speed limit.