A graphical approach to algebra and trigonometry