The following work. The habit of changing the intuitive meaning of ordinates and abscissas used in a plot can sometimes create overlays. Your problem may arise due to the way you determine your coordinate system when building using another function (imshow or related image display procedures depending on the graph), in particular, the position of the beginning of the image. Here is my code:
% create image of parabola k =[-0.3 10 10]; x = [1:0.1:50]; y = round(k(1)*x.^2 + k(2)*x + k(3)); crd = unique(round([x(:) y(:)]),'rows'); Nx = 100; Ny = 100; img = ones(Nx,Ny)*255; iok = find((crd(:,1)>0) & (crd(:,1)<=Nx) & (crd(:,2)>0) & (crd(:,2)<=Ny)); indx = sub2ind([Nx Ny],crd(iok,1),crd(iok,2)); img(indx) = 0; imshow(img)
Then we come to the parabola
% pick three points: x0 = crd(1,1); y0 = crd(1,2); x1 = crd(80,1); y1 = crd(80,2); x2 = crd(160,1); y2 = crd(160,2); % plot these on the original image hold on plot(y0,x0,y1,x1,y2,x2,'Markersize',20,'Linestyle','none','Marker','x','Color','r')
By solving the equation exactly as you showed, the result
S = -1094/3627 * x ^ 2 + 12073/1209 * x + 37415/3627
Overlay of the established equation
a= -1094/3627; b = 12073/1209; c = 37415/3627; xx = 1:100; yy = a*xx.^2 + b*xx +c ; % then I plot the parabola on the image as plot(yy,xx,'g--');
Not very beautiful plot (green = landing, red crosses = selected points, blue = parabola, applied without changing the order of x and y):
