Triangle

Author

Eric W. Weisstein
February 15, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Polygons/Triangle.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Triangle.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Figure

V5

t=Triangle[{{0,0},{1,0},{.3,.7}}];
Show[Graphics[{
t,
PointLabels[
Transpose[{VertexPoints[t],{"A","B","C"}}],
PointSize[.025],LabelOffset->.04
]
}],AspectRatio->Automatic,PlotRange->All]

V6

t=Triangle[{{0,0},{1,0},{.3,.7}}];
Graphics[{
t,
PointLabels[
Transpose[{{"A","B","C"},VertexPoints[t],{LabelOffset->-.04,LabelOffset->.04{1,-1},LabelOffset->.06{0,1}}}]
]}]

Special Named Triangles

Triangles

Semiperimeter Identity

s=(a+b+c)/2;

FullSimplify[s-b-(a-b+c)/2]

Top Vertex Position in Terms of Sides

soln={x,y}/.FullSimplify[Solve[{x^2+y^2==b^2,(x-c)^2+y^2==a^2},{x,y}]]

FullSimplify[Together[(b^2)-((((-(a^2)+(b^2)+(c^2)))^2)/(4 (c^2)))]]

Factor//@Together//@soln

Simplify[ToAngles[%],TriangleQ[]&&Area>0]

Show[Graphics[Triangle[3,4,5]],AspectRatio->Automatic]

Sum of interior Angles = π

cos[α]=(b^2+c^2-a^2)/(2b c);
cos[β]=(-b^2+c^2+a^2)/(2c a);
cos[γ]=(-c^2+a^2+b^2)/(2a b);

Simplify[PowerExpand[Together//@(TrigExpand[Cos[α+β+γ]]/.{Cos[x_]:>cos[x],Sin[x_]:>Sqrt[1-cos[x]^2]})]]

ArcCos[%]

Angles in term of Side Lengths

Factor[Simplify[Together//@ToSidelengths[TrigExpand[Cos[#]]],TriangleQ[]]]&/@{A-B,B-C,C-A}

InputForm[%]

Identities

TriangleQ[]

cos(n A)-cos(n (B+C))

FullSimplify[(1/8) (Cos[4 A]-Cos[4 (B+C)]),A+B+C==Pi]

FullSimplify[(Cos[2 A]-Cos[2 (B+C)])/.C->Pi-(A+B)]

FullSimplify[(Cos[4 A]-Cos[4 (B+C)])/.C->Pi-(A+B)]

FullSimplify[(Cos[6A]-Cos[6(B+C)])/.C->Pi-(A+B)]

-(cos^2)(B)-(cos^2)(C)+1==(cos^2)(A)+2 cos(B) cos(C) cos(A)

FullSimplify[Subtract@@{1-((Cos[B])^2)-((Cos[C])^2),((Cos[A])^2)+2 Cos[A] Cos[B] Cos[C]}/.C->π-(A+B),TriangleQ[]]

Resolve[ForAll[{a,b,c},
tri,
Evaluate[DistanceTrilinears[Subtract@@(1-((Cos[B])^2)-((Cos[C])^2)==((Cos[A])^2)+2 Cos[A] Cos[B] Cos[C])]==0]
]]

FullSimplify[TrigExpand[1-((Cos[B])^2)-((Cos[C])^2)-(((Cos[A])^2)+2 Cos[A] Cos[B] Cos[C])],A+B+C==Pi]

cot((A/2))+cot((B/2))+cot((C/2))==cot((A/2)) cot((B/2)) cot((C/2))

Resolve[ForAll[{a,b,c},
tri,
Evaluate[DistanceTrilinears[Subtract@@(Plus@@(Cot[#/2]&/@{A,B,C})==Times@@(Cot[#/2]&/@{A,B,C}))]==0/.
Cot[x_]:>(1+Cos[2x])/Sin[2x]]
]]//Timing

FullSimplify[DistanceTrilinears[Subtract@@(Plus@@(Cot[#/2]&/@{A,B,C})==Times@@(Cot[#/2]&/@{A,B,C}))/.
Cot[x_]:>(1+Cos[2x])/Sin[2x]],TriangleQ[]]

Simplify[Subtract@@{Cot[A/2]Cot[B/2]Cot[C/2] , Cot[A/2]+Cot[B/2]+Cot[C/2]},TriangleQ[]]

Side Parallels

Show[GraphicsArray[Table[
			Show[Graphics[{Triangle[tri],Medians[tri],SideParallels[tri,r]}],
			AspectRatio->Automatic,DisplayFunction->Identity],
			{r,.1,.9,.2}],
DisplayFunction->$DisplayFunction]]

Properties

Inequalities

tri=Polygon[{{0,0},{c,0},{((-(a^2)+(b^2)+(c^2))/(2 c)),(1/(2c)) (Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])}}];

Block[{a=1,b=2,c=1.5},Graphics[tri]]

FullSimplify[Inequalities[tri,{x,y}],a>0&&b>0&&c>0&&(a+b-c) (a-b+c) (-a+b+c) (a+b+c)>0]

ineq[x_,y_]:=y≥0&&(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]) x+((a^2)+(c^2)) y≤c (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])+(b^2) y&&(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]) x+(a^2) y≥((b^2)+(c^2)) y

Block[{a=1,b=1.5,c=.6,d=.7},RegionPlot[ineq[x,y],{x,0,Max[c,((-(a^2)+(b^2)+(c^2))/(2 c))]},{y,0,(1/(2c)) (Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])},AspectRatio->Automatic]]

Centroid

(1/((1/4) √(-(a-b-c) (a+b-c) (a-b+c) (a+b+c))))Integrate[{x,y}Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&c>0&&(Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])>0]

FullSimplify[%,a>0&&b>0&&c>0]

Area

(area=Integrate[Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&c>0&&(Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])>0])//Timing

Δ=(1/4) √(-(a-b-c) (a+b-c) (a-b+c) (a+b+c));

FullSimplify[{(1/4) c (Sqrt[4 (b^2)-(c^2)]),Δ},a>0&&a-b==0&&c>0&&a+b-c>0]

FullSimplify[{(((c^2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))/(2 ((a^2)-(b^2)+(c^2)))),Δ},a>0&&b>0&&a-b>0&&(Sqrt[(a^2)-(b^2)])-c==0&&a^2-b^2==c^2&&c>0]

FullSimplify[{(((c^2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))/(2 (-(a^2)+(b^2)+(c^2)))),Δ},a>0&&a-b<0&&(Sqrt[-(a^2)+(b^2)])-c==0&&b^2-a^2==c^2&&c>0]

InertiaTensor

V7

(i=Integrate[AreaInertiaTensor[{x,y}]Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&c>0&&(Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])>0])//Timing

FullSimplify[%,a>0&&b>0&&c>0]

...last one wrong...

V7 GenerateConditions -> True

(i=Integrate[AreaInertiaTensor[{x,y}]Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},GenerateConditions->True,Assumptions->a>0&&b>0&&c>0&&(Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])>0])//Timing

FullSimplify[i,a>0&&b>0&&c>0]

V8

(i=Integrate[AreaInertiaTensor[{x,y}]Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&c>0&&(Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])>0])//Timing

