@dhruv_er sorry for the delay in my answer, got caught up in other things.
Maybe with a little re-thinking it is not a trigonometry question, provided I have the correct understanding of your requirements @dhruv_er…
Taking a slightly different approach.
Let O and A be fixed points in space. Let P be any point such that the distance from O to P ≤ r for r a positive number. Extend a line from O through P to a point B such that |OB| = r. Find B.
Draw the lines OA and AB. In Babylon.js use cylinders for lines.