Brancazio explains that you need 45 degrees plus half the angle formed by a straight line between the position of the ball at launch and the basket. Depending on your height and where you are on the court, that typically ranges from 7 to 14 degrees. Thus, for a shot leaving your hands at eight feet above the floor from 18 feet out, you'll want to launch the ball at a bit more than 48 degrees. For most players at a distance of 10 to 25 feet, the least-effort angle ranges between 47 and 52 degrees.This sounds nerdy and trivial, but there are some interesting points in the article, including the importance of backspin on a successful basketball shot.
Using that system, you can calculate the ideal free-throw angle. It's 13.75 feet from the free-throw line to the center of the basket, and a 6-foot player launches the ball from about seven feet above the hardwood. That works out to a shooting angle of 51 degrees.
More at the Washington Post, via Kottke.