Formulas for ellipse at an angle, in Excel.

Click For Summary

Discussion Overview

The discussion revolves around the mathematical representation and manipulation of ellipses, particularly focusing on how to rotate an ellipse at an angle using Excel. Participants explore various formulas, including parametric forms and rotation matrices, and share their experiences in implementing these concepts in Excel for graphical representation.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant describes the general formula for an ellipse and seeks a method to rotate it in Excel.
  • Another suggests using a rotation matrix to achieve the desired rotation of the ellipse.
  • There is a correction regarding the distinction between the canonical form of an ellipse and a general formula, with a proposal to use parametric equations for easier implementation in Excel.
  • Participants discuss the effectiveness of using parametric equations, specifically mentioning the equations x = b cos(t) and y = a sin(t), and their implementation in Excel.
  • Concerns are raised about the appearance of the rotated ellipse and the effect of graph scaling on visual representation.
  • One participant inquires about rotating the ellipse around a specific point (0, -b) rather than the origin, leading to a detailed explanation of the steps required to achieve this.
  • There is a discussion about the use of degrees versus radians in Excel for trigonometric functions, with some participants sharing their preferences and methods for conversion.
  • Participants share their applications of the ellipse calculations in the context of archery limb profiles, indicating practical uses for the discussed formulas.

Areas of Agreement / Disagreement

Participants express varying opinions on the best methods for representing and rotating ellipses, with some agreeing on the utility of parametric equations while others challenge the definitions and formulas presented. The discussion remains unresolved regarding the optimal approach to rotate the ellipse around a specific point.

Contextual Notes

Some participants note limitations in their understanding of radians versus degrees, and there are unresolved questions about the visual representation of the ellipse in Excel graphs, particularly concerning axis scaling and rotation accuracy.

Who May Find This Useful

This discussion may be useful for individuals interested in mathematical modeling, graphical representation of curves in Excel, and applications in fields such as engineering or archery design.

Thorvald
Messages
32
Reaction score
0
Hi.

I know about the general formula for an ellipse: x^2/a^2 + y^2/b^2 = 1, that can be used to isolate y and calculate x,y points in excel. That's great, so far so good. That will create a ellipse, with horizontal A (x) axis and vertical B (y) axis. But what if one wants to rotate the ellipse some amount of degrees, like 20 degrees, 60 degrees - in Excel?? Is there a simple way to do that in Excel - or to apply that to the general formula for the ellipse? Maybe I am thinking too complicated, so that I can't see the solution... :smile:
 
Engineering news on Phys.org
Take your result and x and y values, and run them through a simple rotation matrix. In 2D is should be fairly straightforward.
http://en.wikipedia.org/wiki/Rotation_matrix

Might be a difficult way to get it in closed form within your ellipse function, but as a two-step process, should be pretty easy.
 
Thorvald said:
I know about the general formula for an ellipse: x^2/a^2 + y^2/b^2 = 1
That is not the general formula for an ellipse. A general formula would describe all ellipses. The given expression is a canonical form, not a general form.

For plotting some curve it is often easier to use a parametric description of the curve. One parametric description of that canonical ellipse is

\begin{align*}<br /> x &amp;= b\cos t \\<br /> y &amp;= a \sin t<br /> \end{align*}<br />

This parametric description is very easy to implement in Excel. Let column A be used for t, column B for x, and column C for y. Make column A, the t values, march from 0 to 2*pi in uniform steps. Columns B and C are the simple expressions b*cos(t) and a*sin(t), where t is the column A value for the row in question.

Suppose instead these x and y values are for some axes rotated with respect to the x and y axes. Label columns B and C u and v instead of x and y. Add two more columns to denote x and y. The x value is u*cos(theta)-v*sin(theta) while y is u*sin(theta)+v*cos(theta), where theta is some defined value (just as are a and b).
 
Hmmm., thanks for your replies - very useful. I have used this formula to calculate points (or at least the 1/4th of the ellipse) in excel: y = sqrt(b^2*(1-x^2/a^2), where I choose values for a and b. Does your formula y = b cos(t), give the same result (possibly giving the whole ellipse)? And t is angles from 0 to 360 degrees?? That formula for y is of course easier, but my first formula is now programmed in Excel and works - so maybe I just keep it.

Then to rotate it, it seems like you both agree that the new formula for y would be:

y' = x sin(t) + y cos(t)

This I could simply add in a column after my present x, y columns, to achieve the same ellipse, just rotated t degrees - (I think). Is that a correct understanding of it? Must try it out when I get some time... :)
 
