06-02-2025
02:28 AM
- last edited on
06-03-2025
09:11 PM
by
altenbach
Hi all.
I would like to know how to calculate the major and minor axes and angles of a rotated ellipse.
06-02-2025 02:42 AM
06-02-2025 08:54 AM - edited 06-02-2025 09:23 AM
@leesh63 wrote:
I would like to know how to calculate the major and minor axes and angles of a rotated ellipse.
These are the parameters that define the ellipse and if you don't know them, you need to solve the inverse problem..
What kind of ellipse do you have?
Either way, once you have a sufficient number of points, you can do a nonlinear fit with five parameters: centerX, centerY, major axis, minor axis, rotation angle.
06-02-2025 02:56 PM - edited 06-02-2025 02:58 PM
Just for fun, I wrote a simple simulation how one could fit xy data to an ellipse defined by the center (x0, y0), A, B, and the rotation angle.
Note that I wrote this from scratch during breakfast, so I am sure there are some bugs.. 😄
It can easily be modified for different angle definition (start angle, direction) and units (e.g. degrees instead of radians).
(Note that there is an infinite number of solutions at 180 degree angle increment and the program normalizes the value.)
06-03-2025 11:15 AM
On a side note, I have listed this example in my special interest group for any kind of fitting data to a model.
06-03-2025 01:01 PM
@leesh63 wrote:
Hi all.
I would like to know how to calculate the major and minor axes and angles of a rotated ellipse.
eigenvalues? HU-Moments?
06-03-2025
06:37 PM
- last edited on
06-03-2025
09:10 PM
by
altenbach
Thanks for the reply. I am attaching the XY plot. I want to find the major axis, minor axis and angle from the ellipse.
06-03-2025 09:06 PM - edited 06-03-2025 09:12 PM
Please stop placing text into code tags, makes the post hard to read. (I edited your post to remove it)
Have you tried my example? What is the data format? (XY graphs accept many different types!)
Can you attach the VI instead? How do you want to define the angle?
06-04-2025 02:58 AM - edited 06-04-2025 02:58 AM
Thanks a lot.
Due to internal security issues, I cannot attach the file. I measured two sine function form DAQ, ans if I correspond one to X-axis and the other to Y- axis, I can obtain an elliptical XY graph. From this graph, I have to calculate the major axis, the monor axis, and rotation angle ( radian or degree). I attach bmp file.
Thanks so much for yous reply again.
06-04-2025 03:33 AM - edited 06-04-2025 03:34 AM
Thanks so much. I just saw the program. Finally I figured out how to find the major axis, the minor axis and rotation angle. Thanks again