Previous Next Up Title Contents Index Functions Index Top Library

2D ARC

tcircle_arc


CALL SEQUENCE

void tcircle_arc (strid, arc, open_close)

INPUT PARAMETERS

Pint	strid;
Tcircle_arc	*arc;
Tarc_close	open_close;

ARGUMENTS

strid
Identifier of the arc structure.
arc
Arc geometry description.
open_close
Flag indicating whether the arc is open or closed.

TYPE

typedef struct {
Tcircle_arc_type	type;
union {
	struct {
		Ppoint	c;	/* Circle center	*/
		Ppoint	i;	/* Initial point of the arc 	*/
		Pfloat	a;	/* Arc angle	*/
	} cia;

	struct {
		Ppoint	c;	/* Circle center	*/
		Ppoint	i;	/* Initial point of the arc	*/
		Ppoint	f;	/* Final point of the arc	*/
	} cif;

	struct {
		Ppoint	i;	/* Initial point of the arc	*/
		Ppoint	m;	/* Middle point of the arc	*/
		Ppoint	f;	/* Final point of the arc	*/
	} imf;

	struct {
		Ppoint	c;	/* Circle center	*/
		Pfloat	r;	/* Circle radius	*/
		Pfloat	s;	/* Initial angle of the arc	*/
		Pfloat	e;	/* Final angle of the arc	*/
	} crse;
} geometry
} Tcircle_arc;
typedef enum {
	TCENTER_PINIT_ANGLE,
	TCENTER_PINIT_PFINAL,
	TPINIT_PMIDDLE_PFINAL,
	TCENTER_RADIUS_ASTART_AEND
} Tcircle_arc_type;

EFFECT

This function generates a structure representing an arc defined either

- by the center of the circle, the starting point of the arc and its angle

- by the center of the circle, the starting point and the end point of the arc.

- by the starting point, the middle point and the end point of the arc.

- by the center of the circle, the circle radius, the starting angle and the end angle.

The arc is shown by a certain number of points. The distribution of these points can be controlled by first calling the tset_step_angle function to define the angle separating two points.

Depending on the setting of the flag open_close, the arc is represented by the PHIGS primitive polyline (TOPENED_ARC), or by a fill area set primitive (TEND_CLOSE_ARC or TCENTER_CLOSE_ARC)

arc->type = TCENTER_PINIT_ANGLE,

arc->type = TCENTER_PINIT_PFINAL

Arc defined by the geometrical center of the circle (c ), the starting point of the arc (i ) and an endpoint of the arc (f ). If the two given points are not the same distance from the center, the radius chosen will be equal to the distance from the center to the starting point, but the angle of the arc shall remain equal to the angle formed by the three given points. The arc is always drawn from the initial point toward the final point, in the trigonometric sense.

arc->type = TPINIT_PMIDDLE_PFINAL

Arc defined by three given points (i f and m).. The arc begins at the starting point (i ), goes through the middle point (m ) and ends at the endpoint (f ).

arc->type = TCENTER_RADIUS_ASTART_AEND

Arc defined by the geometric center of the circle (c ), the radius of the circle (r ), the initial angle (s ) and the end angle of the arc (e ). These two angles are given in relation to the trigonometric origin.


Previous Next Up Title Contents Index Functions Index Top Library