At first you can move around with the mouse button pressed. If you like the position, you do not have to press the mouse button again. Then repeat the process, but this time the Y-position remains the same as the first time, because after all you want to create a right-angled triangle. The third and last time, the X position remains the same as the first time. At the end, when your right-angled triangle has been created, you can read from the variables the rounded lengths (in pixels) of the individual coloured lines and the rounded area of the triangle. Have fun!
Based on the Pythagorean theorem.