JP3137050B2 - Area determination apparatus, method, and storage medium - Google Patents

Area determination apparatus, method, and storage medium

Info

Publication number
JP3137050B2
JP3137050B2 JP09267246A JP26724697A JP3137050B2 JP 3137050 B2 JP3137050 B2 JP 3137050B2 JP 09267246 A JP09267246 A JP 09267246A JP 26724697 A JP26724697 A JP 26724697A JP 3137050 B2 JP3137050 B2 JP 3137050B2
Authority
JP
Japan
Prior art keywords
point
determination
obtaining
coordinates
information
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 - Fee Related
Application number
JP09267246A
Other languages
Japanese (ja)
Other versions
JPH11110574A (en
Inventor
誠一 浜村
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP09267246A priority Critical patent/JP3137050B2/en
Publication of JPH11110574A publication Critical patent/JPH11110574A/en
Application granted granted Critical
Publication of JP3137050B2 publication Critical patent/JP3137050B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、直交座標系上の任
意の点が多角形によって表現される閉領域内に含まれる
か否かを判定する領域判定装置、方法及びこの方法を実
現するためのプログラムを記憶した記憶媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an area determining apparatus and method for determining whether an arbitrary point on a rectangular coordinate system is included in a closed area represented by a polygon, and a method for realizing the method. And a storage medium storing the program.

【0002】[0002]

【従来の技術】LSI(Large Scall Integrated Circu
it)などの配線接続情報をCAD(Computer Aided Des
ign)を利用して作成するときなど、直交座標系上の任
意の点が多角形によって表現される閉領域(以下、多角
形領域という)内に含まれるかどうかを判定することが
必要となる場合がある。
2. Description of the Related Art LSI (Large Scall Integrated Circuit)
it) and other wiring connection information using CAD (Computer Aided Des
ign), it is necessary to determine whether any point on the rectangular coordinate system is included in a closed area represented by a polygon (hereinafter referred to as a polygon area) There are cases.

【0003】この直交座標系上の任意の点が多角形領域
内にあるかどうかを判定する一般的な方法として、判定
対象となる点から出した無限半直線が、多角形の辺と交
わる回数を調べる方法が知られている。この方法では、
無限半直線と多角形の辺との交差回数が奇数であれば判
定対象となる点は多角形領域内に、偶数であれば多角形
領域外にあると判定する。
[0003] As a general method for determining whether or not an arbitrary point on the rectangular coordinate system is within a polygonal area, the number of times that an infinite half-line drawn from a point to be determined intersects a side of the polygon is determined. The method of examining is known. in this way,
If the number of intersections between the infinite half line and the sides of the polygon is odd, it is determined that the point to be determined is within the polygon area, and if it is even, it is outside the polygon area.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、この方
法では、無限半直線が多角形の頂点と重なった場合の取
扱をどうするかについて工夫が必要となり、計算が複雑
になる。この問題を解決するため、ベクトルの外積が負
となる数が偶数であるか奇数であるかによって判定する
方法が、特公平1−49992号公報に開示されてい
る。
However, in this method, it is necessary to devise how to handle the case where the infinite half line overlaps the vertex of the polygon, and the calculation becomes complicated. In order to solve this problem, Japanese Patent Publication No. 1-49992 discloses a method of determining whether the number whose vector cross product is negative is an even number or an odd number.

【0005】しかしながら、この方法で用いられている
ベクトルの外積の演算は、行列演算を必要とするため、
比較的計算が複雑になる。これに対して、多角形の各辺
を1次式で表し、判定対象となる点の座標をこれらの一
次式に代入して計算した結果の符号を判定することによ
って、任意の点が多角形領域内にあるかどうかを判定す
る方法が特開平6−4678号公報(段落「0021」
〜「0024」)に開示されている。
However, since the operation of the cross product of the vectors used in this method requires a matrix operation,
Computation becomes relatively complicated. On the other hand, each side of the polygon is represented by a linear equation, and the sign of the calculation result obtained by substituting the coordinates of the point to be determined into these linear equations is determined. A method for determining whether or not the area is within the area is disclosed in JP-A-6-4678 (paragraph "0021").
-"0024").

【0006】この方法を実現するためには、各辺を数1
に示す多項式で表す。
In order to realize this method, each side is expressed by the following equation.
It is represented by the polynomial shown in

【数1】f(x,y)=a×x+b×y+c 数式1の各項の係数a,b,cの符号は、多角形内部の
点では判定対象となる点の座標値を代入して計算した結
果が、いずれの辺に対しても負となるように予め定めて
おく必要がある。すなわち、数1の右辺に−1をかけて
も表される直線は変わらないが、判定対象となる点の座
標値を代入して計算した結果の符号は、逆になる。この
ため、この方法で直交座標系上の任意の点が多角形領域
に含まれるかどうか判定するためには、多角形領域に含
まれる点が少なくとも1つはわからなければならない。
このような多角形領域に含まれる点を取得することは、
多角形の形状が複雑な場合には容易ではない。
## EQU1 ## f (x, y) = a.times.x + b.times.y + c The signs of the coefficients a, b, and c of the respective terms in Equation 1 are obtained by substituting the coordinate values of the points to be determined at points inside the polygon. It is necessary to determine in advance that the calculated result is negative for any side. That is, the straight line represented by multiplying the right side of Equation 1 by -1 does not change, but the sign of the result calculated by substituting the coordinate value of the point to be determined is reversed. For this reason, in order to determine whether any point on the rectangular coordinate system is included in the polygonal area by this method, at least one point included in the polygonal area must be known.
Obtaining the points included in such a polygonal area is
It is not easy when the shape of the polygon is complicated.

【0007】また、この方法は、判定対象となる点が凸
型の多角形内部の領域に含まれるかどうかについての判
定には、すべて適用することができる。しかしながら、
凹型の多角形については、多角形の領域内でも点の位置
により、数1に座標値を代入した結果が正とも負ともな
り得るため、上記の方法によって判定対象となる点が多
角形領域に含まれるかどうかの判定に適用することがで
きない。
This method can be applied to all determinations as to whether or not a point to be determined is included in a region inside a convex polygon. However,
Regarding a concave polygon, the result of substituting coordinate values into Equation 1 may be positive or negative depending on the position of the point even within the polygon area. It cannot be applied to the determination of inclusion.

【0008】本発明は、上記従来技術の問題点を解消す
るためになされたものであり、複雑な計算を要すること
なく、任意の点が閉領域内に含まれるかどうかを判定す
ることができる領域判定装置、方法及びこの方法を実現
するためのプログラムを記憶した記憶媒体を提供するこ
とを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems of the prior art, and can determine whether or not an arbitrary point is included in a closed region without requiring complicated calculations. An object of the present invention is to provide an area determination device and method, and a storage medium storing a program for implementing the method.

【0009】また、本発明は、いかなる形状であっても
閉領域内に任意の点が含まれるかどうかを判定すること
ができる領域判定装置、方法及びこの方法を実現するた
めのプログラムを記憶した記憶媒体を提供することを目
的とする。
Further, the present invention stores an area determining apparatus and method capable of determining whether or not an arbitrary point is included in a closed area regardless of the shape, and a program for realizing the method. It is intended to provide a storage medium.

【0010】[0010]

