# How to flip surface normals outwards?

Please what’s the quickest way to simply flip the surface normals of a concave/convex polytope outwards e.g. I am hoping that there's a general way to get this over with using the 2-polytope (polygon) below as our scapegoat
I mean how can we make this

where $$\vec{n_0}, \vec{n_1}, \vec{n_2}, \vec{n_3}, \vec{n_4}, \vec{n_5}, \vec{n_6}, \vec{n_7}, \vec{n_8}, \vec{n_9}$$ are surface normals, $$ABCDEFGHIJ$$ the polytope (polygon) and $$c$$ the centroid

Contextually this problem is similar to this

• Follow the polytope path in one direction and perform cross product of each segment as a vector with its normal vector. Then the question of inward/outward is equivalent to check the orientation of the cross product wrt to the polytope plane (ie check the sign of the z coordinate). Jul 3, 2022 at 8:29

Label the vertices $$(p_{i})_{i=0}^{n}$$, so that $$p_{1} = A$$, $$p_{2} = B$$, …, $$p_{n} = J = p_{0}$$. The $$i$$th edge has direction vector $$(v_{i1}, v_{i2}) = p_{i} - p_{i-1}$$ for $$1 \leq i \leq n$$. If $$n_{i} = (n_{i1}, n_{i2})$$ denotes the unflipped normal vector on the $$i$$th edge, then the flipped normal is $$\operatorname{sgn}(v_{i1}n_{i2} - v_{i2}n_{i1})n_{i} = \frac{v_{i1}n_{i2} - v_{i2}n_{i1}}{|v_{i1}n_{i2} - v_{i2}n_{i1}|} n_{i}.$$ The multiplier, which is $$1$$ if the direction-to-normal quarter-turn is counterclockwise and $$-1$$ if clockwise, implements jlandercy's comment
• More simply, use the 2D unary cross product, $\times(v_1,v_2)=(-v_2,v_1)$, and ignore the original normal vectors. Jul 7, 2022 at 23:03