The blue and red lengths are always the same as the hypothenuse length of the triangle. That can be scaled uniformly using the scale block in scratch. the green leg is the base of the triangle. That's where the tri gets split into two right triangles for rendering. The green leg is the longest leg of the tri, and that pretty much guarantees that's the leg that should be split. The green leg's angle is used to rotate the sprite and align both triangles, requiring only one calculation. The red and blue angle in relation to the green angle is used to set the costume for each side