How do I plot an arc or parabola

7 visualizaciones (últimos 30 días)
peter obi
peter obi el 19 de Nov. de 2015
Respondida: Image Analyst el 30 de Dic. de 2015
I just started learning matlab and I have found plotting an arc and parabola very difficult no matter how hard I read previously posted questions about it. Here is a picture of what I wanna try to plot with the arcs hand drawn using paint. However am gonna use one side as an example (the parabola in red). My start point=[2,10], critical point=[4,9], end point=[5,10]. Thank you

Respuestas (2)

Are Mjaavatten
Are Mjaavatten el 30 de Dic. de 2015
Editada: Walter Roberson el 30 de Dic. de 2015
If I read you correctly, you want a parabola that goes through the three specified points and that additionally has a horizontal tangent at the middle point. This is a parabola with a tilted axis, and I do not have the patience to work out the formulas. However, if you can make do with parabolas with vertical or horizontal axes, polyfit will give you the parameters you need. For symmetry, I have moved the middle point to 3.5:
x1 = [2,3.5,5];
y1 = [10,9,10];
x1plot= linspace(2,5);
p = polyfit(x1,y1,2);
y1plot = polyval(p,x1plot);
plot(x1plot,y1plot,'r');
% Horizontal axis for the arc on the lower left:
hold on
x2 = [2,1.7,2];
y2 = [11,12,13];
p2 = polyfit(y2,x2,2);
y2plot = linspace(11,13);
x2plot = polyval(p2,y2plot);
plot(x2plot,y2plot,'k')

Image Analyst
Image Analyst el 30 de Dic. de 2015
FAQ entry for creating a circular arc: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_an_arc.3F

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by