Some mathematical help

You can elongate the segments by “dividing” it with a t value bigger than 1, like 1.1 or 1.2. Then you check for extreme points …