Source: https://jts.design/documents/ScratchProgrammingGuide.pdf