Calculate height from two right angled triangles sharing an edge

448 Views Asked by At

I am trying to calculate the perpendicular distance of a unicycle-like robot from a wall using two successive measurements from an ultrasonic sensor. The problem is modelled as shown:

(EDIT). The Robot is currently at position $A$. First it measures $AD$ then it moves a negligible distance(So that remains it at $A$) and measures $AC$. enter image description here

I want to calculate the length of $AB$ (perpendicular distance from the wall $BC$) knowing the lengths $AD$ and $AC$ (Which I can easily get from the sonar sensor). Also the angle ABC is $90$ degrees . Thanks