Write a formula/algorithm

Job ID: 32625996

Budget: $30 – $250 SGD

I need a formula / algorithm to find the center coordinates and radius of a circular arc connecting two lines at tangent point. The deliverable shall be tested and proven using Excel spreadsheet. See attached drawing, P1, P2, P3 and P4 are given. Need to find P5 and radius R.
Related categories: Excel Algorithm Mathematics