【課題を解決するための手段】上記目的を達成するた
め、本発明の第1の観点にかかる領域判定装置は、直交
座標系上の任意の点が、この直交座標系上に存在する多
角形で表現される閉領域に含まれるかどうかを判定する
領域判定装置であって、判定対象となる点の座標を入力
する入力手段と、前記閉領域外にある点の座標を取得す
る基準点取得手段と、前記入力手段から入力された前記
判定対象となる点と所定の関係を有する前記多角形の辺
を示す直線の式を取得する式取得手段と、前記式取得手
段によって取得された前記直線の式のそれぞれに、前記
基準点取得手段によって取得された点の座標を代入した
結果を互いに乗じた積の符号に関する情報を取得する基
準情報取得手段と、前記式取得手段によって取得された
前記直線の式のそれぞれに、前記入力手段から入力され
た前記判定対象となる点の座標を代入した結果を互いに
乗じた積の符号に関する情報を取得する判定情報取得手
段と、前記基準情報取得手段が取得した前記情報と前記
判定情報取得手段が取得した前記情報とが一致するかど
うかを判定する一致判定手段と、前記一致判定手段の判
定結果が一致である場合に、前記判定対象となる点が前
記閉領域外にあるという判定結果を出力し、前記一致判
定手段の判定結果が不一致である場合に、前記判定対象
となる点が前記閉領域内にあるという判定結果を出力す
る第1の出力手段と、を備える、ことを特徴とする。
In order to achieve the above-mentioned object, a region judging device according to a first aspect of the present invention is arranged such that an arbitrary point on a rectangular coordinate system is a polygon which exists on the rectangular coordinate system. An input means for inputting the coordinates of a point to be determined, and a reference point acquisition for acquiring coordinates of a point outside the closed area. Means, an expression obtaining means for obtaining an expression of a straight line indicating a side of the polygon having a predetermined relationship with the point to be determined inputted from the input means, and the straight line obtained by the expression obtaining means In each of the expressions, reference information obtaining means for obtaining information on the sign of a product obtained by multiplying the result obtained by substituting the coordinates of the points obtained by the reference point obtaining means, and the straight line obtained by the expression obtaining means Expression of it A determination information obtaining unit that obtains information about a sign of a product obtained by multiplying the result of substituting the coordinates of the point to be determined input from the input unit, and the information obtained by the reference information obtaining unit. And a match judging unit for judging whether or not the information acquired by the judging information acquiring unit coincides. If the judgment result of the coincidence judging unit is a match, the point to be judged is outside the closed region. A first output unit that outputs a determination result indicating that the point to be determined is within the closed region when the determination result of the match determination unit does not match. Comprising.

【0011】この領域判定装置では、判定対象となる点
と所定の関係を有する辺を示す式を取得すれば、後の演
算は、ほぼ判定対象となる点の座標と基準となる点の座
標とを取得した式に代入して計算するだけでよい。ここ
で、判定対象となる点と所定の関係を有する辺を示す式
の取得は、例えば、判定対象となる点がその辺の両端の
頂点の座標の範囲にあるなどの、簡単な条件付けによっ
て可能である。このため、この領域判定装置では、行列
演算などの複雑な計算を要することなく、任意の点が多
角形で表現される閉領域内に含まれるかどうかを判定す
ることができる。
In this area determining apparatus, if an expression indicating a side having a predetermined relationship with the point to be determined is obtained, the subsequent calculation will be performed with the coordinates of the point to be determined and the coordinates of the reference point. It is only necessary to calculate by substituting into the obtained expression. Here, it is possible to obtain an expression indicating a side having a predetermined relationship with the point to be determined, for example, by a simple condition such that the point to be determined is within the coordinate range of the vertices at both ends of the side. It is. For this reason, this region determination device can determine whether or not an arbitrary point is included in a closed region represented by a polygon, without requiring a complicated calculation such as a matrix operation.

【0012】また、前記基準点取得手段は、閉領域外の
点を取得するため、点の座標の取得が比較的容易であ
る。なお、この領域判定装置は、多角形の形状が凸型の
場合だけでなく、凹型である場合にも、任意の点が多角
形で表現される閉領域内に含まれるかどうかの判定に適
用することができる。
Further, the reference point acquiring means acquires a point outside the closed area, so that it is relatively easy to acquire the coordinates of the point. Note that this region determination device is applicable not only to a case where a polygon is convex but also to a case where an arbitrary point is included in a closed region represented by a polygon when the polygon is concave. can do.

【0013】上記領域判定装置は、さらに、前記多角形
の各頂点の座標を記憶する頂点記憶手段と、前記頂点記
憶手段に記憶された各頂点の座標から前記多角形の各辺
を示す直線の式を算出する式算出手段と、を備えるもの
とすることができる。
[0013] The above-mentioned area determination device further comprises vertex storage means for storing coordinates of each vertex of the polygon, and a straight line indicating each side of the polygon from the coordinates of each vertex stored in the vertex storage means. And an equation calculating means for calculating the equation.

【0014】上記領域判定装置において、例えば、前記
式取得手段は、両端の頂点の座標が前記入力手段から入
力された点の座標と所定の関係を有する辺を示す式を取
得するものとすることができる。
In the above-mentioned area determination apparatus, for example, the expression obtaining means obtains an expression indicating an edge having a predetermined relationship between the coordinates of the vertices at both ends and the coordinates of the point input from the input means. Can be.

【0015】[0015]

【0016】上記領域判定装置は、さらに、前記判定情
報取得手段が取得した前記情報が、前記式取得手段によ
って取得された前記直線の式のそれぞれに前記入力手段
から入力された点の座標を代入した結果を互いに乗じた
積が0であることを示す場合に、前記判定対象となる点
は前記多角形の辺上にあるという判定結果を出力する第
2の出力手段を備えるものとしてもよい。
In the above-mentioned area determination apparatus, the information obtained by the determination information obtaining means may further substitute the coordinates of a point input from the input means into each of the straight line expressions obtained by the expression obtaining means. When the result of multiplying the results by one is 0, the second output unit may output a determination result that the point to be determined is on a side of the polygon.

【0017】判定対象となる点は、多角形の辺上に存在
する場合もあり得る。この第2の出力手段は、前記判定
情報取得手段が取得した前記情報が、前記式取得手段に
よって取得された前記直線の式のそれぞれに前記入力手
段から入力された点の座標を代入した結果の積が0であ
ることを示すという簡単な条件付けで、判定対象となる
点が多角形の辺上に存在するという判定結果を出力する
ことができる。
The point to be determined may exist on the side of the polygon. The second output unit is configured so that the information obtained by the determination information obtaining unit is obtained by substituting the coordinates of a point input from the input unit into each of the straight line expressions obtained by the expression obtaining unit. With a simple condition that the product is 0, it is possible to output a determination result that the point to be determined exists on the side of the polygon.

【0018】上記目的を達成するため、本発明の第2の
観点にかかる領域判定方法は、直交座標系上の任意の点
が、この直交座標系上に存在する多角形で表現される閉
領域に含まれるかどうかを判定する領域判定方法であっ
て、判定対象となる点の座標を入力する入力ステップ
と、前記閉領域外にある点の座標を取得する基準点取得
ステップと、前記入力ステップで入力された前記判定対
象となる点と所定の関係を有する前記多角形の辺を示す
直線の式を取得する式取得ステップと、前記式取得ステ
ップで取得した前記直線の式のそれぞれに、前記基準点
取得ステップで取得した点の座標を代入した結果を互い
に乗じた積の符号に関する情報を取得する基準情報取得
ステップと、前記式取得ステップで取得した前記直線の
式のそれぞれに、前記入力ステップで入力した前記判定
対象となる点の座標を代入した結果を互いに乗じた積の
符号に関する情報を取得する判定情報取得ステップと、
前記基準情報取得ステップで取得した前記情報と前記判
定情報取得ステップで取得した前記情報とが一致するか
どうかを判定する一致判定ステップと、前記一致判定ス
テップでの判定結果が一致である場合に、前記判定対象
となる点が前記閉領域外にあるという判定結果を出力す
る第1の出力ステップと、前記一致判定ステップでの判
定結果が不一致である場合に、前記判定対象となる点が
前記閉領域内にあるという判定結果を出力する第2の出
力ステップと、を含む、ことを特徴とする。
In order to achieve the above object, a region determining method according to a second aspect of the present invention is directed to a closed region in which an arbitrary point on a rectangular coordinate system is represented by a polygon existing on the rectangular coordinate system. An area determining method for determining whether or not the area is included in the input step, an input step of inputting coordinates of a point to be determined, a reference point obtaining step of obtaining coordinates of a point outside the closed area, and the input step In the equation acquisition step of acquiring a straight line equation indicating the side of the polygon having a predetermined relationship with the point to be determined input in the equation, and in each of the straight line equations acquired in the equation acquisition step, A reference information acquisition step of acquiring information on the sign of a product obtained by multiplying the result obtained by substituting the coordinates of the points acquired in the reference point acquisition step, and a formula for the straight line acquired in the equation acquisition step, A determining information acquisition step of acquiring code information on the product obtained by multiplying together the results obtained by substituting the coordinates of the judgment subject to point inputted by the input step,
A match determining step of determining whether the information obtained in the reference information obtaining step matches the information obtained in the determination information obtaining step, and when the determination result in the match determining step is a match, A first output step of outputting a determination result that the point to be determined is outside the closed region; and, if the determination result in the match determination step does not match, the point to be determined is closed. And a second output step of outputting a determination result that the area is within the area.

