三角形顶点的切线圆

时间:2016-12-03 11:48:57

标签: python math geometry computational-geometry

我正在努力将公式转换为article并将其转换为Python或任何代码,主要是因为我发现很难阅读数学公式。理想情况下,考虑到 A B C 的位置,找出半径 a&#39; ,< em> b&#39; 和 c&#39; 左侧的图片。任何帮助都会得到真正的帮助。

Tangent Circles At Triangle Vertices

1 个答案:

答案 0 :(得分:2)

如果点A的顶点坐标为(xb, yb),点B(xc, yc),点Ca = math.sqrt((xb - xc)**2 + (yb - yc)**2) b = math.sqrt((xa - xc)**2 + (ya - yc)**2) c = math.sqrt((xb - xa)**2 + (yb - ya)**2) ra = (b + c - a) / 2 rb = (c + a - b) / 2 rc = (a + b - c) / 2 ,则可以使用

ra, rb, rc

,所需的半径在a'。 (我不知道如何将ra等翻译成Python,所以我使用a, b, c等。)值Sub RevRemoveDuplicates(SheetIndex As Integer, Optional FIRSTRANGE As String = "A9:J9") Application.ScreenUpdating = False Dim Target As Range, TempColumn As Range With Worksheets(SheetIndex) Set Target = .Range(FIRSTRANGE, .Range(FIRSTRANGE).End(xlDown)) Set TempColumn = Target.Offset(0, Target.Columns.Count).Resize(, 1) With TempColumn .Cells(1, 1).Value = 1 .DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, Step:=1, Trend:=False .EntireRow.Sort Key1:=.Cells(1, 1), Order1:=xlDescending .Clear End With Target.RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlNo With TempColumn .Cells(1, 1).Value = 1 .DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, Step:=1, Trend:=False .EntireRow.Sort Key1:=.Cells(1, 1), Order1:=xlAscending .Clear End With End With Application.ScreenUpdating = True End Sub 是三角形边长。请注意,我从链接的文章中稍微改变了公式,使它们更加对称,令我赏心悦目。