# Calculating Points of Ellipse



## macleodjb (Jun 7, 2012)

Hi Guys,

I know this is kind of going to be repetitive from another post but I completely suck at math and can't quite follow the other examples.

I've been tasked at work to create a program to make an elliptical cutout in Autocad.  But in order for me to do that I need to know the points along the path of that ellipse.

I picked up this formula from another thread but can't follow it.
(((px-XCenter)^2)/Length^2) + (((qy-YCenter)^2)/Height^2)

What I will be given is the length and width of the ellipse.

I need to calculate the points along the path.

Then I also need to calculate the arc bulge(s) for each line segment.

I understand what a focal point is, but I dont know how to calculate it's location. 

Kind of lost looking for someone solid direction.  Please don't give me a link because chances are I have already it and couldn't follow the formula.  I am really looking for an explanation of the formula.

Thanks in advance.


----------



## shg (Jun 7, 2012)

Is the ellipse axis-aligned?


----------



## macleodjb (Jun 7, 2012)

I have no clue what that means, but if you're asking me if the ellipse is on an angle, lets assume its not. and it's axis center would be at 0,0


----------



## shg (Jun 7, 2012)

```
-A- --B-- --------------------------------C--------------------------------
   1    H      5 B1: Input                                                        
   2    W     10 B2: Input                                                        
   3                                                                              
   4    x    y                                                                    
   5   -10 0.000 A5 and down: =((2*ROWS(A$4:A5) - 4)/(ROWS(A$5:A$25) - 1) - 1) * W
   6    -9 2.179 B5 and down: =H*SQRT((1-(A5/W)^2))                               
   7    -8 3.000                                                                  
   8    -7 3.571                                                                  
   9    -6 4.000                                                                  
  10    -5 4.330                                                                  
  11    -4 4.583                                                                  
  12    -3 4.770                                                                  
  13    -2 4.899                                                                  
  14    -1 4.975                                                                  
  15     0 5.000                                                                  
  16     1 4.975                                                                  
  17     2 4.899                                                                  
  18     3 4.770                                                                  
  19     4 4.583                                                                  
  20     5 4.330                                                                  
  21     6 4.000                                                                  
  22     7 3.571                                                                  
  23     8 3.000                                                                  
  24     9 2.179                                                                  
  25    10 0.000
```
 
y values are positive and negative.


----------



## macleodjb (Jun 7, 2012)

Can you explain what this formula is doing?  Because when I lay out this ellipse in autocad the points do not come out correctly.


----------



## shg (Jun 7, 2012)

H is the half-height, and W is the half-width -- I should have said that. So the ellipse extends horizontally from -10 to +10, and vertically from -5 to +5. 

The x values are inputs, and the y values are the outputs.


----------



## shg (Jun 7, 2012)

It could be done in polar form instead:


```
-A- ---B--- --C--- -----------------------------D-----------------------------
   1    H        5        B1: Input                                                  
   2    W       10        B2: Input                                                  
   3                                                                                 
   4    a     x      y                                                               
   5     0  10.000  0.000 A5 and down: =(ROWS(A$4:A5) - 2)/(ROWS(A$5:A$25) - 1) * 360
   6    18   9.511  1.545 B5 and down: =W*COS(RADIANS($A5))                          
   7    36   8.090  2.939 C5 and down: =H*SIN(RADIANS($A5))                          
   8    54   5.878  4.045                                                            
   9    72   3.090  4.755                                                            
  10    90   0.000  5.000                                                            
  11   108  -3.090  4.755                                                            
  12   126  -5.878  4.045                                                            
  13   144  -8.090  2.939                                                            
  14   162  -9.511  1.545                                                            
  15   180 -10.000  0.000                                                            
  16   198  -9.511 -1.545                                                            
  17   216  -8.090 -2.939                                                            
  18   234  -5.878 -4.045                                                            
  19   252  -3.090 -4.755                                                            
  20   270   0.000 -5.000                                                            
  21   288   3.090 -4.755                                                            
  22   306   5.878 -4.045                                                            
  23   324   8.090 -2.939                                                            
  24   342   9.511 -1.545                                                            
  25   360  10.000  0.000
```


----------



## macleodjb (Jun 7, 2012)

Ok I'm almost understanding.  This is what i get when I tried it on mine.  The Y Coordinate and some X Coordinates do not seem to work out right.


```
Width   10   
  
  
      Length   20   
  
  
      
     
  
  
      Angle   
  x   y   
      0   
  10   0   
      18   
  9.510565   6.18034   
      36   
  8.09017   11.75571   
      54   
  5.877853   16.18034   
      72   
  3.09017   19.02113   
      90   
  6.13E-16   20   
      108   
  -3.09017   19.02113   
      126   
  -5.87785   16.18034   
      144   
  -8.09017   11.75571   
      162   
  -9.51057   6.18034   
      180   
  -10   2.45E-15   
      198   
  -9.51057   -6.18034   
      216   
  -8.09017   -11.7557   
      234   
  -5.87785   -16.1803   
      252   
  -3.09017   -19.0211   
      270   
  -1.8E-15   -20   
      288   
  3.09017   -19.0211   
      306   
  5.877853   -16.1803   
      324   
  8.09017   -11.7557   
      342   
  9.510565   -6.18034   
      360   
  10   -4.9E-15
```
Under the X Column I have this

```
=Width*COS(RADIANS($A6))<-- Cell reference is incremented down the column
```
and under the Y I have this

```
=Length*SIN(RADIANS($A6))<--Cell ref is incremented down the column
```

I don't understand what this formula is doing at all.

```
=(ROWS(A$4:A5) - 2)/(ROWS(A$5:A$25) - 1) * 360
```


----------



## shg (Jun 7, 2012)

It just generates the angles from 0 to 360 over the range. You could have instead entered them manually, or as a series, or ....


----------



## macleodjb (Jun 7, 2012)

Thank You very much for being patient.  I've got it perfectly now.


----------



## macleodjb (Jun 7, 2012)

Hi Guys,

I know this is kind of going to be repetitive from another post but I completely suck at math and can't quite follow the other examples.

I've been tasked at work to create a program to make an elliptical cutout in Autocad.  But in order for me to do that I need to know the points along the path of that ellipse.

I picked up this formula from another thread but can't follow it.
(((px-XCenter)^2)/Length^2) + (((qy-YCenter)^2)/Height^2)

What I will be given is the length and width of the ellipse.

I need to calculate the points along the path.

Then I also need to calculate the arc bulge(s) for each line segment.

I understand what a focal point is, but I dont know how to calculate it's location. 

Kind of lost looking for someone solid direction.  Please don't give me a link because chances are I have already it and couldn't follow the formula.  I am really looking for an explanation of the formula.

Thanks in advance.


----------



## shg (Jun 7, 2012)

You're welcome, good luck.


----------