【0019】この領域判定方法は、さらに、前記判定情
報取得ステップで取得した前記情報が、前記式取得ステ
ップで取得した前記直線の式のそれぞれに前記入力ステ
ップで入力された点の座標を代入した結果を互いに乗じ
た積が0であることを示す場合に、前記判定対象となる
点は前記多角形の辺上にあるという判定結果を出力する
第3の出力ステップを含むものとしてもよい。
In this area judging method, the information obtained in the judging information obtaining step further substitutes the coordinates of the point input in the input step into each of the straight line equations obtained in the equation obtaining step. The method may include a third output step of outputting a determination result that the point to be determined is on a side of the polygon when the product of the results is 0.

【0020】上記目的を達成するため、本発明の第3の
観点にかかる記憶媒体は、直交座標系上の任意の点が、
この直交座標系上に存在する多角形で表現される閉領域
に含まれるかどうかを判定するプログラムを記憶した記
憶媒体であって、判定対象となる点の座標を入力する入
力ステップと、前記閉領域外にある点の座標を取得する
基準点取得ステップと、前記入力ステップで入力された
前記判定対象となる点と所定の関係を有する前記多角形
の辺を示す直線の式を取得する式取得ステップと、前記
式取得ステップで取得した前記直線の式のそれぞれに、
前記基準点取得ステップで取得した点の座標を代入した
結果を互いに乗じた積の符号に関する情報を取得する基
準情報取得ステップと、前記式取得ステップで取得した
前記直線の式のそれぞれに、前記入力ステップで入力し
た前記判定対象となる点の座標を代入した結果を互いに
乗じた積の符号に関する情報を取得する判定情報取得ス
テップと、前記基準情報取得ステップで取得した前記情
報と前記判定情報取得ステップで取得した前記情報とが
一致するかどうかを判定する一致判定ステップと、前記
一致判定ステップでの判定結果が一致である場合に、前
記判定対象となる点が前記閉領域外にあるという判定結
果を出力する第1の出力ステップと、前記一致判定ステ
ップでの判定結果が不一致である場合に、前記判定対象
となる点が前記閉領域内にあるという判定結果を出力す
る第2の出力ステップとを実現するプログラムを記憶し
た、ことを特徴とする。
In order to achieve the above object, a storage medium according to a third aspect of the present invention has an arbitrary point on a rectangular coordinate system,
A storage medium storing a program for determining whether or not a closed area represented by a polygon present on the orthogonal coordinate system is included, wherein an input step of inputting coordinates of a point to be determined; A reference point acquisition step of acquiring coordinates of a point outside the area, and an equation acquisition of acquiring a straight line equation indicating a side of the polygon having a predetermined relationship with the point to be determined input in the input step Step and, for each of the straight line equations acquired in the equation acquisition step,
The reference information obtaining step of obtaining information on the sign of a product obtained by multiplying the result obtained by substituting the coordinates of the points obtained in the reference point obtaining step, and the input of the input to each of the straight line equations obtained in the equation obtaining step A determination information obtaining step of obtaining information relating to a sign of a product obtained by multiplying the result of substituting the coordinates of the determination target point input in the step, and the information and the determination information obtaining step obtained in the reference information obtaining step A match determining step of determining whether or not the information obtained in step 1 matches; and a determination result that the point to be determined is outside the closed region when the determination result in the match determining step is a match. And the point to be determined is closed when the results of the determination in the first output step and the match determination step do not match. Storing a program for implementing a second output step of outputting a determination result that in the region, characterized in that.

【0021】上記記憶媒体は、さらに、前記判定情報取
得ステップで取得した前記情報が、前記式取得ステップ
で取得した前記直線の式のそれぞれに前記入力ステップ
で入力された点の座標を代入した結果を互いに乗じた積
が0であることを示す場合に、前記判定対象となる点は
前記多角形の辺上にあるという判定結果を出力する第3
の出力ステップを実現するプログラムを記憶したもので
あってもよい。
In the above-mentioned storage medium, the information obtained in the determination information obtaining step may further include a result obtained by substituting the coordinates of the point input in the input step into each of the linear expressions obtained in the expression obtaining step. Is a result of multiplying each other by 0, a third determination result that the determination target point is on a side of the polygon is output
May be stored.

【0022】[0022]

【発明の実施の形態】以下、添付図面を参照して、本発
明の実施の形態について説明する。図1は、この実施の
形態の領域判定装置の構成を示すブロック図である。図
示するように、この領域判定装置は、入力装置1と、多
角形データ格納装置2と、データ処理装置3と、出力装
置4とから構成されている。
Embodiments of the present invention will be described below with reference to the accompanying drawings. FIG. 1 is a block diagram showing a configuration of an area determination device according to this embodiment. As shown in the figure, the area determination device includes an input device 1, a polygon data storage device 2, a data processing device 3, and an output device 4.

【0023】入力装置1は、キーボード、マウス或いは
ディジタイザなどによって構成され、XY平面上の多角
形で表現される閉領域内(以下、多角形領域という)に
含まれるかどうかを調査すべき点(以下、調査点とい
う)の座標を入力する。入力装置1は、入力された調査
点の座標データを記憶するバッファを有する。
The input device 1 is constituted by a keyboard, a mouse, a digitizer, or the like, and it is checked whether the input device 1 is included in a closed area represented by a polygon on the XY plane (hereinafter, referred to as a polygon area). (Hereinafter referred to as a survey point). The input device 1 has a buffer for storing the input coordinate data of the survey point.

【0024】多角形データ格納装置2は、半導体メモリ
或いは磁気メモリなどによって構成され、調査点が含ま
れるかどうかを判断する対象となる多角形の各頂点の座
標データを、図2に示すフォーマットの多角形データフ
ァイルとして記憶する。図2の多角形データファイルで
は、隣接する頂点同士の座標(x座標及びy座標)は連
続して記憶されている。また、最後に記憶されている座
標と最初に記憶されている座標とがそれぞれ示す頂点同
士も隣接するものである。
The polygon data storage device 2 is composed of a semiconductor memory or a magnetic memory or the like, and stores coordinate data of each vertex of a polygon for determining whether or not a survey point is included in a format shown in FIG. Store as a polygon data file. In the polygon data file of FIG. 2, the coordinates (x-coordinate and y-coordinate) between adjacent vertices are continuously stored. The vertices indicated by the coordinates stored last and the coordinates stored first are also adjacent to each other.

【0025】データ処理装置3は、主としてCPU(中
央処理装置)、主記憶装置及び補助記憶装置によって構
成され、CPUが補助記憶装置から読み出され、主記憶
装置に格納されたプログラムを実行することで後述する
機能を実現し、調査点が多角形領域に含まれるかどうか
を判定する。出力装置4は、ディスプレイ装置或いはプ
リンタなどによって構成され、データ処理装置3の処理
結果を出力する。
The data processing device 3 is mainly composed of a CPU (central processing unit), a main storage device and an auxiliary storage device. The CPU reads out from the auxiliary storage device and executes a program stored in the main storage device. Implements the function described later, and determines whether the survey point is included in the polygonal area. The output device 4 is configured by a display device, a printer, or the like, and outputs a processing result of the data processing device 3.

【0026】図3は、図1のデータ処理装置3の機能を
示す機能ブロック図である。図示するように、データ処
理装置3は、多角形データ読み込み部31と、エッジデ
ータ生成部32と、調査点データ読み込み部33と、エ
ッジ選択部34と、基準点選択部35と、基準値計算部
36と、多項式値計算部37と、領域判定部38と、エ
ッジデータファイル3aと、多項式格納バッファ3bと
の各機能から構成されている。
FIG. 3 is a functional block diagram showing functions of the data processing device 3 of FIG. As illustrated, the data processing device 3 includes a polygon data reading unit 31, an edge data generation unit 32, a survey point data reading unit 33, an edge selection unit 34, a reference point selection unit 35, a reference value calculation unit It comprises a unit 36, a polynomial value calculation unit 37, an area determination unit 38, an edge data file 3a, and a polynomial storage buffer 3b.

