I need to draw a Pie Arc in Java with start angle 350 and end angle 20.The cordinate system I follow is as follows:-
|0
|
270-----------90
|
|180
The problem here is that the start angle is greater than the end angle.For the other way round I have managed to draw the arc.Any help would be great.
You will have a start angle and an 'extent' angle and not an end angle. So, I don't think you would be having problem drawing an arc.
import java.awt.Graphics;
import javax.swing.JFrame;
public class Test extends JFrame{
public static void main(String[] args){
new Test();
}
public Test(){
this.setSize(400,400);
this.setVisible(true);
}
public void paint(Graphics g) {
g.fillArc(100, 100, 100, 100, 70, 30);
}
}
Alternatively, you can use the Arc2D class as well. One more thing to note that in java, this is the default co-ordinate mechanism.
|90
|
180-----------0
|
|270