Ellipse with four different radii

234 Views Asked by At

I need draw an ellipse in 3D (for time being, consider $z$ constant), Lets say I have center $O = (x_{0},y_{0},z_{0})$ of ellipse is at $(0,0,0)$ and radii $q_{1}, q_{2}, q_{3}, q_{4}$ of ellipse i have as shown in image. How do I obtain $N$ Coordinates $(x,y,z)$ to draw the ellipse circumference (highlighted by blue color line in the image)?

The Image shows the complete concept I'm working on( you may ignore the image). In case if the parameters shown in other part of the image are useful, we can use them. Where the 3D irregular cone apex is at $P_{c}$ and base origin is at $O$.

enter image description here

We can get $N$ Coordinates to draw 2D ellipse circumference whose center is at $(0,0)$ using:

$x_{k} = a \ \cos(2k\pi/N)$

$y_{k} = b \ \cos(2k\pi/N)$

where $k= 0,.....N-1$.

enter image description here

In my case the radii from center $O$ are $q_{1}, q_{2}, q_{3}, q_{4}$ and they are not equal unlike $a$ and $b$. Any help please?

1

There are 1 best solutions below

0
On

The thing with "radii" $q_1,\dots q_4$ is certainly not an ellipse. But I understand that you want it to be some generalization of ellipse, something that reduces to the ellipse when $q_1=q_3$ and $q_2=q_4$. Here is one way:

An ellipse with center $0$ has polar equation of the form $$r = (A-B\cos 2\theta)^{-1/2}$$ Think of $A-B\cos 2\theta$ this way: it is a trigonometric polynomial that interpolates the desired values $r^{-2}$ at $\theta=0,\pi /2, \pi, 3\pi/2 $. This suggests a natural generalization:

  1. calculate $q_1^{-2},\dots, q_4^{-2}$.
  2. Find a trigonometric polynomial $P$ (of second degree) that attains the above values at $\theta=0,\pi /2, \pi, 3\pi/2 $.
  3. The "generalized ellipse" is $r=P(\theta)^{-1/2}$.

The above process works reasonably well on some examples.

If the above is too complicated (or does not perform well on your data), try a simple-minded approach: concatenate four quarter-ellipses with given semi-axes. The curve will look smooth because the tangent vector is continuous. It will not be $C^2$ smooth, but human eye is not trained to detect discontinuities of second derivative.