This is a simple version of a Sutherland Hodgeman algorithm implemented into scratch (very useful). I made all the code, with the exception of the triangle filler (@Rex) enjoy.