Returns points of an ellipse | Unix Linux Forums | Shell Programming and Scripting

 Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

# Returns points of an ellipse

## Shell Programming and Scripting

#1
03-26-2013
 saeed.soltani Registered User Join Date: May 2012 Last Activity: 10 January 2014, 11:12 AM EST Posts: 32 Thanks: 32 Thanked 0 Times in 0 Posts
Returns points of an ellipse

Hi,
Dose any one know, How can i return a 3D ellipse points if i have these information about the ellipse?
All 3 length of axes, dip of each plane and azimuth of each axes.

Code:
`i.e., axes length=(1 cm, 2 cm, 3cm);dip of planes=(15 deg, 80 deg);azimuth of each axes=(10 deg,50 deg, 120 deg).`

I think at first i have to solve the ellipse equations and then returns it's points.
I want to use these point to plot a 3D ellipse with GMT package.
#2
03-26-2013
 DGPickett   Registered User Join Date: Oct 2010 Last Activity: 4 April 2014, 4:57 PM EDT Location: Southern NJ, USA (Nord) Posts: 4,359 Thanks: 8 Thanked 534 Times in 513 Posts
Is a 3d ellipse a 2d ellipse on a plane in 3D? Standard rotation, translation and scaling would return you to a unit ellipse in the xy z=0 plane. And vice-versa, in reverse order.
 The Following User Says Thank You to DGPickett For This Useful Post: saeed.soltani (03-27-2013)
#3
03-27-2013
 saeed.soltani Registered User Join Date: May 2012 Last Activity: 10 January 2014, 11:12 AM EST Posts: 32 Thanks: 32 Thanked 0 Times in 0 Posts
yes, it's a 3d ellipse and i want to draw it in a 2D plane. [in three 2D plane, XY,XZ,YZ]
#4
03-27-2013
 DGPickett   Registered User Join Date: Oct 2010 Last Activity: 4 April 2014, 4:57 PM EDT Location: Southern NJ, USA (Nord) Posts: 4,359 Thanks: 8 Thanked 534 Times in 513 Posts
Not an ellipsoidal solid (an ellipse spun on the line through its axes), then, just an ellipse in a plane.

I guess an ellipse reduced to a unit ellipse is a circle, so not so much scaling as rotation and translation. Do you start with just a few points? Takes three to set the plane, which sets the rotation need, and then I expect a couple more to fix the ellipse in position, size and orientation. Having the axes is so much more concise than having random edge points. Obviously, some points might be redundant in fixing the ellipse, such as 4 points of a rectangle, which the solution must be robust in detecting.

The characteristic of an ellipse is that the reflection angles of rays from one axis hit the other, but trig is processing expensive and not friendly for gauss-jordan reduction. More friendly is that all points have the same sum of distances from the two axes, and are in the surface of a cone. Three-D distance is not friendly, but after rotation it is 2d. The 2d distance calc is polynomial, but with the right scaling, separately for x and y, and translation, the first order terms might be zeroed, so the squares become substitute terms in the GJ. It is reminiscent of deriving the binomial theorem, if you recall back then!

There are colections of solutions for most geometric problems, but doing it yourself is so much nicer. I recall regenerating the binomial theorem while taking a math SAT (got 800), but since then for some reason it has stuck! I never liked the trig in calculus, as there were so many identities to memorize, but most Integral Calculus tests were open book.

Last edited by DGPickett; 03-27-2013 at 10:55 AM..