Sorry, I do not have any ideas about the math required to draw those lines.
You need to get the algorithm/math for drawing those lines. Once you have that, then you can work on writing the code to...