Question: 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.

Answer: 
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);
    }
}

```

[![enter image description here](https://i.stack.imgur.com/tkfPX.png)](https://i.stack.imgur.com/tkfPX.png)

Alternatively, you can use the [Arc2D](http://download.oracle.com/javase/6/docs/api/java/awt/geom/Arc2D.html) class as well. One more thing to note that in java, this is the default co-ordinate mechanism.

```
        |90  
        |
180-----------0 
        |
        |270

```
Use **(450 - angle) % 360** to switch angles. Concept 450 = 180 + 270;