Bone rotation with Python


I want to rotate a bone with a python script when i only know the following coordinates:

(X1,Y1,Z1) of the bone’s root
(X2,Y2,Z2) of the bone’s tail
(X3,Y3,Z3) the new location of the bone’s tail

So far i can rotate a bone either with bpy.ops.transform.rotate or with rotation_euler, but the both methods expect rotation angles.