[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

arc Subroutine

Purpose

Draws a circular arc.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void arc
(Coord x, Coord y, Coord radius, 
Angle startang, Angle endang)
void arci
(Icoord x, Icoord y, Icoord radius, 
Angle startang, Angle endang)
void arcs
(Scoord x, Scoord y, Scoord radius, 
Angle startang, Angle endang)

FORTRAN Syntax

SUBROUTINE ARC(x, y, radius, startang, endang)
REAL x, y, radius
INTEGER*4 startang, endang
SUBROUTINE ARCI(x, y, radius, startang, endang)
INTEGER*4 x, y, radius, startang, endang
SUBROUTINE ARCS(x, y, radius, startang, endang)
INTEGER*2 x, y, radius, startang, endang
Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference. Also, the FORTRAN INTEGER*2 version, the ARCS subroutine, should not be called with integer constant parameters. For example, 2 is an integer constant; JJ is an integer variable. The XL FORTRAN compiler, invoked by the xlf command, stores all integer constants as long integers (INTEGER*4), not as short integers (INTEGER*2). Invoking the short version of this subroutine with an integer constant will result in unexpected behavior.

Description

The arc subroutine draws a circular arc in the x-y plane (z = 0), using the current line attributes: color, linestyle, linewidth and writemask. To draw an arc in a plane other than the x-y plane, define the arc in the x-y plane and then rotate or translate the arc.

All of the routines listed in the syntax are functionally the same. They differ only in the type declarations for the coordinates. After the arc subroutine executes, the graphics position is left undefined.

The syntax for each of the subroutine forms is the same except for the first argument. They differ only in that arc expects real coordinates, arci expects integer coordinates, and arcs expects short integer coordinates.

Parameters

x Specifies the x coordinate of the center of the arc, which is the center of the circle that would contain the arc.
y Specifies the y coordinate of the center of the arc, which is the center of the circle that would contain the arc.
radius Specifies the length of the radius of the arc, which is the radius of the circle that would contain the arc.
startang Specifies the measure of the start angle of the arc, which is measured in tenths of a degree from the positive x-axis.
endang Specifies the measure of the end angle of the arc, which is measured in tenths of a degree from the positive x-axis.

Example

The example C language program tpbig.c uses the arc subroutine and the arci subroutine to draw two circular arcs in the default linestyle.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Drawing a filled circular arc with the arcf subroutine.

Drawing a circle with the circ subroutine.

Drawing a filled circle with the circf subroutine.

Drawing a curve with the crv subroutine.

AIX Graphics Library Overview, Setting Drawing Attributes, and Drawing Rectangles, Circles, Arcs, and Polygons.


[ Previous | Next | Contents | Glossary | Home | Search ]