Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
draw a parabola with given angle

Subject: draw a parabola with given angle

From: niloufar

Date: 8 May, 2012 12:58:07

Message: 1 of 4

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 ?

Subject: draw a parabola with given angle

From: Bruno Luong

Date: 8 May, 2012 13:34:09

Message: 2 of 4

"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 ?

You can't, the monitor is too small.

Bruno

Subject: draw a parabola with given angle

From: Roger Stafford

Date: 8 May, 2012 20:09:10

Message: 3 of 4

"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 y-axis and left of it, the polar coordinate equation of the parabola is

 r = 2*p/(1-cos(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/(1-cos(t-t0))

  If you simply want to plot a portion of it, do this:

 t = linspace(t0+k,t0+2*pi-k);
 r = 2*p./(1-cos(t-t0));
 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

Subject: draw a parabola with given angle

From: niloufar

Date: 8 May, 2012 21:02:06

Message: 4 of 4

thanks for your help

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us