JPS6370387A - Circular arc drawing system - Google Patents

Circular arc drawing system

Info

Publication number
JPS6370387A
JPS6370387A JP21437486A JP21437486A JPS6370387A JP S6370387 A JPS6370387 A JP S6370387A JP 21437486 A JP21437486 A JP 21437486A JP 21437486 A JP21437486 A JP 21437486A JP S6370387 A JPS6370387 A JP S6370387A
Authority
JP
Japan
Prior art keywords
coordinate
function
coordinates
mode
output
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.)
Pending
Application number
JP21437486A
Other languages
Japanese (ja)
Inventor
Katsuhide Kurihara
勝秀 栗原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP21437486A priority Critical patent/JPS6370387A/en
Publication of JPS6370387A publication Critical patent/JPS6370387A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To rapidly and accurately draw a circular arc by setting up a function (s) indicating the degree of reduction of an X coordinate in accordance with the increase of a Y coordinate and outputting the output of an (s) inspection device through an X coordinate device or a 45 deg. inspection device in accordance with a condition. CONSTITUTION:A mode is set up by a mode setting means 1 in accordance with a required approximate mode and the initial value of the function (s) indicating the degree of reduction of the X coordinate in accordance with the center coordinates (x0, y0) of a circle, its radius (r) and the increase of the Y coordinate is set up. An (s) calculating device 3 increases the Y coordinate and calculates the change of the function (s) based on the shown and equality. When the calculated (s) is s>=0, the output is informed to an X coordinate changing device 5, and at the time of s<0, the output is informed to the 45 deg. inspection device 6. The device 5 reduces the X coordinate by one unit to calculate the value of (s) and returns the calculated result to the device 4. On the other hand, the device 6 receives the information from the device 4 and compares the X and Y coordinates with each other. When the Y coordinate is smaller or equal than/to the X coordinate, the coordinate is returned to the device 3, and in case of larger than the X coordinate, the processing is completed. The X and Y coordinates are replaced and transferred to 45-90 deg., their codes are replaced to transfer the images to other quadrants and the circular arc is formed by a digital differential analyzer.

Description

【発明の詳細な説明】 [概 要] グラフィックディスプレイ等において円弧を描画する方
式であって、従来のように基準円の座標値テーブルを格
納しておく必要がなく、任意の指定した近似精度により
逐次ノンパラメトリックに発生するものである。
[Detailed Description of the Invention] [Summary] This is a method for drawing circular arcs on graphic displays, etc., and there is no need to store a coordinate value table of a reference circle as in the past, and it is possible to draw arcs using any specified approximation accuracy. It occurs sequentially and nonparametrically.

[産業上の利用分野] 本発明はグラフィックディスプレイ等において円弧を描
画する方式に関する。
[Industrial Field of Application] The present invention relates to a method for drawing circular arcs in graphic displays and the like.

ディスプレイ上に円弧を描くことは、グラフィックディ
スプレイばかりではなく、キャラクタディスプレイにお
いても、円グラフ表示等のために用いられており、所要
記憶容量の少なく、且つ使用目的に応じて精度が可変で
ある円弧の描画方式が要望されている。
Drawing an arc on a display is used not only for graphic displays but also for character displays, such as pie chart display, etc. It is an arc that requires less storage capacity and whose precision can be varied depending on the purpose of use. There is a demand for a drawing method.

[従来の技術] グラフィックディスプレイ等において、円弧を描画する
ためには、従来は一般に次の方式が採られていた。
[Prior Art] Conventionally, the following method has been generally used to draw an arc in a graphic display or the like.

即ち、円を多角形近似し、近似多角形の精度骨の基準円
の座標テーブル、若しくはSin、 Cosのテーブル
を格納しておいて、これを読み出し円上の点り求め、こ
れらの点間を順次ディジタル微分解析機により直線を発
生させて結ぶものである。
That is, a circle is approximated as a polygon, the accuracy of the approximate polygon is stored as a coordinate table of the reference circle of the bone, or a table of sin and cos, and this is read out to find the points on the circle, and the distance between these points is calculated. Straight lines are sequentially generated and connected using a digital differential analyzer.

