Yep. I did it from scratch. It involves some trigonometry but I got the hang of it. I got a tutorial: