问题
Now i draw pictures in circle by formula :
float x = CIRCLE_RADIUS * (float) Math.sin(2f * Math.PI * drawSquareIndex / ITEMS_COUNT + angle) * 1.75f;
where x - is a X point of circle item.
And i have a circle.

but i want to draw pictures on ellipse. What the formula i need to use?

How i can do that?
P.S. sorry about quality. Make a question from phone.
回答1:
You can use parametric ellipse equaition (a = b
is a case of cirle):
x = a * cos(t)
y = b * sin(t)
t = 0..2*PI
In your case
// Pseudo code
for (double t = 0; t < 2 * PI; t += 0.001) { // <- or different step
double x = RadiusX * Math.Cos(t);
double y = RadiusY * Math.Sin(t);
Paint(x, y);
}
来源:https://stackoverflow.com/questions/22663479/how-to-make-a-ellipse-from-points