Jashwant Jashwant - 1 year ago 105
Javascript Question

Polar equation of perimeter of half ellipse (concave mirror shape)

var x = Cx + a * Math.cos(ang);

var y = Cy + b * Math.sin(ang);

Cx, Cy
are cords of center.
is angle in
is half of width,
is half of height.

If I change values of
, I get different points on circumference of ellipse. Below is the path, which I get with above equation.


But instead of this elliptical shape, I want something like half ellipse, something like concave mirror. Even if we stretch both of its end to infinity, they should not form elliptical shape.


Can somebody provide me polar equations for second curve. I am very bad at digital drawing, but you can imagine that as concave mirror.

Answer Source

The parametric equations for a parabola with focus at (Fx, Fy) and focal parameter 2a, in terms of angle, would be:

x = Fx + (2*a*cos(ang))/(1 + cos(ang))
y = Fy + (2*a*sin(ang))/(1 + cos(ang))

Not too bad. :) You can adjust a as needed. You can actually modify it a bit by adjusting the ratio of the distances from the focus to the plot, versus the plot to the directrix:

x = Fx + (2*a*cos(ang))/(1 + cos(ang))
y = Fy + (2*b*sin(ang))/(1 + cos(ang))

Here the ratio will be b/a. So you can have the same distance from the origin to the vertex (2a) and make b larger to "flatten" the parabola.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download