[発明が解決しようとする問題点コ 上記に説明した従来の円弧描画方式によれば、必要とす
るうちで最も高い精度を持つ少な(とも1/8円の基準
円の座標値テーブル(若しくはSin、 Cosテーブ
ル)を備えておく必要があり、相当な記憶容量を要する
[Problems to be Solved by the Invention] According to the conventional arc drawing method described above, a coordinate value table (or sin , Cos table), which requires a considerable amount of storage capacity.

本発明は、このような従来の問題点を解消し、テーブル
を備える必要な(、且つ任意に近似精度を設定できる新
規な円弧描画方式を提供しようとするものである。
The present invention aims to solve these conventional problems and provide a novel arc drawing method that requires a table (and can arbitrarily set approximation accuracy).

[問題点を解決するための手段] 第1図は本発明の円弧描画方式の原理ブロック図を示す
[Means for Solving the Problems] FIG. 1 shows a block diagram of the principle of the arc drawing method of the present invention.

図において、1はモード設定手段であり、所望の近似精
度に応じてモードを設定する。
In the figure, reference numeral 1 denotes a mode setting means, which sets the mode according to desired approximation accuracy.

2は初期条件設定手段であり、描画しようとする円の中
心座標”o、yo ) 、半径(r)、およびモード設
定手段1により設定されたモード(md)により、X座
標のインクリメント(inc=2″′画素単位)を算定
し、X座標、X座標、および関数Sの初期値(x=r、
y=o、5=−r)を設定する。
2 is an initial condition setting means, which increments the X coordinate (inc= 2″′ pixel unit), and calculate the X coordinate, the X coordinate, and the initial value of the function S (x=r,
y=o, 5=-r).

3はS算定手段であり、X座標を初期条件設定手段2に
より算定したインクリメントにより増加させ、それに伴
う関数Sの変化を次の式により算定する。
3 is an S calculation means, which increases the X coordinate by the increment calculated by the initial condition setting means 2, and calculates the accompanying change in the function S using the following equation.

s=s+y*2ys+im (ys = md + 1 、 im= inc* 2
”)4はS検査手段であって、S算定手段3により算定
したSの正負を検査して、Sが正または0であれば手段
5へ通知し、Sが負であれば手段6へ通知する。
s=s+y*2ys+im (ys=md+1, im=inc*2
”) 4 is an S testing means, which tests whether S calculated by the S calculation means 3 is positive or negative, and if S is positive or 0, it notifies the means 5, and if S is negative, it notifies the means 6. do.

5はX座標変更手段であり、S検査手段4から通知され
たならば、X座標を1単位減少させ(X=x−1)、こ
れに伴うSの変化(s=s−2*X)を算定し、S検査
手段4に戻す。
5 is an X coordinate changing means, and when notified from the S inspection means 4, it decreases the X coordinate by 1 unit (X=x-1) and changes S accordingly (s=s-2*X). is calculated and returned to the S inspection means 4.

6は45度検査手段であり、S検査手段4から通知を受
けたならば、そのときのX座標がX座標より大きいかを
判断し、小さいかまたは等しければそのX座標、X座標
を出力してS算定手段3に戻り、大きければ終了する。
6 is a 45 degree inspection means, and when it receives a notification from the S inspection means 4, it judges whether the X coordinate at that time is larger than the X coordinate, and if it is smaller or equal, outputs the X coordinate and the X coordinate. Then, the process returns to the S calculation means 3, and if it is larger, the process ends.

これら順次出力された点のX座標とX座標を入れ替える
ことにより45〜90度に写像し、符号を変えることに
より他の象限に写像して、これらの各点の間を順次ディ
ジタル微分解析機により直線を発生させて結ぶことによ
り円弧を描く。
By swapping the X coordinates of these sequentially output points, they are mapped to 45 to 90 degrees, and by changing the signs, they are mapped to other quadrants, and the points between these points are sequentially mapped using a digital differential analyzer. Draw an arc by generating straight lines and connecting them.

[作用コ 上記構成により、任意に円の近似精度をモードとして設
定して、円弧を描くことができる。
[Operation] With the above configuration, a circular arc can be drawn by arbitrarily setting the circle approximation accuracy as the mode.

モードは、整数0,1,2,3.−で与えられ、そのと
きのX座標の増加分(inc)はそれぞれ、2°=1ド
ツト 2’  =2ドツト 22=4ドツ)、2’=8
ドツト、−となる。
The mode is an integer 0, 1, 2, 3. -, and the increment (inc) of the X coordinate at that time is 2° = 1 dot, 2' = 2 dots, 22 = 4 dots), 2' = 8
Dot becomes -.

即ち、円を何ドツトおきに近似するかを指定するもので
あり、モードOを指定したときは、円はドツト単位で描
かれる。
That is, it specifies how many dots apart a circle should be approximated, and when mode O is specified, the circle is drawn dot by dot.

本発明による円弧描画の原理は、ホーンのアルゴリズム
(Ilorn’s Algoritbm)を拡張したも
のによっている。
The principle of arc drawing according to the present invention is based on an extension of Ilorn's algorithm.

本発明による円弧描画のための演算は、加減算およびシ
フト演算のみで行うことができ、1点を計算するに要す
る演算回数は次のとおりである。
The calculations for drawing an arc according to the present invention can be performed only by addition, subtraction and shift calculations, and the number of calculations required to calculate one point is as follows.

ただし、計算された点が必ずしも出力の対象とはならな
い。即ち、S検査手段4による検査の結果、Sが正また
はゼロである点は、出力されない無効点であり、単に計
算の途上で得られる点である。
However, the calculated points are not necessarily the targets of output. That is, as a result of the test by the S test means 4, points where S is positive or zero are invalid points that are not output, and are simply points obtained during calculation.

演算種類     最大   最小 加減算     4回   3回 シフト     2回   1回 インクリメント   1回   0回 テスト     1回   1回 ここで、最大、最小とはX座標変更手段5による処理を
要したか否かの相違である。
Type of operation Maximum Minimum Addition/Subtraction 4 times 3 times Shift 2 times 1 time Increment 1 time 0 times Test 1 time 1 time Here, the maximum and minimum are the differences in whether or not processing by the X coordinate changing means 5 is required.

第2図は、本発明による円弧描画の例を示す図であって
、3種の精度(モード)により描画した例を示している
FIG. 2 is a diagram showing an example of arc drawing according to the present invention, and shows an example of drawing with three types of accuracy (mode).

図において、C印は出力された点を示し、Δ印は円上の
点(○)を見付けるまでに計算された出力されない点を
示し、X印は直線発生機が埋める点を示している。
In the figure, the C mark indicates an output point, the Δ mark indicates a point that is calculated until finding the point (○) on the circle and is not output, and the X mark indicates a point filled in by the line generator.

一番内側の円弧は、半径5ドツト、モードO(X座標の
増加分1ドツト)で描画したものであり、ホーンのアル
ゴリズムそのものとなっている。
The innermost arc is drawn with a radius of 5 dots and mode O (1 dot per increment in the X coordinate), which is exactly the Horn algorithm.

中間の円弧は、半径10ドフト、モード1  (X座標
の増加分2ドツト)で描画したものである。
The middle arc is drawn with a radius of 10 dots and mode 1 (2 dots per increment in the X coordinate).

一番外側の円弧は、半径20ドツト、モード2(X座標
の増加分4ドツト)で描画したものである。
The outermost circular arc has a radius of 20 dots and is drawn in mode 2 (4 dots per increment in the X coordinate).

このように、本発明による円弧描画方式は次の特徴を有
する。
As described above, the arc drawing method according to the present invention has the following features.

(1)近似精度が可変であり、必要に応じて高速性或い
は正確さを選択可能である。
(1) Approximation accuracy is variable, and high speed or accuracy can be selected as necessary.

(2)近似精度の指定が、モード、即ち「何ドツトおき
に近似するか」であるから、円の半径が大きくなれば近
似多角形の角数もそれに応じて増加し、従って描画精度
が相対的に上がる。
(2) The approximation accuracy is specified by the mode, that is, "how many dots to approximate", so as the radius of the circle increases, the number of angles of the approximate polygon increases accordingly, and therefore the drawing accuracy becomes relatively The target will rise.

(3)描画に必要な演算は、加減算、シフト演算のみで
行うことができる。従って、ハードウェア化して高速描
画が可能である。
(3) Operations necessary for drawing can be performed only by addition, subtraction, and shift operations. Therefore, it is possible to perform high-speed drawing by using hardware.

[実施例コ 以下第3図および第4図に示す実施例により、本発明を
さらに具体的に説明する。
[Example] The present invention will be explained in more detail with reference to an example shown in FIGS. 3 and 4.

第3図は、本発明の一実施例における処理を示すフロー
チャートである。 図において、ステップ■は初期条件
設定であり、y方向の増加分(inc)を算定し、円の
中心座標(xo、 yo )および半径(r)を設定し
、補助変数YS、imを定義し、X座標、X座標および
関数Sの初期値を設定する。
FIG. 3 is a flowchart showing processing in one embodiment of the present invention. In the figure, step ■ is initial condition setting, which calculates the increment in the y direction (inc), sets the center coordinates (xo, yo) and radius (r) of the circle, and defines auxiliary variables YS and im. , the X coordinate, the X coordinate and the initial value of the function S are set.

ステップ■は、X座標を増加分(inc)によってイン
クリメントし、それに伴うSの変化を算定する。
Step (2) increments the X coordinate by an increment (inc) and calculates the change in S associated with the increment.

ステップ■は、Sの正負を検査し、Sが正またはゼロで
あればステップ■に飛び、負であればステップ■へ進む
Step (2) checks whether S is positive or negative, and if S is positive or zero, the process jumps to step (2), and if it is negative, the process proceeds to step (2).

ステップ■は、X座標をL単位デクリメントし、それに
伴うSの変化を算定して、ステップ■へ戻る。
Step (2) decrements the X coordinate by L units, calculates the accompanying change in S, and returns to step (2).

ステップ■は、yがXより大きくなったかを検査し、大
きければステップ■へ進み、そうでなげればステップ■
へ進む。
Step ■ checks whether y is larger than X. If it is, proceed to step ■; otherwise, step ■
Proceed to.

ステップ■は、前に出力されたx、yで決る点の座標(
xo +x+ yo +y)と新たに出力されたxr。
Step ■ is the coordinates of the point determined by the previously output x and y (
xo +x+ yo +y) and the newly output xr.

yrで決る点の座標(xo +xr、yo +yr)の
間に直線を引き、ステップ■へ戻る。
Draw a straight line between the coordinates (xo + xr, yo + yr) of the point determined by yr, and return to step (2).

ステップ■は、a −2* (xr−yr)を計算し、
点(xo +xr+yo +yr)  と点(xO+x
r  a +yO+yr−a)の間に直線を引く。
Step ■ calculates a −2* (xr−yr),
Point (xo +xr+yo +yr) and point (xO+x
Draw a straight line between r a +yO+yr-a).

これによって、1/8円が描画される。As a result, 1/8 circle is drawn.

第4図は、本発明の一実施例の処理フローである。FIG. 4 is a processing flow of one embodiment of the present invention.

処理フローはC言語で記述され、使用されている記号は
次の意味を持つ。
The processing flow is written in C language, and the symbols used have the following meanings.

s+=    :   、s=s+ <<:  シフト m−:  デクリメント 11)〜118項は名称およびデータ型(整数)の宣言
である。
s+=: , s=s+ <<: Shift m-: Decrement Items 11) to 118 are declarations of names and data types (integers).

120項は補助変数の定義であり、121項は初期条件
の設定である。
Section 120 is the definition of auxiliary variables, and Section 121 is the setting of initial conditions.

122〜124項はyをインクリメントし、これに伴う
Sを計算し、XをXrSYをyrとおくことを示す。
Items 122 to 124 indicate that y is incremented, S is calculated accordingly, and X is set to XrSY as yr.

125項は、Sを検査し、もしSが正またはゼロであれ
ばXをデクリメントし、Sを計算することを示す。
Item 125 indicates to check S, and if S is positive or zero, decrement X and compute S.

126項は、yがXより大きいかを検査し、大きければ
127〜136項を実行し、そうでなければ138〜1
)6項を実行せよを意味する。
Item 126 checks whether y is greater than
) means execute item 6.

