ハルコンは三角形の内接円を描きます

ハルコンは三角形の内接円を描きます

ニュース2023/5/27 7:14:

目次

  • 1. 三角形の 3 つの角の点を見つけます
  • 2. 定規とコンパスに似た描画方法で三角形の中心を取得します。
    • 1. 三角形の点で円形の輪郭を描きます
    • 2. 三角形の輪郭と円形の輪郭の間の交点を見つけます
    • 3. 角の二等分線を求め、三角形の角の二等分線との交点が円の中心になります
  • 3. 円の中心から辺までの最短距離、つまり半径を求めます。

1. 三角形の 3 つの角の点を見つけます

前回の記事「Halconが三角形のエッジを抽出して角点を求める」を参照してください。

2. 定規とコンパスに似た描画方法で三角形の中心を取得します。

三角形の3辺を中心とした円形の輪郭線を3つ生成し、
輪郭線と輪郭線の交点を求め
、その交点を中心として円形の輪郭線を描き、2つの円と円の交点を求めます。角の二等分線。三角形の角の二等分線の交点が円の中心になります。

1. 三角形の点で円形の輪郭を描きます

gen_circle_contour_xld (ContCircle1, RowA, ColumnA, 20, 0, 6.28318, 'positive', 1)
gen_circle_contour_xld (ContCircle2, RowB, ColumnB, 20, 0, 6.28318, 'positive', 1)
gen_circle_contour_xld (ContCircle3, RowC, ColumnC, 20, 0, 6.28318, 'positive', 1)

ここに画像の説明を挿入

2. 三角形の輪郭と円形の輪郭の間の交点を見つけます

intersection_contours_xld (Contour, ContCircle3, 'all', Row, Column, IsOverlapping1)
intersection_contours_xld (Contour, ContCircle1, 'all', Row2, Column2, IsOverlapping3)
intersection_contours_xld (Contour, ContCircle2, 'all', Row4, Column4, IsOverlapping5)

3. 角の二等分線を求め、三角形の角の二等分線との交点が円の中心になります

//以交点为圆心画出两个同半径圆,两圆交点连线即为角平分线
gen_circle_contour_xld (ContCircle31, Row[0], Column[0], 40, 0, 6.28318, 'positive', 1)
gen_circle_contour_xld (ContCircle32, Row[1], Column[1], 40, 0, 6.28318, 'positive', 1)
intersection_contours_xld (ContCircle31, ContCircle32, 'all', Row1, Column1, IsOverlapping2)
disp_line (3600, Row1[0], Column1[0], Row1[1], Column1[1])gen_circle_contour_xld (ContCircle21, Row2[0], Column2[0], 40, 0, 6.28318, 'positive', 1)
gen_circle_contour_xld (ContCircle22, Row2[1], Column2[1], 40, 0, 6.28318, 'positive', 1)
intersection_contours_xld (ContCircle21, ContCircle22, 'all', Row3, Column3, IsOverlapping4)
disp_line (3600, Row3[0], Column3[0], Row3[1], Column3[1])gen_circle_contour_xld (ContCircle11, Row4[0], Column4[0], 40, 0, 6.28318, 'positive', 1)
gen_circle_contour_xld (ContCircle12, Row4[1], Column4[1], 40, 0, 6.28318, 'positive', 1)
intersection_contours_xld (ContCircle11, ContCircle12, 'all', Row5, Column5, IsOverlapping6)
disp_line (3600, Row5[0], Column5[0], Row5[1], Column5[1])

ここに画像の説明を挿入
線を延長して交点を見つけます

r:= Row1[0] - Row1[1]
n:= Column1[0] - Column1[1]
k1:= r/n
b1:=Row1[1] - k1*Column1[1]
row1:=k1*5+b1
row12:=k1*2500+b1
disp_line (3600, row1, 5, row12, 2500)
r:= Row3[0] - Row3[1]
n:= Column3[0] - Column3[1]
k1:= r/n
b1:=Row3[1] - k1*Column3[1]
row2:=k1*5+b1
row22:=k1*2500+b1
* disp_line (3600, RowBegin, ColBegin, RowEnd, ColEnd)
disp_line (3600, row2,5 , row22, 2500)
r:= Row5[0] - Row5[1]
n:= Column5[0]- Column5[1]
k1:= r/n
b1:=Row5[1] - k1*Column5[1]
row3:=k1*5+b1
row32:=k1*2500+b1
disp_line (3600, row3,5 , row32, 2500)//求出圆心 Row6, Column6
intersection_lines (row2, 5, row22, 2500, row3,5 , row32, 2500, Row6, Column6, IsOverlapping7)

ここに画像の説明を挿入

3. 円の中心から辺までの最短距離、つまり半径を求めます。

distance_pc(Contour, Row6, Column6, DistanceMin, DistanceMax)
gen_circle_contour_xld (ContCircle, Row6, Column6, DistanceMin, 0, 6.28318, 'positive', 1)

ここに画像の説明を挿入

おすすめ

転載: blog.csdn.net/u014090257/article/details/131046968