【0027】多角形データ読み込み部31は、多角形デ
ータ格納装置2から多角形データファイルを読み出す。
エッジデータ生成部32は、後述するように多角形デー
タファイルからエッジデータを生成し、エッジデータフ
ァイル3aに格納する。調査点データ読み込み部33
は、入力装置1のバッファに記憶された調査点の座標デ
ータを読み出す。エッジ選択部34は、後述するように
判定多項式の生成に必要なエッジを選択し、多項式格納
バッファ3bに格納する。基準点選択部35は、後述す
るように調査点が多角形領域に含まれるかどうかの判断
に必要となる基準点を選択する。基準値計算部36は、
後述するように生成された多項式に基準点の座標データ
を代入した基準値を求める。多項式値計算部37は、後
述するように調査点の座標データを代入した多項式値を
求める。領域判定部38は、多項式値計算部37の演算
結果から、調査点が多角形領域に含まれるかどうかを判
定する。
The polygon data reading section 31 reads a polygon data file from the polygon data storage device 2.
The edge data generation unit 32 generates edge data from a polygon data file as described later, and stores the edge data in the edge data file 3a. Survey point data reading unit 33
Reads the coordinate data of the survey point stored in the buffer of the input device 1. The edge selection unit 34 selects an edge required for generating a determination polynomial as described later, and stores the edge in the polynomial storage buffer 3b. The reference point selection unit 35 selects a reference point necessary for determining whether or not the survey point is included in the polygon area, as described later. The reference value calculation unit 36
As will be described later, a reference value is obtained by substituting the coordinate data of the reference point into the generated polynomial. The polynomial value calculator 37 obtains a polynomial value in which the coordinate data of the survey point is substituted, as described later. The area determination unit 38 determines whether the survey point is included in the polygonal area based on the calculation result of the polynomial value calculation unit 37.

【0028】以下、この実施の形態の領域判定装置にお
ける動作について説明する。ここで、判定の対象となる
多角形の各頂点の座標は、多角形データファイルとして
多角形データ格納装置2に格納されているものとする。
この状態で、オペレータは入力装置1から調査点の座標
を入力すると、データ処理装置3における処理が開始さ
れる。
The operation of the area determining apparatus according to this embodiment will be described below. Here, it is assumed that the coordinates of each vertex of the polygon to be determined are stored in the polygon data storage device 2 as a polygon data file.
In this state, when the operator inputs the coordinates of the survey point from the input device 1, the processing in the data processing device 3 is started.

【0029】データ処理装置3では、まず、多角形デー
タ読み込み部31が多角形データ格納装置2に格納され
ている多角形データファイルを読み出し、読み出した多
角形データファイルをエッジデータ生成部32に渡す。
そして、エッジデータ生成部32の処理に移る。
In the data processing device 3, first, the polygon data reading unit 31 reads a polygon data file stored in the polygon data storage device 2, and passes the read polygon data file to the edge data generating unit 32. .
Then, the process proceeds to the processing of the edge data generation unit 32.

【0030】エッジデータ生成部32では、多角形デー
タファイル中の隣接する頂点の座標に基づいて、数式3
に示す演算を行って、数式2で示す多角形の各辺を表す
式の係数a、b、cを求める。
The edge data generation unit 32 calculates the equation (3) based on the coordinates of adjacent vertices in the polygon data file.
The coefficients a, b, and c of the equation representing each side of the polygon represented by Equation 2 are obtained by performing the calculation shown in Equation 2.

【数2】aX+bY+c=0## EQU2 ## aX + bY + c = 0

【数3】 a=Ym−1−Y b=−Xm−1+X c=(Ym−1−Y)×Xm−1−(Xm−1
)×Ym−1 (mは、2からnまでの整数)
## EQU3 ## a = Ym-1-Ym b = -Xm-1+ Xm c = (Ym-1-Ym) × Xm-1− (Xm-1
Xm) × Ym-1 (M is an integer from 2 to n)

【0031】そして、エッジデータ生成部32は、図4
に示すように計算に用いられた辺の両端の頂点の座標、
及び算出した係数を対応づけてエッジデータファイル3
aに記憶する。
Then, the edge data generation unit 32
The coordinates of the vertices at both ends of the side used in the calculation as shown in
And the calculated coefficient in association with the edge data file 3
Stored in a.

【0032】エッジデータファイル3aが生成される
と、調査点データ読み込み部33の処理に移り、入力装
置1のバッファに記憶されている調査点の座標データを
読み出す。座標データの読み出しの終了によって調査点
データ読み込み部33の処理を終了する。
When the edge data file 3a is generated, the processing shifts to the processing of the survey point data reading unit 33, and the coordinate data of the survey point stored in the buffer of the input device 1 is read. Upon completion of the reading of the coordinate data, the processing of the survey point data reading unit 33 ends.

【0033】次に、エッジ選択部34及び基準点選択部
35の処理に移り、判定多項式の生成と基準点の選択の
処理が行われる。この処理について、図6のフローチャ
ートを参照して説明する。ここで、調査点のx座標は変
数xに、y座標は変数yに格納されているものとする。
Next, the processing shifts to the processing of the edge selection unit 34 and the reference point selection unit 35, where the processing of generating a judgment polynomial and selecting the reference point is performed. This processing will be described with reference to the flowchart in FIG. Here, it is assumed that the x coordinate of the survey point is stored in the variable x and the y coordinate is stored in the variable y.

【0034】図6のフローチャートの処理が開始する
と、まず、エッジデータファイル3aから1つずつエッ
ジデータを読み出していく(ステップS11)。そし
て、調査点のx座標が、読み出したエッジデータ中の第
1の頂点のx座標Xm-1よりも大きく第2の頂点のx座
標Xmよりも小さいか、或いは第2の頂点のx座標Xm
りも大きく第1の頂点のx座標Xmー1よりも小さいかど
うかを判定する(ステップS12)。
When the process of the flowchart of FIG. 6 starts, first, edge data is read one by one from the edge data file 3a (step S11). Then, the x coordinate of the inspection point is larger than the x coordinate X m-1 of the first vertex in the read edge data and smaller than the x coordinate X m of the second vertex, or x determines whether less than the x-coordinate X m-1 of the first vertex greater than the coordinate X m (step S12).

【0035】ステップS12で調査点のx座標が、読み
出したエッジデータ中の第1の頂点のx座標Xm−1
りも大きく第2の頂点のx座標Xよりも小さい、或い
は第2の頂点のx座標Xよりも大きく第1の頂点のx
座標Xmー1よりも小さいと判定したときは、エッジデ
ータ中の対応する辺を表す式の直線の係数a、b、cを
多項式格納バッファ3bに、図5に示すように順次格納
していく(ステップS13)。多項式格納バッファ3b
に格納された係数a、b、cを有する多項式を乗じたも
のが、判定多項式となる。そして、ステップS14の処
理に進む。
The x coordinate of the survey point in step S12, the read greater than the x-coordinate X m-1 of the first vertex in the edge data of the second vertex x smaller than the coordinate X m, or second the larger than the x-coordinate X m of the vertex 1 of the vertices of x
When it is determined that the coordinate is smaller than the coordinate Xm-1, the coefficients a, b, and c of the straight line of the equation representing the corresponding side in the edge data are sequentially stored in the polynomial storage buffer 3b as shown in FIG. It goes (step S13). Polynomial storage buffer 3b
Is multiplied by the polynomial having the coefficients a, b, and c stored in. Then, the processing of step S14
Proceed to reason.

【0036】[0036]

【0037】[0037]

【0038】ステップS14では、エッジデータファイ
ル3aにまだ未処理のエッジデータが格納されているか
どうかを判別する。ステップS14でまだ未処理のエッ
ジデータが格納されていると判別したときは、ステップ
S11の処理に戻り、次のエッジデータについて上記と
同様の処理を行う。ステップS14で未処理のエッジデ
ータが格納されていないと判別したときは、調査点とx
座標が同じである多角形領域外の点を基準点として選択
して(ステップS25)、このフローチャートの処理を
終了する。
In step S14, it is determined whether or not unprocessed edge data is stored in the edge data file 3a. If it is determined in step S14 that unprocessed edge data is still stored, the process returns to step S11, and the same processing is performed on the next edge data. If it is determined in step S14 that unprocessed edge data is not stored, the search point and x
Select coordinate points outside the polygon area is the same as the base reference point (step S25), and ends the processing of this flowchart.