127〜136項は、a = 21 (xr−yr)を
計算し、点(xo’ +xr+yo +yr)と点(X
O+xr −a +Vo +yr−a)の間を直線で結
ぶようディジタル微分解析機(dda)に要求すること
、またxrとyrとを入れ替えて同様なことを行うこと
、さらにxrおよびyrの符号を変えて同様なことを行
い、処理を終了せよということを意味する。
Items 127 to 136 calculate a = 21 (xr-yr) and calculate the point (xo' + xr + yo + yr) and the point (X
Request the digital differential analyzer (dda) to connect the line between This means to do the same thing and end the process.

138〜1)6項は、前に出力されたx、yで決る点の
座標(xo +1(、yo +y)と新たに出力された
xr。
138-1) Item 6 is the coordinates of the point determined by the previously output x and y (xo + 1 (, yo + y) and the newly output xr.

yrで決る点の座標(xo + Xr+ Yo +yr
)の間を直線で結ぶようディジタル微分解析機に要求す
ること、またxrとyrとを入れ替えて同様なことを行
うこと、さらにxrおよびyrの符号を変えて同様なこ
とを行い、123項の処理に戻れということを意味する
The coordinates of the point determined by yr (xo + Xr+ Yo +yr
), ask the digital differential analyzer to connect the lines between This means that you should return to processing.

これによって、360度の完成された円弧が描画される
This draws a complete 360 degree arc.

[発明の効果] 以上説明のように本発明によれば、近似精度を任意に指
定することにより、目的に応じて高速性、若しくは正確
さを選択して円弧を描画することが可能となり、その実
用上の効果は極めて大である。
[Effects of the Invention] As explained above, according to the present invention, by arbitrarily specifying the approximation accuracy, it becomes possible to draw an arc by selecting high speed or accuracy depending on the purpose. The practical effects are extremely large.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の原理ブロック図、 第2図は本発明による円弧描画の例を示す図、第3図は
本発明の一実施例における処理を示すフローチャート、 第4図は本発明の一実施例の処理フローである。 図面において、 1はニード設定手段、  2は初期条件設定手段、3は
S算定手段、    4はS検査手段、5はX座標変更
手段、  6は45度検査手段、をそれぞれ示す。 、トリ月ハ穏狸プロ\IIり仄 勇l圓 不碩%rでよる11:l弧晶画の例a改否図82図
Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is a diagram showing an example of arc drawing according to the invention, Fig. 3 is a flowchart showing processing in an embodiment of the invention, and Fig. 4 is an embodiment of the invention. It is a processing flow of an example. In the drawings, 1 is a need setting means, 2 is an initial condition setting means, 3 is an S calculation means, 4 is an S inspection means, 5 is an X coordinate changing means, and 6 is a 45 degree inspection means. , Example of 11:l arc crystal picture a change/failure diagram 82 by Toritsukiha Yontanuki Pro\II Riri Yuu l Enfusei%r

Claims (1)

【特許請求の範囲】 グラフィックディスプレイ等において円弧を描画する方
式であって、 所望の近似精度に応じてモードを設定するモード設定手
段(1)と、 描画しようとする円の中心座標、半径、およびモード設
定手段(1)により設定されたモードにより、y座標の
増加分を算定し、x座標、y座標、およびy座標の増加
に伴いx座標の減少する度合を示す関数sの初期値を設
定する初期条件設定手段(2)と、y座標を初期条件設
定手段(2)により算定した増加分により増加させ、そ
れに伴う関数sの変化を算定するs算定手段(3)と、 s算定手段(3)により算定した関数sの正負を検査す
るs検査手段(4)と、 s検査手段(4)による検査の結果、関数sが正若しく
はゼロであったとき、x座標を1単位減少させ、これに
伴う関数sの変化を算定するx座標変更手段(5)と、 s検査手段(4)による検査の結果、関数sが負であっ
たとき、y座標がx座標より大きいかを判断し、小さい
かまたは等しければそのx座標、y座標を出力してs算
定手段(3)による処理に戻り、大きければ処理を終了
する45度検査手段(6)とを備え、出力されたx座標
、y座標を順次直線で結ぶことにより円弧を描画するよ
う構成したことを特徴とする円弧描画方式。
[Claims] A method for drawing circular arcs on a graphic display, etc., comprising: mode setting means (1) for setting a mode according to desired approximation accuracy; center coordinates, radius, and According to the mode set by the mode setting means (1), the increase in the y-coordinate is calculated, and the initial value of the x-coordinate, the y-coordinate, and the function s indicating the degree to which the x-coordinate decreases as the y-coordinate increases is set. an initial condition setting means (2) for increasing the y-coordinate by the increment calculated by the initial condition setting means (2), and an s calculation means (3) for calculating a change in the function s associated with the increase, and an s calculation means ( s testing means (4) for testing whether the function s calculated by 3) is positive or negative; and when the function s is positive or zero as a result of the testing by the s testing means (4), the x coordinate is decreased by one unit; When the function s is negative as a result of the inspection by the x-coordinate changing means (5) that calculates the change in the function s associated with this, and the s-checking means (4), it is determined whether the y-coordinate is larger than the x-coordinate. , if they are smaller or equal, output the x and y coordinates and return to the processing by the s calculation means (3), and if larger, terminate the processing, the output x coordinate, An arc drawing method characterized in that an arc is drawn by sequentially connecting y coordinates with straight lines.
JP21437486A 1986-09-11 1986-09-11 Circular arc drawing system Pending JPS6370387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21437486A JPS6370387A (en) 1986-09-11 1986-09-11 Circular arc drawing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21437486A JPS6370387A (en) 1986-09-11 1986-09-11 Circular arc drawing system

Publications (1)

Publication Number Publication Date
JPS6370387A true JPS6370387A (en) 1988-03-30

Family

ID=16654728

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21437486A Pending JPS6370387A (en) 1986-09-11 1986-09-11 Circular arc drawing system

Country Status (1)

Country Link
JP (1) JPS6370387A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0397081A (en) * 1989-09-11 1991-04-23 Hitachi Ltd Graphic display device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0397081A (en) * 1989-09-11 1991-04-23 Hitachi Ltd Graphic display device

Similar Documents

Publication Publication Date Title
US5363479A (en) System and method for rendering bezier splines
US5115402A (en) Scan-conversion process and processor for converting a graphic primitive to a pixel map
US4835722A (en) Curve generation in a display system
US4479192A (en) Straight line coordinates generator
JPS6370387A (en) Circular arc drawing system
EP0349182B1 (en) Method and apparatus for approximating polygonal line to curve
US4974172A (en) Image processing apparatus
US5396586A (en) Apparatus and method for filling regions bounded by conic curves
JPS6232519B2 (en)
JPS63140382A (en) Plotting method for polygonal approximation of circles
JPS59211165A (en) Circular arc generating system
JPH0729022A (en) Straight line plotting device
US4941116A (en) Elliptical arc generator for display systems
JP2878614B2 (en) Image synthesis method and apparatus
JP3913832B2 (en) Circular interpolation processing method
JPH04168581A (en) Approximate curve generating method for hyperellipse
JPH06274613A (en) Curve approximating device
JPH0589251A (en) Picture drawing device
JPH1166328A (en) Curve plotting device
Hong A high precision digital differential analyzer for circle generation
KR910001394B1 (en) Cirde graphics on computer
JPS61158394A (en) Fast circle circular arc generation system
EP0631253B1 (en) A device for use in the digital processing of a graphic image containing a straight line
JPS63118790A (en) End shape correction system for drawing segment with width
JPH01311383A (en) Vector drawing system