No BSD License  

Highlights from
calculate_eccentricity.m

4.0

4.0 | 2 ratings Rate this file 5 Downloads (last 30 days) File Size: 10 KB File ID: #1003

calculate_eccentricity.m

by Tony Reina

 

02 Nov 2001 (Updated 05 Nov 2001)

Calculates the eccentricity of an ellipse

| Watch this File

File Information
Description

Determines the eccentricity of an ellipse of an orientation in the xy-plane (i.e. any tilt) by fitting a perfect ellipse to the data and rotating the ellipse to minimize the mean squared error between the fitted ellipse and the data. Should be useful for calculating the eccentricities of orbiting bodies or any closed-loop paths.

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
08 Jun 2004 Cameron Ford

This is fantastic just what i needed! REALLY didn't want to write a script to work out the eccentricity of 8 points all myself!!

11 Jul 2005 Divyanshu Vats

there is a small bug in the code...

x_fit = x_fit - x0;
y_fit = y_fit - y0;

ellipse_rotated = [x_fit(:) y_fit(:) zeros(length(x_fit), 1) ones(length(x_fit),1)] * r;

x_fit = ellipse_rotated(:, 1);
y_fit = ellipse_rotated(:, 2);
x_fit = x_fit + x0;
y_fit = y_fit + y0;

The rotation should be about the origin so we must translate the origin...otherwise works fine..thanks!!

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
approximation Tony Reina 22 Oct 2008 06:39:01
interpolation Tony Reina 22 Oct 2008 06:39:01
eccentricity Tony Reina 22 Oct 2008 06:39:01
ellipse Tony Reina 22 Oct 2008 06:39:01
calculate Tony Reina 22 Oct 2008 06:39:01
tilt Tony Reina 22 Oct 2008 06:39:01
rotate Tony Reina 22 Oct 2008 06:39:01

Contact us at files@mathworks.com