JPH0120471B2 - - Google Patents
Info
- Publication number
- JPH0120471B2 JPH0120471B2 JP58081467A JP8146783A JPH0120471B2 JP H0120471 B2 JPH0120471 B2 JP H0120471B2 JP 58081467 A JP58081467 A JP 58081467A JP 8146783 A JP8146783 A JP 8146783A JP H0120471 B2 JPH0120471 B2 JP H0120471B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- circuit
- gate
- circle
- carry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired
Links
Landscapes
- Image Generation (AREA)
- Digital Computer Display Output (AREA)
Description
【発明の詳細な説明】
〔発明の技術分野〕
本発明はDDA演算を利用した高速の円の描画
方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a high-speed circle drawing method using DDA operations.
パーソナルコンピユータ等のグラフイツク表示
において円を描画する場合、SIN,COS等の演算
を行なうことにより正確な描画データを求めるこ
とができる。しかし、上記SIN,COS等の演算を
行なつていては演算時間がかかりすぎるために、
従来では適当な角度の内接正多角形で近似円を描
画したり、1/4円周分だけの円周ドツトを計算し、
残りはx軸対称、y軸対称、原点対称な点を求め
ることによつて描画速度を向上するようにしてい
る。
When drawing a circle on a graphic display such as a personal computer, accurate drawing data can be obtained by performing calculations such as SIN and COS. However, performing the above calculations such as SIN and COS takes too much time, so
Conventionally, an approximate circle is drawn using an inscribed regular polygon with an appropriate angle, or circumference dots are calculated for only 1/4 of the circumference.
For the rest, the drawing speed is improved by finding points that are symmetrical about the x-axis, y-axis, and the origin.
上記のように1つの点を求めてから、x軸対
称、y軸対称、原点対称の点を求める場合、円の
中心が座標軸の原点と等しい場合は符号の反転等
で簡単に行なうことができる。しかし、通常は座
標軸の原点と円の中心とは等しくないので、この
場合は中心座標等の値をメモリに記憶させて加減
算命令を行なうことが必要になり、演算処理が複
雑化して処理速度が低下するという問題があつ
た。 After finding one point as above, if you want to find points that are symmetrical about the x-axis, y-axis, or symmetrical about the origin, if the center of the circle is equal to the origin of the coordinate axes, you can easily do this by reversing the sign, etc. . However, since the origin of the coordinate axes and the center of the circle are usually not equal, in this case it is necessary to store values such as the center coordinates in memory and perform addition/subtraction instructions, which complicates the calculation process and slows down the processing speed. There was a problem with the decline.
本発明は上記の点に鑑みてなされたもので、座
標軸の原点と円の中心とが等しくない場合であつ
ても、円周上の描画ドツトを容易に算出でき、高
速描画が可能な円の描画方式を提供することを目
的とする。
The present invention has been made in view of the above points, and even when the origin of the coordinate axes and the center of the circle are not equal, it is possible to easily calculate the dots to be drawn on the circumference of the circle, and to create a circle that can be drawn at high speed. The purpose is to provide a drawing method.
以下図面を参照して本発明の一実施例を説明す
る。本発明はDDA(Digital Differential
Analyzer)という円弧の発生手法を利用したも
ので、まず、このDDAについてその概略を説明
する。第1図において、半径rの円周上の1点po
(xo,yo)が求まつているとき、Δθだけ反時計回
転向きに進んだ円周上の点po+1(xo+1,yo+1)は、
xo+1=rcos(θ+Δθ)
=rcosθcosΔθ−rsinθsinΔθ
=xocosΔθ−yosinΔθ ……(1)
yo+1=rsin(θ+Δθ)
=rsinθcosΔθ+rcosθsinΔθ
=yocosΔθ+xosinΔθ ……(2)
となる。
An embodiment of the present invention will be described below with reference to the drawings. The present invention is a DDA (Digital Differential
First, we will give an overview of this DDA. In Figure 1, a point p o on the circumference of a circle with radius r
When (x o , y o ) is being found, the point p o+1 (x o+1 , y o+1 ) on the circumference that has moved counterclockwise by Δθ is x o+1 = rcos(θ+Δθ) = rcosθcosΔθ−rsinθsinΔθ =x o cosΔθ−y o sinΔθ ……(1) y o+1 = rsin(θ+Δθ) = rsinθcosΔθ+rcosθsinΔθ = y o cosΔθ+x o sinΔθ ……(2).
上記(1),(2)式において、Δθを微小角度とし、
cosΔθ≒1、sinΔθ≒Δθとすれば、
xo+1=xo−Δθ・yo
yo+1=yo+Δθ・xo
となる。さらに、Δθ=ε=2-m(mは正の整数)
とおけば、上式は
xo+1=xo−ε・yo ……(3)
yo+1=yo+ε・xo ……(4)
(但し2m-1<r<2m)
となる。しかし、上式をそのまま用いた場合には
発散してしまうので、上記(4)式のxoをxo+1に置き
換える。このように(4)式のxoをxo+1と置き換える
と、上記(3),(4)式は
xo+1=xo−ε・yo ……(5)
yo+1=yo+ε・xo+1 ……(6)
となり、この(5),(6)式から略真円の値が得られる
ことが従来より確められている。 In equations (1) and (2) above, Δθ is a small angle,
If cosΔθ≒1 and sinΔθ≒Δθ, then x o+1 = x o −Δθ・y o y o+1 = y o +Δθ・x o . Furthermore, Δθ=ε=2 -m (m is a positive integer)
Then, the above formula becomes x o+1 = x o −ε・y o ...(3) y o+1 = y o +ε・x o ...(4) (However, 2 m-1 < r < 2 m ). However, if the above equation is used as is, it will diverge, so x o in equation (4) above is replaced with x o+1 . If x o in equation (4) is replaced with x o+1 in this way, the above equations (3) and (4) become x o+1 = x o −ε・y o ……(5) y o+1 = y o + ε・x o+1 ...(6) It has been confirmed from the past that a value of a substantially perfect circle can be obtained from equations (5) and (6).
本発明は上記(5),(6)式によつて高速に円を描画
するものであり、以下第2図によりその具体的な
実施例について説明する。第2図において11は
xレジスタで、CPU(図示せず)からゲート回路
G1を介してユーザ座標を指定するx座標データ
が入力される。また、12はyレジスタで、
CPUからゲート回路G2を介してユーザ座標を指
定するy座標データが入力される。さらに、13
はRレジスタで、CPUからゲート回路G3を介し
て円の半径を示すデータが入力される。上記半径
を指定するデータは、表示ドツト数で与えられ
る。上記xレジスタ11及びRレジスタ13に保
持されているデータは、ゲート回路G4,G5を介
して加算回路14へ送られると共に、ゲート回路
G6,G7を介して減算回路15へ送られる。上記
加算回路14の加算出力は、ゲート回路G3を介
してxRレジスタ16へ送られる。このxRレジスタ
16は、第3図に示すようにx座標における右半
分のデータを得るためのもので、その出力はゲー
ト回路G9及び−1回路17を介して自己の入力
端に戻されると共に、ゲート回路G10を介して表
示処理部(図示せず)へ送られる。また、上記減
算回路15は、「x−R」の減算を行なうもので、
その減算結果はゲート回路G11を介してxLレジス
タ18へ送られる。このxLレジスタ18は、第3
図に示すようにx座標における左半分のデータを
得るためのもので、その出力はゲート回路G12及
び+1回路19を介して自己の入力端に戻される
と共に、ゲート回路G13を介して表示処理部へ送
られる。 The present invention is for drawing a circle at high speed using the above equations (5) and (6), and a specific embodiment thereof will be described below with reference to FIG. In Figure 2, 11 is the x register, which connects the CPU (not shown) to the gate circuit.
X coordinate data specifying user coordinates is input via G1 . Also, 12 is the y register,
Y coordinate data specifying user coordinates is input from the CPU via the gate circuit G2 . Furthermore, 13
is the R register, into which data indicating the radius of the circle is input from the CPU via the gate circuit G3 . The data specifying the radius is given by the number of display dots. The data held in the x register 11 and the R register 13 are sent to the adder circuit 14 via gate circuits G 4 and G 5 , and
The signal is sent to the subtraction circuit 15 via G 6 and G 7 . The addition output of the addition circuit 14 is sent to the xR register 16 via the gate circuit G3 . This x R register 16 is used to obtain data on the right half of the x coordinate as shown in FIG. 3, and its output is returned to its own input terminal via the gate circuit G9 and the -1 circuit 17. The signal is also sent to a display processing section (not shown) via the gate circuit G10 . Further, the subtraction circuit 15 performs subtraction of "x-R",
The result of the subtraction is sent to the x L register 18 via the gate circuit G11 . This x L register 18 is the third
As shown in the figure, it is used to obtain data on the left half of the x coordinate, and its output is returned to its own input terminal via gate circuit G 12 and +1 circuit 19, and is also displayed via gate circuit G 13 . Sent to the processing section.
一方、上記yレジスタ12に保持されたデータ
は、ゲート回路G14を介してyOVレジスタ21へ入
力されると共に、ゲート回路G15を介してyUDレジ
スタ22へ入力される。上記yOVレジスタ21は、
第3図に示すようにy座標における上半分のデー
タを得るためのもので、その出力はゲート回路
G16及び+1回路23を介して自己の入力端に戻
されると共に、ゲート回路G18を介して表示処理
部へ送られる。また、yUDレジスタ22は、第3
図に示すようにy座標における下半分のデータを
得るためのもので、その出力はゲート回路G17及
び−1回路24を介して自己の入力端に戻される
と共に、ゲート回路G19を介して表示部へ送られ
る。 On the other hand, the data held in the y register 12 is input to the y OV register 21 via the gate circuit G 14 , and is also input to the y UD register 22 via the gate circuit G 15 . The above y OV register 21 is
As shown in Figure 3, it is used to obtain data in the upper half of the y-coordinate, and the output is from the gate circuit.
The signal is returned to its own input terminal via G16 and the +1 circuit 23, and is also sent to the display processing section via the gate circuit G18 . In addition, the y UD register 22
As shown in the figure, it is used to obtain data in the lower half of the y-coordinate, and its output is returned to its own input terminal via gate circuit G 17 and -1 circuit 24, and also via gate circuit G 19 . Sent to the display section.
また、上記Rレジスタ13の保持データは、ゲ
ート回路G20を介してΔxレジスタ25へ送られ
る。このΔxレジスタ25に保持されたデータは、
ゲート回路G21を介して−1回路26へ送られ、
この−1回路26の出力がΔxレジスタ25へ入
力される。また、Δxレジスタ25の保持データ
は、ゲート回路G22を介して“0”判断回路27
へ送られ、その判断結果がCPUへ送られる。さ
らに、上記Δxレジスタ25の保持データは、ゲ
ート回路G23を介して加算回路28へ送られ、そ
の加算出力がゲート回路G24を介してRXレジスタ
29へ入力される。また、このRXレジスタ29
には、CPUから初期設定値「0.5」がゲート回路
G25を介して入力される。そして、このRXレジス
タ29の保持データは、ゲート回路G26を介して
加算回路28へ入力されると共に、ゲート回路
G27を介してキヤリー判別回路30へ送られる。
このキヤリー判別回路30は、RXレジスタ29
のキヤリー信号を検出すると、ゲート回路G16,
G17,G29にゲート信号を与えてそのゲートを開
く。 Further, the data held in the R register 13 is sent to the Δx register 25 via the gate circuit G20. The data held in this Δx register 25 is
is sent to the -1 circuit 26 via the gate circuit G 21 ,
The output of this -1 circuit 26 is input to the Δx register 25. Further, the data held in the Δx register 25 is sent to the “0” judgment circuit 27 via the gate circuit G 22 .
and the judgment result is sent to the CPU. Further, the data held in the Δx register 25 is sent to the adder circuit 28 via the gate circuit G23 , and the added output is input to the Rx register 29 via the gate circuit G24. Also, this R X register 29
In this case, the initial setting value "0.5" is set from the CPU to the gate circuit.
Entered via G25 . The data held in this R
It is sent to the carry discrimination circuit 30 via G27 .
This carry discrimination circuit 30 is connected to the R
When the carry signal of G 16 is detected, the gate circuit G 16 ,
Give gate signals to G 17 and G 29 to open the gates.
また、31はΔyレジスタで、CPUから初期設
定値「0.5」がゲート回路G28を介して与えられ
る。そして、このΔyレジスタ31の出力は、キ
ヤリー判別回路30の出力によつてゲート制御さ
れるゲート回路G29及び+1回路32を介して自
己の入力端に戻されると共に、ゲート回路G30、
加算回路33、ゲート回路G31を介してRyレジス
タ34へ入力される。このRyレジスタ34には、
CPUから初期設定値「0.5」がゲート回路G32を介
して与えられる。上記Ryレジスタ34の保持デ
ータは、ゲート回路G33を介して加算回路33へ
入力されると共に、ゲート回路G34を介してキヤ
リー判別回路35へ送られる。このキヤリー判別
回路35は、Ryレジスタ34におけるキヤリー
信号の有無を判別し、キヤリー信号を検出した際
にゲート回路G9,G12,G21にゲート信号を与え
てそのゲートを開く。上記したようにゲート回路
G9,G12,G21はキヤリー判別回路35によつて
制御され、ゲート回路G16,G17,G29はキヤリー
判別回路30によつてゲート制御されるが、その
他のゲート回路はCPUからの信号によつてゲー
ト制御される。 Further, 31 is a Δy register, to which an initial setting value "0.5" is given from the CPU via the gate circuit G28 . The output of this Δy register 31 is returned to its own input terminal via the gate circuit G 29 and the +1 circuit 32 which are gate-controlled by the output of the carry discriminator circuit 30, and the gate circuit G 30 ,
The signal is input to the Ry register 34 via the adder circuit 33 and the gate circuit G31 . This R y register 34 has
The initial setting value "0.5" is given from the CPU via the gate circuit G32 . The data held in the Ry register 34 is input to the adder circuit 33 via the gate circuit G33, and is also sent to the carry discrimination circuit 35 via the gate circuit G34 . This carry determination circuit 35 determines the presence or absence of a carry signal in the R y register 34, and when a carry signal is detected, provides gate signals to gate circuits G 9 , G 12 , and G 21 to open the gates. Gate circuit as mentioned above
G 9 , G 12 , G 21 are controlled by the carry discrimination circuit 35, gate circuits G 16 , G 17 , G 29 are gate controlled by the carry discrimination circuit 30, but other gate circuits are controlled by the CPU. gated by the signal.
次に上記実施例の動作を第4図のフローチヤー
トを参照して説明する。まず、第4図のステツプ
A1において、CPUからの指令によりゲート回路
G1〜G3のゲートを開き、描画しようとする円の
中心点Qのx座標をxレジスタ11、y座標をy
レジスタ12、半径RをRレジスタ13にセツト
する。例えば半径が8ドツトの円を描く場合に
は、第5図に示すように最下位ビツトを小数点位
置Dp1としてRレジスタ13に「8」つまり2
進数の「1000」をセツトする。次いでステツプ
A2に進んでゲート回路G4〜G8,G11のゲートを開
き、xレジスタ11及びRレジスタ13の内容を
加算回路14で加算してxRレジスタ16にセツト
すると共に、xレジスタ11からRレジスタ13
の内容を減算回路15で減算してxLレジスタ18
にセツトする。以上の処理により、xRレジスタ1
6には描きたい円の最右端のx座標データ(最大
値)がセツトされ、xLレジスタ18には描きたい
円の最左端のx座標データ(最小値)がセツトさ
れる。また、上記ステツプA2では、ゲート回路
G14,G15のゲートを開き、yレジスタ12に保
持しているy座標データをyOVレジスタ21にセ
ツトすると共に、yUDレジスタ22にセツトする。
その後、ステツプA3へ進み、ゲート回路G10,
G13,G18,G19のゲートを開き、xRレジスタ1
6、xLレジスタ18、yOVレジスタ21、yUDレジ
スタ22に保持しているx,y座標データを表示
処理部へ出力し、そのx,y座標点を表示メモリ
(図示せず)に記憶して表示部(図示せず)に表
示する。この時点ではyOVレジスタ21及びyUDレ
ジスタ22には、中心点Qにおけるy座標データ
がそのままセツトされているので、第3図に示す
ようにxRレジスタ16の内容によつて指定される
x軸上の最大点p1及びxLレジスタ18の内容に指
定されるx軸上の最小点p2がプロツトされる。次
いでステツプA4へ進み、ゲート回路G20のゲート
を開き、Rレジスタ13に保持されている半径R
をΔxレジスタ25に書込む。また、上記ステツ
プA4では、ゲート回路G25,G32,G28のゲートを
開き、Rxレジスタ29、Ryレジスタ34に初期
値「0.5」をセツトし、Δyレジスタ31に初期値
「0」をセツトする。上記初期値「0.5」を各レジ
スタ29,34にセツトする場合、第5図に示す
ように半径データに対応するように、小数点の位
置を5ビツト目のDp2の位置に設定してデータ
の書込みを行なう。この結果、各レジスタ25,
34には、第5図に示すように2進数の「1000」
が書込まれる。次にステツプA5に進み、ゲート
回路G30,G33,G31のゲートを開いてΔyレジスタ
31とRyレジスタ34に保持しているデータを
加算回路33で加算し、その加算結果をRyレジ
スタ34に書込む。この場合には「0000+1000=
1000」の2進加算が行なわれ、Ryレジスタ34
には「1000」が書込まれる。次いでステツプA6
に示すようにゲート回路G34のゲートを開いてRy
レジスタ34の内容をキヤリー判別回路35へ読
出してキヤリーの有無を判別する。このキヤリー
判別は、小数点位置を第5図に示すように初期値
の書込みと同じDp2の位置に設定して行なうも
ので、上記したようにRyレジスタ34の内容が
「1000」の場合には、キヤリー検出信号は出力さ
れない。キヤリー信号がない場合はステツプA7
に進んでゲート回路G23,G26,G24のゲートを開
き、Δxレジスタ25とRxレジスタ29の内容
「1000」を加算回路28で加算し、その加算結果
「10000」をRxレジスタ29に書込む。次いでス
テツプA8に進み、ゲート回路G27のゲートを開い
てRxレジスタ29の内容をキヤリー判別回路3
0へ読出してキヤリーの有無を判別する。このキ
ヤリー判別回路30は、上記キヤリー判別回路3
5と同様に小数点位置をDp2の位置に設定して
行なうもので、Rxレジスタ29の内容が
「10000」となつてDp2の位置に“1”信号が書
込まれるとキヤリー検出信号を出力する。このキ
ヤリー検出信号によりゲート回路G29のゲートが
開かれ、ステツプA9に示すようにΔyレジスタ3
1の内容「0000」が+1回路32で+1されて
「0001」となる。また、上記キヤリー判別回路3
0から出力されるキヤリー検出信号によりゲート
回路G16,G17のゲートが開かれ、ステツプA10に
示すようにyOVレジスタ21の内容が+1回路2
3によつて+1されると共に、yUDレジスタ22
の内容が−1回路24によつて−1される。その
後、ステツプA11へ進み、ゲート回路G10,G13,
G18,G19のゲートを開き、xRレジスタ16、xL
レジスタ18、yOVレジスタ21、yUDレジスタ2
2に保持しているx,y座標データを表示処理部
へ出力し、そのx,y座標点を表示メモリ記憶し
て表示部に表示する。すなわち、第3図に示すよ
うにx,y座標の第1象限A1においてはxRレジ
スタ16及びyOVレジスタ21の内容により、第
2象限A2においてはxLレジスタ18及びyOVレジ
スタ21の内容により、第3象限A3においては
xLレジスタ18及びyUDレジスタ22の内容によ
り、第4象限においてはxRレジスタ16及びyUD
レジスタ22の内容により、円のx,y座標点を
表示メモリにプロツトし、表示部に表示する。こ
のようにして第3図のx軸上のp1点及びp2点を基
準として描画する円のプロツトを開始する。その
後、ステツプA12に進み、ゲート回路G22のゲー
トを開き、Δxレジスタ25の内容を“0”判断
回路27へ読出して「0」か否かを判断し、その
判断結果をCPUへ出力する。そして、Δxレジス
タ25の内容が「0」でなければステツプA5に
戻り、同様の処理を繰返す。そして、ステツプ
A5において、Ryレジスタ34にΔyレジスタ31
の内容を加算した際にキヤリー信号を生じると、
キヤリー判別ステツプA6を経てステツプA13に進
む。このステツプA13では、キヤリー判別回路3
5から出力されるキヤリー検出信号によりゲート
回路G21のゲートを開き、Δxレジスタ25の保持
データを−1回路26により「−1」する。ま
た、上記キヤリー判別回路35から出力されるキ
ヤリー検出信号によりゲート回路G9,G12のゲー
トを開き、xRレジスタ16の内容を−1回路17
で「−1」すると共に、xLレジスタ18の内容を
+1回路19により「+1」する。その後、ステ
ツプA7に進んで上記した処理を繰返す。すなわ
ち、Δxレジスタ25、Δyレジスタ31、Rxレジ
スタ29、Ryレジスタ34、加算回路28,3
3、+1回路32、−1回路26からなる回路に、
円の半径Rを与えて原点を中心とする円に対する
DDA計算、つまり上記(5)式、(6)式によるDDA計
算を行なわせ、この計算により求まつたx,yの
変化分を座標用レジスタ16,18,21,22
においてQ点を中心とする円で変化させるように
したものである。またこの場合、第3図に示すよ
うにx軸上のp1点、p2点から円弧をスタートさせ
るが、x軸に対して上下の点が対称であるので、
1つの計算を行なつたとき同時に対称の2点を求
めることができる。しかして、最初半径Rがセツ
トされたΔxレジスタ25の内容が第4図に示す
処理によつて順次「−1」され、「0」に達する
と“0”判断回路27によりその状態が検出さ
れ、“0”検出信号がCPUへ送られて処理を終了
する。 Next, the operation of the above embodiment will be explained with reference to the flowchart of FIG. First, follow the steps in Figure 4.
At A 1 , the gate circuit is activated by a command from the CPU.
Open the gates G 1 to G 3 and set the x coordinate of the center point Q of the circle to be drawn in the x register 11 and the y coordinate in the y register.
Set the radius R in register 12 and R register 13. For example, when drawing a circle with a radius of 8 dots, as shown in FIG .
Set the base number to “1000”. Then step
Proceed to A2 , open the gates of gate circuits G4 to G8 , G11, add the contents of the x register 11 and R register 13 in the adder circuit 14, set it in the x R register 16, and add the contents of the x register 11 and R register 13. R register 13
The contents of are subtracted by the subtraction circuit 15 and x L register 18
Set to . By the above processing, x R register 1
The x-coordinate data (maximum value) of the rightmost edge of the circle to be drawn is set in 6, and the x-coordinate data (minimum value) of the leftmost edge of the circle to be drawn is set in the xL register 18. Also, in step A2 above, the gate circuit
The gates G 14 and G 15 are opened, and the y coordinate data held in the y register 12 is set in the y OV register 21 and the y UD register 22.
After that, proceed to step A3 , and gate circuit G10 ,
Open the gates of G 13 , G 18 , G 19 and set x R register 1
6. Output the x, y coordinate data held in the x L register 18, y OV register 21, and y UD register 22 to the display processing unit, and store the x, y coordinate point in the display memory (not shown). and displayed on a display unit (not shown). At this point, the y coordinate data at the center point Q is set in the y OV register 21 and the y UD register 22, so the x coordinate data specified by the contents of the x R register 16 as shown in FIG. The maximum point p 1 on the axis and the minimum point p 2 on the x-axis specified by the contents of the x L register 18 are plotted. Next, proceed to step A4 , open the gate of the gate circuit G20 , and set the radius R held in the R register 13.
is written to the Δx register 25. In step A4 , the gates of the gate circuits G 25 , G 32 , and G 28 are opened, the R x register 29 and the Ry register 34 are set to the initial value "0.5", and the Δy register 31 is set to the initial value "0.5". ”. When setting the above initial value "0.5" to each register 29, 34, set the decimal point position to the 5th bit D p 2 position to correspond to the radius data as shown in FIG. Write. As a result, each register 25,
34 is the binary number "1000" as shown in Figure 5.
is written. Next, proceed to step A5 , open the gates of gate circuits G30 , G33 , and G31 , add the data held in the Δy register 31 and the Ry register 34 in the adder circuit 33, and add the addition result to R. Write to y register 34. In this case, “0000+1000=
1000'' is performed, and the R y register 34 is
"1000" is written in. Then step A 6
Open the gate of gate circuit G 34 as shown in R y
The contents of the register 34 are read out to a carry determination circuit 35 to determine the presence or absence of a carry. This carry determination is performed by setting the decimal point position to the same D p 2 position as the initial value is written as shown in Figure 5. As mentioned above, if the content of the R y register 34 is "1000" No carry detection signal is output. If there is no carry signal, step A 7
, open the gates of gate circuits G 23 , G 26 , and G 24 , add the contents “1000” of the Δx register 25 and the R x register 29 in the adder circuit 28 , and add the addition result “10000” to the R x register 29 write to. Next, proceed to step A8 , open the gate of gate circuit G27 , and transfer the contents of R x register 29 to carry discrimination circuit 3.
It is read to 0 to determine the presence or absence of a carry. This carry discriminating circuit 30 includes the above-mentioned carry discriminating circuit 3.
5, the decimal point position is set to the D p 2 position, and when the content of the R x register 29 becomes “10000” and a “1” signal is written to the D p 2 position, a carry is detected. Output a signal. This carry detection signal opens the gate of gate circuit G29 , and as shown in step A9 , Δy register 3
The content of 1 "0000" is increased by +1 in the +1 circuit 32 to become "0001". In addition, the above-mentioned carry discrimination circuit 3
The gates of gate circuits G 16 and G 17 are opened by the carry detection signal output from y OV register 21 as shown in step A 10 .
+1 by 3, and y UD register 22
The content of is decremented by -1 by the -1 circuit 24. After that, proceed to step A 11 , and gate circuits G 10 , G 13 ,
Open the gates of G 18 and G 19 , x R register 16, x L
Register 18, y OV register 21, y UD register 2
The x, y coordinate data held in 2 is output to the display processing section, and the x, y coordinate point is stored in the display memory and displayed on the display section. That is, as shown in FIG. 3, in the first quadrant A 1 of the x, y coordinates, the contents of the x R register 16 and the y OV register 21 are determined, and in the second quadrant A 2 , the contents of the x L register 18 and the y OV register 21 are According to the content of , in the third quadrant A 3 ,
Due to the contents of the x L register 18 and the y UD register 22, in the fourth quadrant, the x R register 16 and the y UD
Based on the contents of the register 22, the x and y coordinate points of the circle are plotted in the display memory and displayed on the display section. In this way, we begin plotting a circle based on points p 1 and p 2 on the x-axis in FIG. 3 as reference points. After that, proceed to step A12 , open the gate of the gate circuit G22 , read the contents of the Δx register 25 to the "0" judgment circuit 27, judge whether it is "0" or not, and output the judgment result to the CPU. . If the contents of the Δx register 25 are not "0", the process returns to step A5 and the same process is repeated. And step
At A 5 , Δy register 31 is set to R y register 34.
If a carry signal is generated when the contents of are added,
Proceed to step A13 via carry determination step A6 . In this step A13 , the carry discrimination circuit 3
The gate of the gate circuit G 21 is opened by the carry detection signal outputted from the Δx register 25, and the data held in the Δx register 25 is set to “−1” by the −1 circuit 26. Further, the gates of gate circuits G 9 and G 12 are opened by the carry detection signal outputted from the carry discrimination circuit 35, and the contents of the xR register 16 are changed to -1 circuit 17.
At the same time, the contents of the x L register 18 are set to "+1" by the +1 circuit 19. Thereafter, proceed to step A7 and repeat the above process. That is, the Δx register 25, the Δy register 31, the R x register 29, the R y register 34, and the adder circuits 28 and 3.
3, a circuit consisting of a +1 circuit 32 and a -1 circuit 26,
For a circle centered at the origin given the radius R of the circle
The DDA calculation, that is, the DDA calculation using the above equations (5) and (6), is performed, and the changes in x and y determined by this calculation are stored in the coordinate registers 16, 18, 21, 22.
The change is made in a circle centered on point Q. In this case, as shown in Figure 3, the arc starts from points p1 and p2 on the x-axis, but since the upper and lower points are symmetrical with respect to the x-axis,
When performing one calculation, two symmetrical points can be found at the same time. Thus, the contents of the Δx register 25, in which the radius R was initially set, are sequentially incremented to "-1" by the process shown in FIG. , a "0" detection signal is sent to the CPU, and the process ends.
なお、上記実施例では、円を描画する場合につ
いて示したが、キヤリー判別回路30,35のキ
ヤリー判別タイミングを補正することにより、横
長あるいは縦長の楕円を描画することができる。 In the above embodiment, a case where a circle is drawn is shown, but by correcting the carry discrimination timing of the carry discrimination circuits 30 and 35, a horizontally long or vertically long ellipse can be drawn.
また、上記実施例では、円をグラフイツク表示
する場合について示したが、その他例えばX−Y
プロツタ等においてプリントする場合でも同様に
して実施し得るものである。 Further, in the above embodiment, a case where a circle is displayed graphically is shown, but in other cases, for example, X-Y
The same method can be used when printing on a plotter or the like.
本発明によれば、X軸に対し上下対称の座標デ
ータを同時に求めながら最右端及び最左端から円
を描画するので、任意の円を高速に描くことがで
きる。
According to the present invention, a circle is drawn from the rightmost end and the leftmost end while simultaneously obtaining vertically symmetrical coordinate data with respect to the X-axis, so any circle can be drawn at high speed.
また、1/4円弧分の計算で円が描け、従来の対
称点計算や面倒な絶対座標とユーザ座標との変換
計算を行なわなくてすむ。 In addition, a circle can be drawn by calculating 1/4 arc, eliminating the need for conventional symmetric point calculations and troublesome conversion calculations between absolute coordinates and user coordinates.
図面は本発明の一実施例を示すもので、第1図
a,bはDDAによる円弧発生手段を説明するた
めの図、第2図は回路構成図、第3図は円の描画
状態を示す図、第4図は第2図の動作内容を示す
フローチヤート、第5図はレジスタの小数点位置
設定状態を示す図である。
11……xレジスタ、12……yレジスタ、1
3……Rレジスタ、14,28,33……加算回
路、15……減算回路、16……xRレジスタ、1
7,24,26……−1回路、18……xLレジス
タ、19,23,32……+1回路、21……
yOVレジスタ、22……yUDレジスタ、27……
“0”判断回路、25……Δxレジスタ、29……
Rxレジスタ、30,35……キヤリー判別回路、
31……Δyレジスタ、34……Ryレジスタ。
The drawings show one embodiment of the present invention, and FIGS. 1a and 1b are diagrams for explaining the arc generating means by DDA, FIG. 2 is a circuit configuration diagram, and FIG. 3 is a drawing state of a circle. 4 is a flowchart showing the operation contents of FIG. 2, and FIG. 5 is a diagram showing the setting state of the decimal point position of the register. 11...x register, 12...y register, 1
3...R register, 14,28,33...addition circuit, 15...subtraction circuit, 16...x R register, 1
7, 24, 26...-1 circuit, 18...x L register, 19, 23, 32...+1 circuit, 21...
y OV register, 22...y UD register, 27...
"0" judgment circuit, 25...Δx register, 29...
R x register, 30, 35... Carry discrimination circuit,
31...Δy register, 34... Ry register.
Claims (1)
ータとから、この円の最右端のX座標データと最
左端のX座標データを求める手段と、この手段に
より求められた両X座標データを記憶するX座標
データ記憶手段と、描画すべき円の中心のY座標
データを記憶するY座標データ記憶手段と、円を
求めるDDA演算により逐時得られるデータに基
づき、これら記憶手段の各座標データを変化させ
てX軸に対し上下対称の座標データを同時に求め
ながら、最右端及び最左端から円の描画データを
生成する生成手段とを備える円の描画方式。1. Means for determining the X-coordinate data of the rightmost end and the X-coordinate data of the leftmost end of the circle to be drawn from the X-coordinate data of the center and radius data, and storing both X-coordinate data determined by this means. An X coordinate data storage means for storing Y coordinate data of the center of the circle to be drawn, and a Y coordinate data storage means for storing Y coordinate data of the center of the circle to be drawn, and each coordinate data of these storage means is A circle drawing method comprising a generation means for generating circle drawing data from the rightmost end and the leftmost end while simultaneously obtaining vertically symmetrical coordinate data with respect to the X-axis.
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8146783A JPS59206937A (en) | 1983-05-10 | 1983-05-10 | Drawing system of circle or ellipse |
US06/604,057 US4692887A (en) | 1983-05-10 | 1984-04-26 | Circle and circular arc generator |
GB08411032A GB2141608B (en) | 1983-05-10 | 1984-04-30 | Circle and circular arc generator |
DE3417407A DE3417407C2 (en) | 1983-05-10 | 1984-05-10 | Circle generator for a graphic display unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8146783A JPS59206937A (en) | 1983-05-10 | 1983-05-10 | Drawing system of circle or ellipse |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS59206937A JPS59206937A (en) | 1984-11-22 |
JPH0120471B2 true JPH0120471B2 (en) | 1989-04-17 |
Family
ID=13747201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP8146783A Granted JPS59206937A (en) | 1983-05-10 | 1983-05-10 | Drawing system of circle or ellipse |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS59206937A (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57146344A (en) * | 1981-03-06 | 1982-09-09 | Toshiba Corp | Digital operating device |
-
1983
- 1983-05-10 JP JP8146783A patent/JPS59206937A/en active Granted
Also Published As
Publication number | Publication date |
---|---|
JPS59206937A (en) | 1984-11-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4853494A (en) | Information processing apparatus for inputting coordinate data selectively from either the obverse or the reverse surface of an input tablet | |
US4692887A (en) | Circle and circular arc generator | |
JPH0120471B2 (en) | ||
JPH0449116B2 (en) | ||
JPH0667799A (en) | Pen type computer input device | |
JPH0120472B2 (en) | ||
JPS6363948B2 (en) | ||
EP0199160B1 (en) | Method for generating a circular or elliptic arc | |
JPS629954B2 (en) | ||
JPH0145662B2 (en) | ||
JPS6272078A (en) | Circle filling drawing device | |
JPS62161069A (en) | Apparatus for forming writing address of radar memory | |
EP0293698A2 (en) | Graphic controller having function of painting designated area | |
JPS5927370A (en) | Graph generating circuit | |
JPH04148284A (en) | Digital plotting device | |
JPH01209522A (en) | Coordinate input device | |
JPS6048757B2 (en) | Color surface graphic display processing device | |
JPH08110836A (en) | Data interpolation processing method | |
JPH07282118A (en) | Time chart preparing device | |
JPS62219079A (en) | Graphic enlarging system | |
JPH02161574A (en) | Method and device for paint out outline font constituting character for each element | |
JPH0528392B2 (en) | ||
JPH0676071A (en) | Ellipse drawing device | |
JPS61292679A (en) | Graphic display unit | |
JPH0611363A (en) | Data reading system of display device |