There are probably dozens of programs which will do this; we tend to use Photoshop since it’s already part of our workflow. Here’s two methods of how we measure the driveshaft angle.
Drop a photo of your bike into Photoshop – thanks Tommy Baron for the photo:
Grab the Ruler rool – it’s in the same icon stack as the eyedropper, circled in the above photo:
Zoom in on a part of the engine that’s level with with drive shaft where it exits the rear of the motor; the fins on the sides are perfect. Click and drag a line along the fin.
Select Image -> Image Rotation -> Arbirtary:
This will level the image out so that the engine is perfectly horizontal, based on the line you drew above. Hit OK:
Now, zoom in on the swingarm and draw a line left to right:
At the top – circled in the thick red line – is the driveshaft angle. Ideally, have someone take a photo of the bike with you sitting on it so that you can get the angle it’s at when it’s under normal load – that’s what really counts.
On a stock bike with a rider on-board the driveshaft angle should be at or close to 0 degrees once the sag is taken up. Ideally you want the deflection to be max. 4.5 degrees in either direction – so 9 degrees total. Maintaining these figures will give you maximum U-joint life.
As a footnote, you can do this in Photoshop by drawing one line with the ruler tool and option+clicking (not sure what the Windows key is for that) the end of the line you have drawn and draw a second line; Photoshop will then tell you the angle you have drawn. I find this slightly more fiddly getting the horizontal angle just so – but YMMV!