getting bone base and tip positions from a transform matrix?
===

I need this for a Blender3d script, but you don't really need to know Blender to answer this.

I need to get bone head and tip positions from a transform matrix read from a file.
The position of base is the location part of the matrix, length of the bone (distance from base to tip) is the scale, position of the tip is calculated from the scale (distance from bone base) and rotation part of the matrix.

So how to calculate these?

    bone.base([x,y,z]) # x,y,z - floats
    bone.tip([x,y,z])