Fitting an Ellipse to the Orbit of a Star near the Galactic Center

This Demonstration shows how the equation for the best-fitting ellipse can be determined for several predefined points in the Cartesian plane. The points are the locations of a star known as S2 near the center of our galaxy.
In order to achieve the most suitable formula for an ellipse, the method of least squares is used, which minimizes the sum of the distances () between the data points and the curve.
Use the controls to find the best-fit ellipse by attempting to minimize the sigma () value. Axial lengths of the ellipse are fit automatically and the resulting equation parameters are displayed on the right.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The data points used in this Demonstration are the coordinates representing the position of star S2 orbiting around Sagittarius A*. They have been collected by the Very Large Telescope, Keck, and NTT since 1992.
Sagittarius A* is the strong radio source considered to be the center of our Milky Way galaxy and where a supermassive black hole might be situated. Since star S2 is drifting around an elliptic path, according to Kepler’s laws of planetary motion, the mass of an object at the foci of the ellipse can be determined.
[1] S. Gillessen, F. Eisenhauer, T. K. Fritz, H. Bartko, K. Dodds-Eden, O. Pfuhl, T. Ott, and R. Genzel, "The Orbit of the Star S2 around Sgr A* from VLT and Keck Data," The Astrophysical Journal, 707, 2009 pp. L114–L117.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2017 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+