Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Method for Drawing a Straight Line Between Two Points

IP.com Disclosure Number: IPCOM000059740D
Original Publication Date: 1986-Jan-01
Included in the Prior Art Database: 2005-Mar-08
Document File: 3 page(s) / 32K

Publishing Venue

IBM

Related People

Mamiya, J: AUTHOR [+2]

Abstract

This article relates to generating signals showing an approximate line of a straight line between two points (X1, Y1) and (X2, Y2). The method described here takes the steps shown in Fig. (Image Omitted) As shown in Fig. 2, there are eight octants. At a first octant (111), (X+1, Y) or (X+1, Y+1) can be selected. At a second octant (011), (X+1, Y+1) or (X, Y+1) can be selected. At a third octant (001), (X, Y+1) or (X-1, Y+1) can be selected. At a fourth octant (101), (X-1, Y+1) or (X-1, Y) can be selected. At a fifth octant (100), (X-1, Y) or (X-1, Y-1) can be selected. At a sixth octant (000), (X-1, Y-1) or (X,Y-1) can be selected. At a seventh octant (010), (X,Y-1) or (X+1, Y-1) can be selected. At an eighth octant (110), (X+1, Y-1) or (X+1, Y) can be selected.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

Method for Drawing a Straight Line Between Two Points

This article relates to generating signals showing an approximate line of a straight line between two points (X1, Y1) and (X2, Y2). The method described here takes the steps shown in Fig.

(Image Omitted)

As shown in Fig. 2, there are eight octants. At a first octant (111), (X+1, Y) or (X+1, Y+1) can be selected. At a second octant (011), (X+1, Y+1) or (X, Y+1) can be selected. At a third octant (001), (X, Y+1) or (X-1, Y+1) can be selected. At a fourth octant (101), (X-1, Y+1) or (X-1, Y) can be selected. At a fifth octant (100), (X-1, Y) or (X-1, Y-1) can be selected. At a sixth octant (000), (X-1, Y-1) or (X,Y-1) can be selected. At a seventh octant (010), (X,Y-1) or (X+1, Y-1) can be selected. At an eighth octant (110), (X+1, Y-1) or (X+1, Y) can be selected. The initially set octant is proper when the sign of ALPHA is different from BETA. In the above example, the sign of ALPHA (positive) is different from the sign of BETA (negative). So, the initially set octant = 111 is proper. In the case where the (X1, Y1) is (1, 1) and (X2, Y2) is (-1, 7), ALPHA = (-1)-l+1-7=-8 BETA = l-7=-6 The sign of ALPHA is the same as the sign of BETA. So, the octant = 111 is not proper, and the octant must be changed. An octant change can occur in the clockwise direction and the counterclockwise direction. Fig. 3 shows the octant change in the counterclockwise direction. The octant change can be accomplished by changing three bits (XMAJOR, XINC, YINC) showing a particular octant and changing ALPHA or BETA. As shown in Fig. 3, an ALPHA change and a BETA change occur alternatively. The bit XMAJOR will be inverted when the signs of ALPHA and BETA are the same and the ALPHA change has occurred in the last octant change. The bit XINC or YINC will be inverted when the signs of ALPHA and BETA are the same and the BETA change has occurred in the last octant change. The first octant (111) is changed to the second octant
(011) by inverting the bit XMAJOR and changing BETA in accordance with the following equation: BETA = ALPHA - BETA = -8-6=-2 In the second octant, the sign of BETA is the same as the...