part a Consider a line ax by c 0 with a and b not both 0
part a.
Consider a line ax + by + c = 0 with a and b not both 0. Now we want to find a point on this line that has
 the smallest distance to a given point (x0, y0). Formulate this problem as an optimization problem and give
 an explicit formula for the optimal value.
part b.
A polygon is a shape that is bounded by a finite number of lines. Therefore we can specify a polygon with
 n sides by a set of lines aix + biy + ci = 0, 1 <= i <= n (ai and bi not both 0). Define the center of the polygon
 as the point that has the minimum total distance to all these lines. Write down an optimization problem
 that finds the center of the polygon. (Comments: There is no explicit formula for the center, but we can
 always find it by solving an optimization problem. A lot of difficult problems in geometry can be turned
 into optimization problems and get solved using software.)
Solution
the distance of a point (x,y) on the mentioned line to the point (x0,y0) is
d^2=(y-y0)^2+(x-x0)^2 = (-a/b x - c/b -y0)^2 + (x-x0)^2
d/dx d^2 = 2a/b (a/b x + c/b + y0) + 2(x-x0) = 0
x= (b^2 x0 - ab y0 - ac) / (a^2 + b^2)
y = (-ab x0 + a^2 y0 -bc) / (a^2 + b^2)
2)
min d = sigma sqrt( (-ai/bi xi - ci/bi -y0)^2 + (xi-x0)^2 )
where the design variables are x0, y0, and xi, i=1,...,n