【0039】次に、基準値計算部36の処理に移り、基
準値計算の処理が行われる。この処理について、図7の
フローチャートを参照して説明する。図7のフローチャ
ートの処理が開始すると、まず、変数flagに1を代
入する(ステップS31)。
Next, the processing shifts to the processing of the reference value calculation unit 36, and the processing of the reference value calculation is performed. This processing will be described with reference to the flowchart in FIG. When the process of the flowchart in FIG. 7 starts, first, 1 is substituted for a variable flag (step S31).

【0040】次に、多項式格納バッファ3bに格納され
ている辺を表す直線の式の係数a、b、cを読み出す
(ステップS32)。そして、読み出した係数と図6の
処理で選択した基準点のx座標、y座標を上記の数式2
で示した aX+bY+c に代入して計算し、この計
算結果が0でないかどうかを判定する(ステップS3
3)。
Next, the coefficients a, b, and c of the equation of the straight line representing the side stored in the polynomial storage buffer 3b are read (step S32). Then, the read coefficient and the x and y coordinates of the reference point selected in the processing of FIG.
The calculation is performed by substituting into aX + bY + c shown in, and it is determined whether the calculation result is not 0 (step S3).
3).

【0041】ステップS33で計算結果が0であると判
定したときは、基準点が多角形の辺上の点であるという
判定結果を出力装置4に出力する(ステップS37)。
もっとも、基準点は上記の方法によって選択されている
ためにこのような判定結果となることはない。ステップ
S33で計算結果が0でないと判定したときは、さらに
その計算結果が0より小さい、すなわち負であるかどう
かを判定する(ステップS34)。
If it is determined in step S33 that the calculation result is 0, the determination result that the reference point is a point on the side of the polygon is output to the output device 4 (step S37).
However, since the reference point is selected by the above method, such a determination result does not occur. If it is determined in step S33 that the calculation result is not 0, it is further determined whether the calculation result is smaller than 0, that is, whether the calculation result is negative (step S34).

【0042】ステップS34で計算結果が0より小さい
と判定したときは、すなわち辺を表す式に基準点の座標
を代入した結果が負であると判定したときは、変数fl
agに−1を乗じた結果を再び変数flagに代入して
(ステップS35)、ステップS36の処理に進む。ス
テップS34で計算結果が0より小さくないと判定した
ときは、そのままステップS36の処理に進む。このよ
うな処理を繰り返すことで、多項式格納バッファ3bに
係数が格納された判定多項式に調査点のx座標及びy座
標の値を代入した結果の符号が求められる。
If it is determined in step S34 that the calculation result is smaller than 0, that is, if it is determined that the result of substituting the coordinates of the reference point into the expression representing the side is negative, the variable fl
The result obtained by multiplying ag by -1 is again substituted for the variable flag (step S35), and the process proceeds to step S36. If it is determined in step S34 that the calculation result is not smaller than 0, the process directly proceeds to step S36. By repeating such processing, the sign of the result of substituting the x-coordinate and y-coordinate values of the survey point into the decision polynomial in which the coefficients are stored in the polynomial storage buffer 3b is obtained.

【0043】ステップS36では、多項式格納バッファ
3bにまだ未処理の係数a、b、cが格納されているか
どうかを判別する。ステップS36でまだ未処理の係数
a、b、cが格納されていると判別したときは、ステッ
プS32の処理に戻り、次の係数a、b、cについて同
様の処理を行う。ステップS36で未処理の係数a、
b、cが格納されていないと判別したときは、そのとき
のflagの値を基準値として(ステップS38)、多
項式値計算部37における処理に進む。なお、同一の多
角形領域に対して調査点が2つ以上ある場合には、2番
目以降の点については基準値の計算を省略できる。
In step S36, it is determined whether or not unprocessed coefficients a, b, and c are stored in the polynomial storage buffer 3b. If it is determined in step S36 that unprocessed coefficients a, b, and c are stored, the process returns to step S32, and the same processing is performed for the next coefficients a, b, and c. In step S36, the unprocessed coefficient a,
If it is determined that b and c are not stored, the value of the flag at that time is set as a reference value (step S38), and the process proceeds to the polynomial value calculation unit 37. When there are two or more survey points for the same polygon area, the calculation of the reference value can be omitted for the second and subsequent points.

【0044】多項式値計算部37における処理は、ステ
ップS33またはステップS34で、基準点ではなく、
調査点のx座標、y座標をX、Yに代入して判定を行う
以外は、基準値計算部36における処理と同じである。
The processing in the polynomial value calculating section 37 is not a reference point in step S33 or step S34.
The processing is the same as the processing in the reference value calculation unit 36, except that the determination is performed by substituting the x coordinate and the y coordinate of the survey point into X and Y.

【0045】多項式値計算部37で多項式値が計算され
ると、領域判定部38における処理に移る。この領域判
定部38における処理について、図8のフローチャート
を参照して説明する。図8のフローチャートの処理が開
始すると、まず、基準値計算部36で計算した基準値を
変数V0に代入する(ステップS41)。次に、多項式
値計算部37で計算した多項式値を変数V1に代入する
(ステップS42)。そして、V0とV1との積が−1
であるかどうか、すなわち基準点の座標を判定多項式に
代入した計算結果の符号と調査点の座標を判定多項式に
代入した計算結果の符号とが異なるかどうかを判別する
(ステップS43)。
When the polynomial value is calculated by the polynomial value calculation unit 37, the process proceeds to the area judgment unit 38. The processing in the area determination unit 38 will be described with reference to the flowchart in FIG. When the process of the flowchart of FIG. 8 starts, first, the reference value calculated by the reference value calculation unit 36 is substituted for the variable V0 (step S41). Next, the polynomial value calculated by the polynomial value calculator 37 is substituted for the variable V1 (step S42). And the product of V0 and V1 is -1
That is, it is determined whether the sign of the calculation result obtained by substituting the coordinates of the reference point into the judgment polynomial and the sign of the calculation result obtained by substituting the coordinates of the investigation point into the judgment polynomial are determined (step S43).

【0046】ステップS43でV0とV1との積が−
1、すなわち基準点の座標を判定多項式に代入した計算
結果の符号と調査点の座標を判定多項式に代入した計算
結果の符号とが異なると判定したときは、調査点は多角
形領域内にあるという判定結果を出力装置4に出力して
(ステップS44)、処理を終了する。
In step S43, the product of V0 and V1 is-
1, that is, when it is determined that the sign of the calculation result obtained by substituting the coordinates of the reference point into the decision polynomial and the sign of the calculation result obtained by substituting the coordinates of the survey point into the decision polynomial are different, the survey point is in the polygonal region. Is output to the output device 4 (step S44), and the process ends.

【0047】ステップS43でV0とV1との積が−1
でない、すなわち基準点の座標を判定多項式に代入した
計算結果の符号と調査点の座標を判定多項式に代入した
計算結果の符号とが同じであると判定したときは、調査
点は多角形領域外にあるという判定結果を出力装置4に
出力して(ステップS45)、処理を終了する
In step S43, the product of V0 and V1 is -1.
In other words, if it is determined that the sign of the calculation result obtained by substituting the coordinates of the reference point into the judgment polynomial and the sign of the calculation result obtained by substituting the coordinates of the investigation point into the judgment polynomial are the same, the investigation point is outside the polygonal area. Is output to the output device 4 (step S45), and the process ends.

【0048】ステップS37、S44またはS45で出
力された判定結果は、出力装置4から外部に出力されて
オペレータに示される。
The determination result output in step S37, S44 or S45 is output from the output device 4 to the outside and shown to the operator.

【0049】以下、この実施の形態の領域判定装置によ
る調査点が多角形領域に含まれるかどうかの判定につい
て、具体的な例を示して説明する。まず、第1の例とし
て、図9に示す「E」の字型の多角形領域に、座標(4
0,90)の点と、座標(50,60)の点とがそれぞ
れ含まれるかどうか判定する場合について挙げる。ここ
で、基準点としては座標(60,−20)の点が選ばれ
る。
Hereinafter, the determination of whether or not the survey point is included in the polygonal area by the area determining apparatus of this embodiment will be described with reference to a specific example. First, as a first example, the coordinates (4
(0, 90) and a point at coordinates (50, 60) are determined. Here, a point at coordinates (60, -20) is selected as the reference point.

【0050】この例における判定多項式は、調査点が
(40,90)の点と(50,60)の点のいずれとな
る場合にも、数式4に示すようになる。
The decision polynomial in this example is as shown in Equation 4 regardless of whether the survey point is the point of (40, 90) or the point of (50, 60).

【数4】(Y−160)×(Y−140)×(Y−10
0)×(Y−80)×(Y−40)×(Y−20)
## EQU4 ## (Y-160) × (Y-140) × (Y-10
0) x (Y-80) x (Y-40) x (Y-20)

