"niloufar " <ndarvish@kth.se> wrote in message <job58v$lg1$1@newscl01ah.mathworks.com>...
> does anybody know how to draw a Parabola with given phi(angle of the detected parabola in polar coordinates) and p ( distance between vertex and focus of the detected parabola) in Cartesian coordinate system ?
         
If the parabola's focal point is assumed to be at the origin of the cartesian coordinates and if the directrix is parallel to the yaxis and left of it, the polar coordinate equation of the parabola is
r = 2*p/(1cos(t))
for the p you defined where r and t (theta) are the polar coordinates. If the directrix is rotated an angle t0, the equation becomes
r = 2*p/(1cos(tt0))
If you simply want to plot a portion of it, do this:
t = linspace(t0+k,t0+2*pik);
r = 2*p./(1cos(tt0));
x = r.*cos(t);
y = r.*sin(t);
where k>0 is chosen according to how large your plot is to be. (As Bruno humorously indicated, with k = 0 so as to encompass the entire parabola, it would be of infinite extent and therefore wouldn't fit on your monitor.)
If the origin is not at the focal point, then change the last two equations to:
x = r.*cos(t) + x0;
y = r.*sin(t) + y0;
where (x0,y0) is the location of the focal point.
If you want an equation in cartesian coordinates for such a parabola, use algebra to convert the above polar equation to cartesian form. (It isn't really very hard to do.)
Roger Stafford