FullSimplify[i,a>0&&b>0&&c>0]

FullSimplify[%,(a<b&&((a+b>c&&(Sqrt[-(a^2)+(b^2)])<c)||((Sqrt[-(a^2)+(b^2)])>c&&a+c>b)))||(a>b&&(((Sqrt[(a^2)-(b^2)])>c&&a<b+c)||(a+b>c&&(Sqrt[(a^2)-(b^2)])<c)))]

{{(((((a+b-c) (a-b+c) (-a+b+c) (a+b+c)))^(3/2))/(96 (c^2))),-(((a-b-c) (a+b-c) (a-b+c) (a+b+c) ((a^2)-(b^2)-2 (c^2)))/(96 (c^2))),-(((a-b-c) (a+b-c) (a-b+c) (a+b+c) ((a^2)-(b^2)-2 (c^2)))/(96 (c^2))),(((Sqrt[(a+b-c) (a-b+c) (-a+b+c) (a+b+c)]) (((((a^2)-(b^2)))^2)+4 (-(a^2)+(b^2)) (c^2)+7 (c^4)))/(96 (c^2)))}

Factor[(((((a^2)-(b^2)))^2)+4 (-(a^2)+(b^2)) (c^2)+7 (c^4))]

(i=Integrate[AreaInertiaTensor[{x,y}]Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},GenerateConditions->True,Assumptions->a>0&&b>0&&c>0&&(Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])>0])//Timing

i[[1,1]]

i[[2,2]]

Block[{a=1,b=1,c=1},NIntegrate[AreaInertiaTensor[{x,y}]Boole[ineq[x,y]],{x,0,Max[c,((-(a^2)+(b^2)+(c^2))/(2 c))]},{y,0,(1/(2c)) (Sqrt[(-a+b+c) (a+b-c) (a-b+c) (a+b+c)])}]]

Block[{a=1,b=1,c=1},i]//N

FullSimplify[i,a==b==c&&c>0]

FullSimplify[i,a≠b&&(Sqrt[(a^2)-(b^2)])≠c&&(Sqrt[(b^2)-(a^2)])≠c&&a>0&&b>0&&c>0&&(a<b&&((a+b>c&&(Sqrt[-(a^2)+(b^2)])<c)||((Sqrt[-(a^2)+(b^2)])>c&&a+c>b)))]

RadiiOfGyration

FullSimplify[(1/((1/4) √(-(a-b-c) (a+b-c) (a-b+c) (a+b+c))))√Tr[{{((((-(a-b-c) (a+b-c) (a-b+c) (a+b+c)))^(3/2))/(96 (c^2))),-(((a-b-c) (a+b-c) (a-b+c) (a+b+c) ((a^2)-(b^2)-2 (c^2)))/(96 (c^2)))},{-(((a-b-c) (a+b-c) (a-b+c) (a+b+c) ((a^2)-(b^2)-2 (c^2)))/(96 (c^2))),(((Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]) (((((a^2)-(b^2)))^2)+4 (-(a^2)+(b^2)) (c^2)+7 (c^4)))/(96 (c^2)))}},List],a>0&&c>0&&(a+b-c) (a-b+c) (-a+b+c) (a+b+c)>0]

Incircle

FullSimplify[Incircle[Triangle[{{0,0},{c,0},{((-(a^2)+(b^2)+(c^2))/(2c)),((Sqrt[(-a+b+c)(a-b+c)(a+b-c)(a+b+c)])/(2c))}}]],a>0&&b>0&&c>0&&(-a+b+c)(a-b+c)(a+b-c)>0]

Circumcircle

FullSimplify[Circumcircle[Triangle[{{0,0},{c,0},{((-(a^2)+(b^2)+(c^2))/(2c)),((Sqrt[(-a+b+c)(a-b+c)(a+b-c)(a+b+c)])/(2c))}}]],a>0&&b>0&&c>0&&(-a+b+c)(a-b+c)(a+b-c)>0]