Maybe this seems so easy but I attach a picture which shows the situation.
I need to know, how can I calculate the position for triangles, so I can decide which triangle is inside of which one. I mean, how can set a position for a triangle?
Thank you in advance
The simple (but not the most efficient) solution I can think about is to define function of edges of triangles and check that they do not have intersections.
The inner triangle will be one with the smallest area.
Maybe this link will help you Intersection of Rays/Segments with Triangles.