【0051】この式に基準点の座標であるX=60、Y
=−20を代入すると、
In this equation, the coordinates of the reference point, X = 60, Y
= -20,

【数5】(−20−160)×(−20−140)×
(−20−100)×(−20−80)×(−20−4
0)×(−20−20)>0 となる。すなわち、基準値は正となる。
[Equation 5] (−20−160) × (−20−140) ×
(-20-100) x (-20-80) x (-20-4)
0) × (−20−20)> 0. That is, the reference value is positive.

【0052】この式に第1の調査点の座標であるX=4
0、Y=90を代入すると、
In this equation, X = 4 which is the coordinate of the first survey point
Substituting 0, Y = 90 gives

【数6】(90−160)×(90−140)×(90
−100)×(90−80)×(90−40)×(90
−20)<0 となる。この場合の多項式値は負となり、基準値と符号
が異なるので、座標(40,90)の点は多角形で表さ
れる領域内にあることがわかる。
(90−160) × (90−140) × (90
-100) x (90-80) x (90-40) x (90
-20) <0. In this case, since the polynomial value is negative and the sign is different from the reference value, it can be seen that the point at the coordinates (40, 90) is within the area represented by the polygon.

【0053】この式に第2の調査点の座標であるX=5
0、Y=60を代入すると、
In this equation, X = 5 which is the coordinate of the second inspection point
Substituting 0, Y = 60 gives

【数7】(60−160)×(60−140)×(60
−100)×(60−80)×(60−40)×(60
−20)>0 となる。この場合の多項式値は正となり、基準値と符号
が同じなので、座標(50,60)の点は多角形で表さ
れる領域外にあることがわかる。
(7) (60-160) × (60-140) × (60
-100) x (60-80) x (60-40) x (60
-20)> 0. Since the polynomial value in this case is positive and has the same sign as the reference value, it can be seen that the point at the coordinates (50, 60) is outside the area represented by the polygon.

【0054】次に、第2の例として、図10に示す
「A」の字型の多角形領域に、座標(100,60)の
点と、座標(100,100)の点とがそれぞれ含まれ
るかどうかを判定する場合について挙げる。ここで、基
準点としては座標(90,130)の点が選ばれる。
Next, as a second example, a point having coordinates (100, 60) and a point having coordinates (100, 100) are respectively included in the polygonal area of the character "A" shown in FIG. Here is a case where it is determined whether or not to be performed. Here, a point having coordinates (90, 130) is selected as the reference point.

【0055】この例における判定多項式は、調査点が
(100,60)の点と(100,100)の点のいず
れとなる場合にも、数式8に示すようになる。
The decision polynomial in this example is as shown in Expression 8 regardless of whether the survey point is the point of (100, 60) or the point of (100, 100).

【数8】(2X+Y−280)×(Y−20)## EQU8 ## (2X + Y-280) × (Y-20)

【0056】この式に基準点の座標であるX=90、Y
=130を代入すると、
In this equation, the coordinates of the reference point, X = 90, Y
= 130

【数9】 (2×90+130−280)×(130−20)>0 となる。すなわち、基準値は正となる。(2 × 90 + 130−280) × (130−20)> 0. That is, the reference value is positive.

【0057】この式に第1の調査点の座標であるX=1
00、Y=60を代入すると、
In this equation, X = 1, which is the coordinate of the first survey point,
00, Y = 60,

【数10】 (2×100+60−280)×(60−20)<0 となる。この場合の多項式値は負となり、基準値と符号
が異なるので、座標(100,60)の点は多角形で表
される領域内にあることがわかる。
(10) (2 × 100 + 60−280) × (60−20) <0. Since the polynomial value in this case is negative and has a different sign from the reference value, it can be seen that the point at the coordinates (100, 60) is within the area represented by the polygon.

【0058】この式に第1の調査点の座標であるX=1
00、Y=100を代入すると、
In this equation, X = 1, which is the coordinate of the first survey point,
Substituting 00, Y = 100,

【数11】(2×100+100−280)×(100
−20)>0 となる。この場合の多項式値は正となり、基準値と符号
が同じなので、座標(100,100)の点は多角形で
表される領域外にあることがわかる。
## EQU11 ## (2 × 100 + 100-280) × (100
-20)> 0. Since the polynomial value in this case is positive and has the same sign as the reference value, it can be seen that the point at the coordinates (100, 100) is outside the area represented by the polygon.

【0059】以上説明したように、この実施の形態の領
域判定装置では、行列演算などの複雑な演算を行わなく
ても、調査点が多角形領域に含まれるかどうかを判定す
ることができる。また、この領域判定装置で基準点とし
ているのは、多角形領域外の点であるので、その取得は
比較的容易にできる。さらには、この領域判定装置で
は、上記の具体例でも示したように凹型を含むあらゆる
多角形に対して任意の点が含まれるかどうかの判定に適
用することができる。
As described above, the region determining apparatus of this embodiment can determine whether or not a survey point is included in a polygonal region without performing a complicated operation such as a matrix operation. Further, since the reference point in this area determination device is a point outside the polygonal area, it can be obtained relatively easily. Further, this area determination device can be applied to determination as to whether or not any point is included in any polygon including a concave shape as shown in the above specific example.

【0060】上記の実施の形態では、XY平面内におい
て任意の点が多角形で表現される閉領域に含まれるかど
うかを判定する領域判定装置について説明した。しかし
ながら、本発明は上記のものに限られない。以下、本発
明の変形態様について説明する。
In the above-described embodiment, the area determining apparatus for determining whether an arbitrary point in the XY plane is included in a closed area represented by a polygon has been described. However, the present invention is not limited to the above. Hereinafter, modified embodiments of the present invention will be described.

【0061】上記の実施の形態では、調査点を含むかど
うかの判定対象となる多角形に関するデータは、頂点の
座標によって与えられていたが、各辺を表す直線の式に
よって与えられてもよい。この場合、直線の交点を求め
ることによって頂点の座標を算出してから、上記の方法
によって調査点が多角形内の領域に含まれるかどうかを
判定すればよい。
In the above embodiment, the data on the polygon to be determined as to whether or not to include the survey point is given by the coordinates of the vertices, but may be given by the equation of a straight line representing each side. . In this case, the coordinates of the vertices may be calculated by determining the intersection of the straight lines, and then it may be determined whether or not the survey point is included in the area within the polygon by the above method.

【0062】上記の実施の形態では、データ処理装置3
のCPUが実行するプログラムは、データ処理装置3内
の補助記憶装置に予め記憶されていた。しかしながら、
このプログラムは、CD−ROMやフロッピーディスク
などの記憶媒体に記憶した形で提供し、データ処理装置
3内の補助記憶装置にインストールしてもよい。また、
このような記憶媒体に記憶されたプログラムを直接主記
憶装置に読み込ませて、CPUが実行してもよい。
In the above embodiment, the data processing device 3
The program executed by the CPU is stored in an auxiliary storage device in the data processing device 3 in advance. However,
This program may be provided in a form stored in a storage medium such as a CD-ROM or a floppy disk, and may be installed in an auxiliary storage device in the data processing device 3. Also,
The program stored in such a storage medium may be directly read into the main storage device and executed by the CPU.

【0063】[0063]

【発明の効果】以上説明したように、本発明によれば、
行列演算などの複雑な演算を行わなくても、任意の点が
多角形で表現される閉領域に含まれるかどうかを判定す
ることができる。また、閉領域の外の点を基準としてい
るので、基準とする点の取得は比較的容易にできる。さ
らには、本発明では、凹型の多角形に対して任意の点が
含まれるかどうかの判定など、多角形の形状による制約
がない。
As described above, according to the present invention,
It is possible to determine whether an arbitrary point is included in a closed region represented by a polygon without performing a complicated operation such as a matrix operation. Further, since a point outside the closed region is used as a reference, it is relatively easy to obtain a reference point. Furthermore, in the present invention, there is no restriction due to the shape of the polygon, such as determining whether an arbitrary point is included in the concave polygon.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施の形態にかかる領域判定装置の構
成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of an area determination device according to an embodiment of the present invention.

