Arc Angles

An arc angle is similar to an arc. The primary practical difference between the two is that when an application uses drawArc to draw an arc, it specifies the x and y locations of the arc’s radials.

In contrast, to draw an arc angle the application uses the drawArcAngle method and specifies the degrees of the angle; the method itself takes care of locating the coordinates at which drawing starts and stops.

The drawArcAngle method has the following syntax:

public final void drawAngleArc( Point center, int radius, float startAngle, float endAngle )

The Point parameter identifies the screen location at which to place the radius, specified in the radius parameter. The startAngle specifies the number, in degrees, where the angle starts, and the endAngle parameter specifies how many degrees to draw, beginning at the startAngle.

The following example shows how to use this method. This method draws an arc angle, beginning at a start angle of 30, and extending 300 degrees from the start angle:

protected void onPaint(PaintEvent e){
   
      Rectangle rcClient = this.getClientRect();
      int x = rcClient.width / 2;
      int y = rcClient.height / 2;
      int radius = 100;
      float startAngle = 30;
      float endAngle = 300;

      e.graphics.drawAngleArc(new Point(x,y), radius, startAngle, endAngle);

}