I'm having trouble getting normals (red) from line segments (blue). So far I have all of the normals, but half of them are pointing in the opposite direction.
The code to get the normal is at: https://github.com/sjhalayka/ms_curvature/blob/c3ddbd5d9a995a7241b915c9570248fe331362c1/main.h#L281
The code to draw the normal is at: https://github.com/sjhalayka/ms_curvature/blob/c3ddbd5d9a995a7241b915c9570248fe331362c1/main.h#L123
Thanks for any ideas.
![](https://uploads.gamedev.net/forums/monthly_2020_03/c47bf03ce5654c38aef2443c5a320a15.normals.png)