【図2】図1の多角形データ格納装置に格納される多角
形データファイルのフォーマットである。
FIG. 2 is a format of a polygon data file stored in the polygon data storage device of FIG. 1;

【図3】図1のデータ処理装置の機能を示す機能ブロッ
ク図である。
FIG. 3 is a functional block diagram illustrating functions of the data processing device of FIG. 1;

【図4】図2のエッジデータファイルに格納されるエッ
ジデータファイルのフォーマットである。
FIG. 4 is a format of an edge data file stored in the edge data file of FIG. 2;

【図5】図2の多項式生成バッファに格納される多項式
データのフォーマットである。
FIG. 5 shows a format of polynomial data stored in a polynomial generation buffer of FIG. 2;

【図6】図3のエッジ選択部及び基準点選択部における
判定多項式の生成と基準点の選択の処理を示すフローチ
ャートである。
FIG. 6 is a flowchart showing a process of generating a determination polynomial and selecting a reference point in an edge selection unit and a reference point selection unit in FIG. 3;

【図7】図3の基準値計算部における基準値計算の処
理、或いは多項式値計算部における多項式値計算の処理
を示すフローチャートである。
FIG. 7 is a flowchart showing a process of calculating a reference value in a reference value calculating unit of FIG. 3 or a process of calculating a polynomial value in a polynomial value calculating unit;

【図8】図3の領域判定部における領域判定の処理を示
すフローチャートである。
FIG. 8 is a flowchart illustrating a region determination process performed by a region determination unit in FIG. 3;

【図9】領域判定の対象となる多角形の第1の例と、調
査点がこの多角形の内部にあるかどうかを説明する図で
ある。
FIG. 9 is a diagram illustrating a first example of a polygon to be subjected to area determination and whether or not a survey point is inside the polygon.

【図10】領域判定の対象となる多角形の第2の例と、
調査点がこの多角形の内部にあるかどうかを説明する図
である。
FIG. 10 shows a second example of a polygon to be subjected to area determination,
It is a figure explaining whether a survey point is inside this polygon.

【符号の説明】[Explanation of symbols]

1 入力装置 2 多角形データ格納装置 3 データ処理装置 4 出力装置 31 多角形データ読み込み部 32 エッジデータ生成部 33 調査点データ読み込み部 34 エッジ選択部 35 基準点選択部 36 基準値計算部 37 多項式値計算部 38 領域判定部 3a エッジデータファイル 3b 多項式格納バッファ DESCRIPTION OF SYMBOLS 1 Input device 2 Polygon data storage device 3 Data processing device 4 Output device 31 Polygon data read part 32 Edge data generation part 33 Survey point data read part 34 Edge selection part 35 Reference point selection part 36 Reference value calculation part 37 Polynomial value Calculation unit 38 Area determination unit 3a Edge data file 3b Polynomial storage buffer

