# How can I get the normal orientation of an edge

I need to get the Normal orientation of an edge and apply it to a new object:

obj = bpy.data.objects['Edge']
mat = obj.matrix_world
# Decompose object in location, rotation, scale
loc_obj, rot_obj, scl_obj = mat.decompose()


The method above give me the Global orientation:

Is it possible to get a matrix containing the Normal orientation in the rot_obj component?

Thanks

• The desired normal orientation is not unique. In your last picture any orientation with same y(the green one) can be a valid solution. Can you provide more constraints? – TheBusyTypist Jul 20 '15 at 9:51