So I got this test case from clarification request.
419.8152880862418 223.5279534055319 (a)
525.8115296164167 792.9643728415421 (b)
237.1802273967507 143.92363279252706 (c)
21.913364764059363 3.2091172127826084 (d)
The correct answer should be:
Case #1: 2
I am currently returning 1.
My implementation says to only consider edges (a, b) and (d, a) as base. It returns stable for (a, b) and unstable for (d, a) because of "center mass" restriction.
My computations give me:
center mass: C_X = 380.4554373733711, C_Y = 365.15541833713826
perpendicular to (a, b): x=443.9771951765267, y=353.3313281442538 which is inside (a, b)
perpendicular to (d, a): x=449.70960296039976, y=240.0804762153328 which should be not inside (d, a)
Can you guys confirm / disprove these informations?
Anyone see where I could have made a mistake?