Source: https://www.andrew.cmu.edu/course/48-568/PDFs/AutoCAD2D/Chapter1.pdf