How can I draw an elliptic arc with Java without using any standard graphic libraries functions, like Ellipse() or Path()?
The closest idea of what I need to do is Elliptical Arc using Trigonometric Method, but it only shows random arcs, and that is not the way things should go.
The way I’m thinking of is: specify ellipse by two points, then specify angle, which will be cut from this ellipse (or vice versa).
For drawing ellipse I used Bresenham’s algorithm, but it can’t be used for arcs because of mirroring.
Thank you in advance.
You should look from parametric equations. For example, to draw a circle you should first know the circle formula:
where R is the radios of the circle.
Now you should write this formula based on the angle (from 1 to 360). Based in a rectangle triangle inside the circle, its trigonometric formula will be:
cos(t)^2 + sin(t)^2 = R^2
where t is the angle, cos(t) will be X and sin(t) will be Y.
So, to draw a circle, you need to pass just the radio of your circle:
You should review the parametric formulas of the figures you need to draw:
Ellipse