Here's a little demo project to show how you can solve a two bone chain inverse kinematics by solving for the length of the opposite side.
Here's the p5Js sketch: https://editor.p5js.org/admiralra/sketches/JfMvxIyTs