In addition, please see below the brief explanation of the problem for the program that I made:
1. Variable ys1 is a function of x1, y1, and ys2 while ys2 is a function of x2, y2 and ys12. 2.Values of x1 and y1 are already known and ys2(at k=0) is first assumed.
3. With the values of x1, y1 and assumed ys2, ys1 (at k=1) is obtained (quadratic formula on while loop).
4. Same goes for ys2. Values of x2 and y2 are known and ys1(at k=0) is first assumed.
5. Values of x2 and y2 are already known and ys2(at k=0) is first assumed.
6. With the values of x2, y2 and assumed ys1, ys2 (at k=1) is obtained (quadratic formula on while loop).
7. The assumed values of ys1 & ys2 is compared with the calculated values obtained in #3 and #6. If the difference is greater than the tolerance, then the step is repeated using the previously calculated values of ys1 & ys2 (at k=1).
8. Once the final ys1 & ys2 are obtained, y1,y2,x1 & x2 is calculated (for i+1, j+1) and steps #1 to #7 is repeated again.