Anybody who can help me to make a linear fit if I have a specific number of intersection point (x0,y0), so instead of using this y=mx I have to use this y-y0=m(x-x0),x0 = 0.3459; y0 = 0.4478 so I need to get a straight line from fit function that can cross the point(x0,y0). Please look at my code below and let me know how I can modify fit function to work with the above equation .
range = {{0.3389`, 0.44079999999999997`}, {0.3389`,
0.4415`}, {0.3389`, 0.4422`}, {0.3389`,
0.44289999999999996`}, {0.3396`, 0.4436`}, {0.34099999999999997`,
0.4443`}, {0.3417`, 0.44499999999999995`}, {0.34309999999999996`,
0.4457`}, {0.3438`, 0.44639999999999996`}, {0.3452`,
0.4471`}, {0.3459`, 0.4478`}, {0.34659999999999996`,
0.44849999999999995`}, {0.348`, 0.4492`}, {0.3487`,
0.44989999999999997`}, {0.35009999999999997`, 0.4506`}, {0.3508`,
0.4513`}, {0.35219999999999996`, 0.45199999999999996`}, {0.3529`,
0.4527`}, {0.3529`, 0.45339999999999997`}, {0.3529`,
0.45409999999999995`}, {0.3529`, 0.4548`}};
p = ListLinePlot[range, BaseStyle -> Red,
PlotRange -> {{0.342, 0.349}, {0.435, 0.455}}]
x = range[[All, 1]]
y = range[[All, 2]];
drop = Drop[Drop[range, 4], -4]
ListPlot[drop]
x0 = 0.3459;
y0 = 0.4478;
yy = Fit[drop, {0, xx}, xx]
pnew = Plot[yy, {xx, .335, .35}, PlotStyle -> {Black}]
Thanks in advance!
drop = Drop[Drop[data, 4], -4]
bedrop = Drop[Drop[range, 4], -4]
? I see no zeros but I see "duplicate" x-values at the beginning and the end of the list of data. $\endgroup$ – JimB Mar 12 '18 at 1:29{x, y} = Transpose@range
anddrop = Take[range, {5, -5}]
$\endgroup$ – OkkesDulgerci Mar 12 '18 at 13:06