3, 4, 5 Triangle

Author

Eric W. Weisstein
July 22, 2014

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Polygons/3,4,5Triangle.nb.

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

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

Deifnitions

ineq=y≥0&&12 a≥3 x+4 y&&x≥0;

implreg=ImplicitRegion[ineq,{x,y}];

reg=Triangle[{{0,0},{0,3},{4,0}}a];

assum=a>0;

t=Triangle[3𝒶,4𝒶,5𝒶]

abc=Simplify[SideLengths[Evaluate[t]],𝒶>0]

Plots

Diagram

LaminaData["Filled345Triangle","Diagram"]

DiscretizeRegion

Block[{a=1},Show[DiscretizeRegion[reg],ImageSize->Small]]

RegionPlot

Block[{a=1},RegionPlot[ineq,{x,0,4a},{y,0,3a},AspectRatio->Automatic,ImageSize->Small,Frame->False]]

Figure

g=Graphics[{
Line[{{0, 0}, {4, 0}, {0, 3}, {0,0}}],Line[.2{{1,0},{1,1},{0,1}}],
Text[3,{-.15,1.5}],
Text[4,{1.8,-.25}],
Text[5,{2.2,1.7}]
}]

Properties

Area

Area

Assuming[assum,Simplify@Area[reg]]

Integrate

Assuming[a>0,Area[ineq,{x,y}]]

RegionMeasure

Assuming[assum,Simplify@RegionMeasure[reg]]

AreaInertiaTensor

Assuming[a>0,AreaInertiaTensor[ineq[x,y],{x,y}]]

Centroid

Integrate

Assuming[a>0,Centroid[ineq[x,y],{x,y}]]

RegionCentroid

Assuming[assum,Simplify@RegionCentroid[reg]]

Circumcircle

Simplify[Circumcircle[t],𝒶>0]/.𝒶->a

Incircle

Simplify[Incircle[t],𝒶>0]/.𝒶->a

Inequalities

FullSimplify[Inequalities[Polygon[a{{0, 0}, {4, 0}, {0, 3}}],{x,y}],a>0]

ineq[x_,y_]:=y≥0&&12 a≥3 x+4 y&&x≥0

RadiiOfGyration

Assuming[a>0,FullSimplify[RadiiOfGyration[ineq[x,y],{x,y}]]]

Length Distribution

Monte Carlo

ineq[x,y]/.a->1

f[x_,y_]:=y≥0&&12≥3 x+4 y&&x≥0

minx=0;
maxx=4;
miny=0;
maxy=3;

Length[pts=Partition[Select[Table[{RandomReal[{minx,maxx}],RandomReal[{miny,maxy}]},{10^6}],f@@#&],2]]//Timing

Graphics[Transpose[{{Red,Blue},Point/@Transpose[Take[pts,10^4]]}]]

Through[{Min,Mean,Max}[ds=Norm/@(Subtract@@@pts)]]

Histogram[ds]

Mean

in=And@@ineq@@@{{x1,y1},{x2,y2}}/.a->1

in=y1≥0&&12≥3 x1+4 y1&&x1≥0&&y2≥0&&12≥3 x2+4 y2&&x2≥0;

Numerical

(1/(6^2))NIntegrate[Sqrt[(x1-x2)^2+(y1-y2)^2]Boole[in],{x1,0,4},{x2,0,4},{y1,0,3},{y2,0,3}]

Symbolic

IntegrateWithAssumptions[Sqrt[(x1-x2)^2+(y1-y2)^2]Boole[in],{x1,0,4},{x2,0,4},{y1,0,3},{y2,0,3}]//Timing

res=(1/(6^2))((4092/125)+((106 ArcCoth[2])/5)+((6413154 ArcSinh[(3/4)])/390625)+((129188589 ArcSinh[(4/3)])/6250000)-(1024/625) Log[(3/2)]+((927238912 Log[2])/5859375)+(352/5) Log[(8/3)]-((2280124283 Log[3])/93750000)-((162507 Log[4])/1250)+(7784/125) Log[(16/3)]-((627849547 Log[6])/5859375)-((64 Log[8])/3)-64 Log[9]-(64/3) Log[(256/27)]+(192/5) Log[(32/3)]-((36919647 Log[12])/156250)-((14353 Log[16])/250)-8 Log[24]-((64 Log[27])/3)+(216/125) Log[(256/9)]-((128 Log[32])/5)+((288 Log[48])/5)+((192 Log[60])/5)+((40 Log[64])/3)+((4071136 Log[72])/78125)+((64 Log[128])/3)-((64 Log[144])/3)-((192 Log[160])/5)+((27 Log[192])/10)+72 Log[216]-((2511 Log[256])/500)-64 Log[(32768/27)]+64 Log[4096]-64 Log[4608]+((64 Log[6561])/3)+((192 Log[8192])/5)-((192 Log[32768])/5)+64 Log[41472]-8 Log[59049]-((64 Log[279936])/3)+((64 Log[21233664])/3)-((64 Log[134217728])/3)-8 Log[4294967296]-((64 Log[5159780352])/3)-((32 Log[41278242816])/5)+((64 Log[68719476736])/3)-8 Log[295147905179352825856]+8 Log[79228162514264337593543950336]+8 Log[32 (2^(23/125))]+64 Log[8 (2^(69/250))]+(64/3) Log[64 (2^(69/125))]+4 Log[209952 (2^(102/125))]+64 Log[9 (3^(47/128))]);

N[res]

(res2=FullSimplify[res])//Timing