Claims (8)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】直交座標系上の任意の点が、この直交座標
系上に存在する多角形で表現される閉領域に含まれるか
どうかを判定する領域判定装置であって、 判定対象となる点の座標を入力する入力手段と、 前記閉領域外にある点の座標を取得する基準点取得手段
と、 前記入力手段から入力された前記判定対象となる点と所
定の関係を有する前記多角形の辺を示す直線の式を取得
する式取得手段と、 前記式取得手段によって取得された前記直線の式のそれ
ぞれに、前記基準点取得手段によって取得された点の座
標を代入した結果を互いに乗じた積の符号に関する情報
を取得する基準情報取得手段と、 前記式取得手段によって取得された前記直線の式のそれ
ぞれに、前記入力手段から入力された前記判定対象とな
る点の座標を代入した結果を互いに乗じた積の符号に関
する情報を取得する判定情報取得手段と、 前記基準情報取得手段が取得した前記情報と前記判定情
報取得手段が取得した前記情報とが一致するかどうかを
判定する一致判定手段と、 前記一致判定手段の判定結果が一致である場合に、前記
判定対象となる点が前記閉領域外にあるという判定結果
を出力し、前記一致判定手段の判定結果が不一致である
場合に、前記判定対象となる点が前記閉領域内にあると
いう判定結果を出力する第1の出力手段と、を備える、 ことを特徴とする領域判定装置。
An area determination device for determining whether an arbitrary point on a rectangular coordinate system is included in a closed region represented by a polygon existing on the rectangular coordinate system, and is a determination target. Input means for inputting the coordinates of a point, reference point obtaining means for obtaining the coordinates of a point outside the closed area, and the polygon having a predetermined relationship with the point to be determined input from the input means An expression obtaining unit that obtains an expression of a straight line indicating the side of, and a result obtained by substituting the coordinates of the point obtained by the reference point obtaining unit into each of the expressions of the straight line obtained by the expression obtaining unit. Reference information acquiring means for acquiring information on the sign of the product, and the result of substituting the coordinates of the point to be determined inputted from the input means into each of the straight line equations acquired by the equation acquiring means. Each other Determination information obtaining means for obtaining information about a sign of a product multiplied by a number; match determining means for determining whether the information obtained by the reference information obtaining means matches the information obtained by the determination information obtaining means And, when the determination result of the coincidence determination unit is a match, outputs a determination result that the point to be determined is outside the closed region, and when the determination result of the match determination unit does not match, A first output unit that outputs a determination result that the point to be determined is within the closed region.
【請求項2】前記多角形の各頂点の座標を記憶する頂点
記憶手段と、 前記頂点記憶手段に記憶された各頂点の座標から前記多
角形の各辺を示す直線の式を算出する式算出手段と、を
備える、 ことを特徴とする請求項1に記載の領域判定装置。
2. A vertex storage means for storing coordinates of each vertex of the polygon, and an equation calculation for calculating an equation of a straight line indicating each side of the polygon from the coordinates of each vertex stored in the vertex storage means. The area determination device according to claim 1, comprising:
【請求項3】前記式取得手段は、両端の頂点の座標が前
記入力手段から入力された点の座標と所定の関係を有す
る辺を示す式を取得する、 ことを特徴とする請求項1または2に記載の領域判定装
置。
3. The formula obtaining means according to claim 1, wherein the formula obtaining means obtains a formula indicating a side having a predetermined relationship between the coordinates of the vertices at both ends and the coordinates of the point input from the input means. 3. The area determination device according to 2.
【請求項4】前記判定情報取得手段が取得した前記情報
が、前記式取得手段によって取得された前記直線の式の
それぞれに前記入力手段から入力された点の座標を代入
した結果を互いに乗じた積が0であることを示す場合
に、前記判定対象となる点は前記多角形の辺上にあると
いう判定結果を出力する第2の出力手段を備える、 ことを特徴とする請求項1乃至のいずれか1項に記載
の領域判定装置。
4. The information obtained by the determination information obtaining means is multiplied by a result obtained by substituting the coordinates of a point input from the input means into each of the straight line expressions obtained by the expression obtaining means. 4. The apparatus according to claim 1, further comprising a second output unit configured to output a determination result that the point to be determined is on a side of the polygon when the product indicates 0. 5. The area determination device according to any one of the above.
【請求項5】直交座標系上の任意の点が、この直交座標
系上に存在する多角形で表現される閉領域に含まれるか
どうかを判定する領域判定方法であって、 判定対象となる点の座標を入力する入力ステップと、 前記閉領域外にある点の座標を取得する基準点取得ステ
ップと、 前記入力ステップで入力された前記判定対象となる点と
所定の関係を有する前記多角形の辺を示す直線の式を取
得する式取得ステップと、 前記式取得ステップで取得した前記直線の式のそれぞれ
に、前記基準点取得ステップで取得した点の座標を代入
した結果を互いに乗じた積の符号に関する情報を取得す
る基準情報取得ステップと、 前記式取得ステップで取得した前記直線の式のそれぞれ
に、前記入力ステップで入力した前記判定対象となる点
の座標を代入した結果を互いに乗じた積の符号に関する
情報を取得する判定情報取得ステップと、 前記基準情報取得ステップで取得した前記情報と前記判
定情報取得ステップで取得した前記情報とが一致するか
どうかを判定する一致判定ステップと、 前記一致判定ステップでの判定結果が一致である場合
に、前記判定対象となる点が前記閉領域外にあるという
判定結果を出力する第1の出力ステップと、 前記一致判定ステップでの判定結果が不一致である場合
に、前記判定対象となる点が前記閉領域内にあるという
判定結果を出力する第2の出力ステップと、を含む、 ことを特徴とする領域判定方法。
5. An area determining method for determining whether an arbitrary point on a rectangular coordinate system is included in a closed area represented by a polygon existing on the rectangular coordinate system, and is a determination target. An input step of inputting coordinates of a point; a reference point obtaining step of obtaining coordinates of a point outside the closed region; and the polygon having a predetermined relationship with the point to be determined input in the input step An equation obtaining step of obtaining a straight-line equation indicating the side of, and a product obtained by multiplying each of the straight-line equations obtained in the equation obtaining step by a result obtained by substituting the coordinates of the point obtained in the reference point obtaining step. A reference information obtaining step of obtaining information relating to the sign of, and a result obtained by substituting the coordinates of the determination target point input in the input step into each of the straight line equations obtained in the equation obtaining step. A determination information obtaining step of obtaining information on a sign of a product obtained by multiplying the information by a code; and a match determination of determining whether the information obtained in the reference information obtaining step matches the information obtained in the determination information obtaining step. And a first output step of outputting a determination result that the point to be determined is outside the closed region when the determination result in the match determination step is a match, And a second output step of outputting a determination result that the point to be determined is within the closed region when the determination results do not match with each other.
【請求項6】前記判定情報取得ステップで取得した前記
情報が、前記式取得ステップで取得した前記直線の式の
それぞれに前記入力ステップで入力された点の座標を代
入した結果を互いに乗じた積が0であることを示す場合
に、前記判定対象となる点は前記多角形の辺上にあると
いう判定結果を出力する第3の出力ステップを含む、 ことを特徴とする請求項に記載の領域判定方法。
6. The product obtained by multiplying the information obtained in the determination information obtaining step by a result obtained by substituting the coordinates of the point input in the input step into each of the linear expressions obtained in the expression obtaining step. 6. A third output step of outputting a determination result indicating that the point to be determined is on a side of the polygon when 0 indicates 0. 6. The method according to claim 5 , wherein Area determination method.
【請求項7】直交座標系上の任意の点が、この直交座標
系上に存在する多角形で表現される閉領域に含まれるか
どうかを判定するプログラムを記憶した記憶媒体であっ
て、 判定対象となる点の座標を入力する入力ステップと、 前記閉領域外にある点の座標を取得する基準点取得ステ
ップと、 前記入力ステップで入力された前記判定対象となる点と
所定の関係を有する前記多角形の辺を示す直線の式を取
得する式取得ステップと、 前記式取得ステップで取得した前記直線の式のそれぞれ
に、前記基準点取得ステップで取得した点の座標を代入
した結果を互いに乗じた積の符号に関する情報を取得す
る基準情報取得ステップと、 前記式取得ステップで取得した前記直線の式のそれぞれ
に、前記入力ステップで入力した前記判定対象となる点
の座標を代入した結果を互いに乗じた積の符号に関する
情報を取得する判定情報取得ステップと、 前記基準情報取得ステップで取得した前記情報と前記判
定情報取得ステップで取得した前記情報とが一致するか
どうかを判定する一致判定ステップと、 前記一致判定ステップでの判定結果が一致である場合
に、前記判定対象となる点が前記閉領域外にあるという
判定結果を出力する第1の出力ステップと、 前記一致判定ステップでの判定結果が不一致である場合
に、前記判定対象となる点が前記閉領域内にあるという
判定結果を出力する第2の出力ステップとを実現するプ
ログラムを記憶した、 ことを特徴とする記憶媒体。
7. A storage medium storing a program for determining whether or not an arbitrary point on a rectangular coordinate system is included in a closed area represented by a polygon existing on the rectangular coordinate system. An input step of inputting coordinates of a target point; a reference point obtaining step of obtaining coordinates of a point outside the closed region; and a predetermined relationship with the point to be determined input in the input step. An expression obtaining step of obtaining an equation of a straight line indicating the side of the polygon, and a result obtained by substituting the coordinates of the point obtained in the reference point obtaining step into each of the equations of the straight line obtained in the expression obtaining step. A reference information acquisition step of acquiring information on the sign of the multiplied product; and a formula for the straight line acquired in the equation acquisition step. A determination information obtaining step of obtaining information on a sign of a product obtained by multiplying the results obtained by substituting a target, and whether the information obtained in the reference information obtaining step matches the information obtained in the determination information obtaining step. A first output step of outputting a determination result that the point to be determined is outside the closed region when the determination result in the match determination step is a match; And a second output step of outputting a determination result that the point to be determined is within the closed area when the determination result in the match determination step does not match, is stored. Storage medium.
【請求項8】前記判定情報取得ステップで取得した前記
情報が、前記式取得ステップで取得した前記直線の式の
それぞれに前記入力ステップで入力された点の座標を代
入した結果を互いに乗じた積が0であることを示す場合
に、前記判定対象となる点は前記多角形の辺上にあると
いう判定結果を出力する第3の出力ステップを実現する
プログラムを記憶した、 ことを特徴とする請求項に記載の記憶媒体。
8. The product obtained by multiplying the information obtained in the determination information obtaining step by multiplying each of the straight line equations obtained in the equation obtaining step by the results of substituting the coordinates of the point input in the input step into each of the straight line equations. Indicates that the point to be determined is on the side of the polygon when the value is 0. A program for realizing a third output step of outputting a result of the determination that the point to be determined is on a side of the polygon is stored. Item 8. The storage medium according to Item 7 .
JP09267246A 1997-09-30 1997-09-30 Area determination apparatus, method, and storage medium Expired - Fee Related JP3137050B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP09267246A JP3137050B2 (en) 1997-09-30 1997-09-30 Area determination apparatus, method, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP09267246A JP3137050B2 (en) 1997-09-30 1997-09-30 Area determination apparatus, method, and storage medium

Publications (2)

Publication Number Publication Date
JPH11110574A JPH11110574A (en) 1999-04-23
JP3137050B2 true JP3137050B2 (en) 2001-02-19

Family

ID=17442175

Family Applications (1)

Application Number Title Priority Date Filing Date
JP09267246A Expired - Fee Related JP3137050B2 (en) 1997-09-30 1997-09-30 Area determination apparatus, method, and storage medium

Country Status (1)

Country Link
JP (1) JP3137050B2 (en)

Also Published As

Publication number Publication date
JPH11110574A (en) 1999-04-23

Similar Documents

Publication Publication Date Title
JP3164617B2 (en) Apparatus and method for deforming character / graphics
JP5091570B2 (en) Image interpolation method and apparatus
JP4053021B2 (en) Image enlargement apparatus and program
JP5458814B2 (en) Numerical processing program, method and apparatus
JP3137050B2 (en) Area determination apparatus, method, and storage medium
US7636095B2 (en) Pixel delta interpolation method and apparatus
JP2002298153A (en) Generation of partial derivative for perspective correction texture coordinate in four-pixel texture pipeline
JPH04291685A (en) Clip tester circuit and clip testing method
JP3139431B2 (en) Connection determination device, method and recording medium
JP3315861B2 (en) Character generator
JP3305395B2 (en) Figure division device
JP3517119B2 (en) Computer-aided design apparatus, computer-aided design method, and computer-readable recording medium recording computer-aided design program
JP3479282B2 (en) Character and graphic transformation processor
JPH0729022A (en) Straight line plotting device
JP3039387B2 (en) Apparatus for calculating intersection of B-spline curve and straight line in three-dimensional CAD
JP4089806B2 (en) Curve generating device and method, and storage medium
JP2570954B2 (en) Straight line shape judgment method at the time of three-dimensional spline dimension conversion
JPH1125266A (en) Method for converting picture and device therefor
JP4362404B2 (en) Distance verification support program
JP2940294B2 (en) Drafting equipment
JP3003579B2 (en) Graphic processing method
JPH0731671B2 (en) Formula input editing method
JP3072756B2 (en) Drawing equipment
JP5287203B2 (en) Information processing apparatus and program
JP2007140998A (en) Three-dimensional shape processor, three-dimensional shape processing method, program and storage medium

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20001107

LAPS Cancellation because of no payment of annual fees