1
$\begingroup$

Is there a fuction suitable for if to calculate this kind geometry?

I used the formula for the area of the triangle

enter image description here

p1={0,0};
p2={24,50};
p3={86,110};
p4={120,0};
pointDistance=RegionNearest[Line[{p3,p4}],p2];
lineBlack=Line[{p1,p2,p3,p4,p1}];
lineRed={Dashed,Red,Line[{p2,p4}]};
lineDistance={Dashed,Red,Line[{p2,pointDistance}]};
Graphics[{lineBlack,lineRed,lineDistance}]
area1=(EuclideanDistance[p1,p4]*p2[[2]])/2//N
area1=(EuclideanDistance[p2, pointDistance]*EuclideanDistance[p3, p4])/2//N
areaTotal=area1+area2

IMAGEM

$\endgroup$
  • $\begingroup$ Very intelligent reasoning, but the code is very large. $\endgroup$ – LCarvalho Dec 7 '16 at 15:06
  • $\begingroup$ I also found it, but I had no idea of ​​the possibilities $\endgroup$ – user45104 Dec 7 '16 at 15:07
2
$\begingroup$

You can use the function Polygon and function Area where this use "Region".

poly = Polygon[{p1, p2, p3, p4}];
Graphics[poly]

IMAGEM

Area[poly]

7430

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy