Offset between two points

Feb 2020
1
0
Peru
Hello, I need some help at understanding the math behind a function that offsets a polyline between two points. The function first asks for the first point with an offset distance, then it asks for the second point with an offset distance as well.
In the image below, I drew a polyline, then I used the function mentioned above. I selected the first point with an offset distance of 0 , then I selected the second point with an offset distance of 20 meters, so I can get the offset line.
Please, help me out to understand the math behind how to find out the value of x.
 

Attachments