reverse


Description:

public int reverse (int sweep)

Reverse the direction of a sweep

This function provides an alternate form of an arc for drawing operations.

This function reverses the direction of the sweep. Both starting angle and ending angle would remain the same. If the input sweep is counterclockwise (positive), the returned sweep will be clockwise (negative). Similarly, if the input sweep is clockwise, the returned sweep will be counterclockwise.

Sweeps of -360, 0, and 360 are handled as special cases. The function does not return a sweep of 0, which would result in a degenrate arc.

Argument Result
(-inf,-360] 360
[-359,-1] argument + 360
0 360
[1,359] argument - 360
[360,+inf) -360

Parameters:

sweep

The sweep angle

Returns:

The sweep in the opposite direction


Namespace: Geda3.Sweep
Package: Gschem3