How does trigonometry work?
Try looking at this introduction.
https://www.mathsisfun.com/algebra/trigonometry.html