Middle line between points How can we calculate LINE that most fit the points T1(1,0)  T2(2,0)  T3(-1,1) T4(0,1) 

$x= (1,2,-1,0)  $
$y= (0, 0, 1, 1)  $ 
$1= (1, 1, 1, 1)$

a)LINE that most fit the points $T1(1,0) \mspace{10mu}  T2(2,0) \mspace{10mu}  T3(-1,1) \mspace{10mu} T4(0,1) $
$x = (1 , 2 , -1 , 0)   $
$y = (0 , 0 , 1 , 1)  $ 
$1 = (1 , 1 , 1 , 1)$
Solving this: you got sistem of 2 equations:
$a < x, x> + b < 1, x> = < y, x> $
$a< x, 1> + b < 1, 1> = < y, 1>$

$< x, x>= x_1*x_1 + x_2*x_2 + x_3*x_3 + x_4*x_4 = 1*1 + 2*2 + (-1)*(-1) + 0*0 = 6 $  
$< 1, x> = < x, 1>= 1*x_1 + 1*x_2 + 1*x_3 + 1*x_4 = 1*1 + 1*2 + 1*(-1) + 1*0 = 2$
$< x, 1>= x_1*1 + x_2*1 + x_3*1 + x_4*1 = 1*1 + 2*1 + (-1)*1 + 0*1 = 2    $  
$< y, x>= x_1*y_1 + x_2*y_2 + x_3*y_3 + x_4*y_4 = 1*0 + 2*0 + (-1)*1 + 0*1= -1$
$< 1, 1> = 1 + 1 + 1 + 1 = 4  $
$< y, 1> =  y_1*1 + y_2*1 + y_3*1 + y_4*1 = 0*1 + 0*1 + 1*1 + 1*1 = 2$

Then you insert these results in upper equation:  
$6a  + 2b  = -1  $
$2a  + 4b  = 2$
$ a=\frac{-2}{5} and  \mspace{10mu}
b=\frac{7}{10} $ 
Linear equation is:
$ \textbf{y = a x +  b }$
Answer is:$ \mspace{10mu} \mathbf{y = \frac{-2}{5} + \frac{7}{10} }$
