You need to provide relation between x,y coordinates to tell EJS or any program to draw it.
You can treat the lsft image as segment of three different lines.
A line can be represented by y=m*x +b
Try to find out those three equations for three drifferent segments.