/**
 * Get line middle point by percentage 0.1 === 10%
 * @param {*} p1 from
 * @param {*} p2 to
 * @return {Function} (percentage) => Mid point [x, y]
 */
const getLineMidPoint = (p1, p2) => (per) =>
  [p1[0] + (p2[0] - p1[0]) * per, p1[1] + (p2[1] - p1[1]) * per];

export default getLineMidPoint;

@@ -201,16 +201,21 @@
 %0A  %5B
+%0A    
 p1%5B0%5D + 
 (p2%5B
@@ -206,24 +206,25 @@
     p1%5B0%5D + 
+(
 (p2%5B0%5D - p1%5B
@@ -232,17 +232,22 @@
 %5D) * per
-,
+),%0A   
  p1%5B1%5D +
@@ -247,16 +247,17 @@
 p1%5B1%5D + 
+(
 (p2%5B1%5D -
@@ -269,16 +269,20 @@
 %5D) * per
+)%0A  
 %5D;%0A%0Aexpo

Improve getLineMidPoint readability