The below equations will give you x and y coordinates of ellipse.

```
x = a cos t
y = b sin t
```

a – horizontal distance from origin.

b – vertical distance from origin

t – angle at which you need the coordinate.

```
List<Double> xcoord = new ArrayList<Double>();
List<Double> ycoord = new ArrayList<Double>();
public void getCoordinates() {
for(int i=0;i<360;i++) {
xcoord.add(10 * Math.cos(i));
ycoord.add(20 * Math.sin(i));
}
}
```

The above function adds up all the coordinates from 0 to 360 to the list with 10 as horizontal distance from origin and 20 as vertical distance from origin. Hope this helps.

ou may use a simple rotation transformation:

```
x1 = x*cos(a) - y*sin(a)
y1 = x*sin(a) + y*cos(a)
```

Where `a`

– is the angle to rotate.

This Wikipedia article explains that in detail

Advertisements