# How to find each internal angles of an n-sided irregular polygon

The vectors given in problem are:

p1 = {1, 2, 2};
p2 = {3, 1, 1/4};
p3 = {2, 3, 9/4};
p4 = {5, 2, 0};
p5 = {3/2, 5/4, 19/16};


Find all 5 of the (internal) angles of S. Note that the internal angles of an n-sided polygon always add up to . Give the angles in degrees in numerical value.

I tried VectorAngle[p3 - p1, p5 - p1] 3*Pi // N I don't think the answer is correct.

p1 = {1, 2, 2};
p2 = {3, 1, 1/4};
p3 = {2, 3, 9/4};
p4 = {5, 2, 0};
p5 = {3/2, 5/4, 19/16};
pts = {p1, p2, p3, p4, p5}
chReg = ConvexHullRegion[pts]


angs = PolygonAngle[chReg]*180/\[Pi] // N

{104.946, 105.07, 141.61, 137.942, 50.4316}

Total[angs]

540.


Visualization:

Graphics3D[{
EdgeForm[Black]
, Black
, Line@pts
, AbsolutePointSize[10]
, Red, Point@pts
, LightRed, chReg
}
, Boxed -> True
]


This is an extended comment, because I am a bit confused.

In the OP the following is given:

p1 = {1, 2, 2};
p2 = {3, 1, 1/4};
p3 = {2, 3, 9/4};
p4 = {5, 2, 0};
p5 = {3/2, 5/4, 19/16};


from which we can create a Polygon

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

Graphics3D[poly]


From the above picture, I count $$9$$ internal angles. Based on this table the sum of angles of the Nonagon is equal to $$1260$$. Which can be easily derived using PolygonAngle in the following manner:

FullSimplify@Total@PolygonAngle[poly] /. Pi -> 180 Degree


• It is strange that SimplePolygonQ@poly returns True because poly is a self-intersecting polygon: Graphics3D[{poly, Red, Sphere[#, .1] & /@ {p1, p2, p3, p4, p5}}]. Commented Apr 7, 2022 at 5:40
• A proof: {RegionIntersection[Line[{p1, p2}], Line[{p4, p5}]], RegionIntersection[Line[{p2, p3}], Line[{p4, p5}]]}. Commented Apr 7, 2022 at 6:23
• @AlexeyPopkov thanks for bringing this up. I did not check it myself. That's strange indeed.
– bmf
Commented Apr 7, 2022 at 15:22
• Wolfram support confirmed that it is a known bug in SimplePolygonQ ([CASE:4930736]). Commented Apr 8, 2022 at 2:11
• @AlexeyPopkov many thanks again for this. Do you want to write an answer? Should I just update the existing answer? Nothing is required? Not sure to be honest
– bmf
Commented Apr 8, 2022 at 2:12