Does this look correct? It does not look like the curve have been rotated 45 degrees?

I may want to use the formulas for creating the whole ellipse and then just take out what part of the ellipse, I want to use. But this was just for now to see if it works.

Ellipsecalculation.jpg
 
It looks OK, but just to check, it might help to define your rotation angle as 90°. So, you're point at (0,145) should go to (-145,0). Do each step separately just to make sure everything is cool.
 
You're right - it looks ok. I know why it didn't look exactly correct - because as values changes the axes in the graph changes... Is it possible to automatically control the graph grid, so it is the same in the different pictures?

Ellipsecalculationtest1.jpg


Ellipsecalculationtest2.jpg


Ellipsecalculationtest3.jpg
 
Hmmm., wait - when I rotate the ellipse 90 degrees, I would expect that it would "stand up". I.e. the long part of ellipse, being vertical. Why that is not the case?
 
Aaaah - wait again - it may be the case, it's just the grid/axes that teases me...
 
  • #10
D H said:
...that canonical ellipse is

\begin{align*}<br /> x &amp;= b\cos t \\<br /> y &amp;= a \sin t<br /> \end{align*}<br />

It looks like you have made a mistake here. I couldn't understand why, when I used this formula the "a" was smaller than the "b" - but it's logic, because a is the biggest value along the x-axis, so "a" should be in the formula for x.
 
Last edited:
  • #11
How to rotate the ellipse in the point (0,-b)?? The formulas you have given, rotates it around (0,0). I'd like to move the ellipse (shouldn't be difficult), use part of the ellipse (not difficult, either) and then rotate it at what was originally (0,-b).
 
  • #12
Thorvald said:
How to rotate the ellipse in the point (0,-b)?? The formulas you have given, rotates it around (0,0). I'd like to move the ellipse (shouldn't be difficult), use part of the ellipse (not difficult, either) and then rotate it at what was originally (0,-b).
(1) First figure out where the origin rotates to, if you rotate by an angle θ about the point (0,-b). Maybe the easiest way to do this is to rotate the point (0,-b) about the origin by θ, figure out it's displacement, and realize that the origin will by displaced that amount in the opposite direction when rotated by θ about (0,-b)

(2) Next rotate the ellipse by θ about the origin, just as before.

(3) Finally, apply the displacement that you determined in step (1) to the entire ellipse.

By the way, if you parameterize the initial (unrotated) ellipse as was suggested before:
x = a cos(t) (yes, you're correct, a goes with x)
y = [STRIKE] b cos(t) [/STRIKE] EDIT -- oops, that should be: b sin(t)​
Then I think you're ellipse could look a lot nicer, especially near the vertices. Just be aware that Excel assumes radians when doing trig functions, so:
0 ≤ t ≤ 2*pi​

Also, you might want to set your axis scales to fixed values, so that you are not dealing the the autoscaling issues whenever you move the ellipse.

Final piece of advice: I like to give Excel graphs a white background. Whenever I see a gray background on an Excel graph, it says to me "I'm a total noob! Or I'm too lazy to bother adjusting Excel's built-in defaults."

Anyway, good luck. :smile:
 
Last edited:
  • #13
You are right about the white background in graphs. I normally do that too (but haven't doen it yet in this one... :-) ) - Well, done it now...

Yes, I am now using the cos/sin-formulas for the ellipse - hey, did you write wrong again? Shouldn't you use sin for y?? Or is it cos for both x and y?

I use degrees rather than radians, as I don't "understand" radians. So I just write in Excel for cos(t): COS(t*PI()/180), t given in degrees.

To do what I wanted, I used the following approach:
First I made a set of x,y columns, creating just the ellipse and nothing else. Then I made a column called degrees and a new set of columns called x' and y' - and here calculated the rotated ellipse. In the x,y columns, I could then find the (0,-b) and compare with the values in x',y' columns. Then I could create a formula for how much x',y' was moved compared to x,y, plus I knew where I wanted the "0,-b" point to be located - and made that in a new set of columns x'',y''.

This ellipse approach is a add-on to another Excel program. This program can be used to study different limb profiles for bows (archery), how they will bend etc. up to a full drawn bow. The ellipse add-on was an idea I got, to have a way to automatically calculate a mathematical correct geometrical curve for the bow-limb. The ellipse add-on can be used to make about anything from straight limbs over slightly curved limb to curled recurve bow limbs. See also attached to get an idea of how I use it.

If you see something that doesn't look correct in how I rotate and move the ellipse etc., just tell me.
 

Attachments

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
788
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 49 ·
2
Replies
49
Views
6K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K