Trying to manage vector and Euler angle

Hi

For a plugin I’m working on, I need to align component along an edge using the red axes component.

Here I’am, I have the edge as a vector

edge_vector = edge.end.position - edge.start.position

I’Am able to get axes projections

projection_on_red_axis = edge_vector.dot(X_AXIS)
projection_on_green_axis = edge_vector.dot(Y_AXIS)
projection_on_blue_axis = edge_vector.dot(Z_AXIS)

But I’m not able to math it to the right angle an align component would have.

I already tried many many method to do it but no one match.

I do want to understand it cause it is the second time I have to deal with euler angle and it’s a pain for me.

If someone can help

Thank’s a lot

If you had searched the Ruby API subcategory on “euler”, you would have found this:

Thank’s Dan

In fact it’s been few days I’m searching, I found many people talking about it and
I already found this but it’s not so clear for me and I don’t know how to use it.

I read the exemple but I’m still note able to mange it.

But thanks to you I’m back on the track.