I noticed when using the wrapdateline mode the X values go past -180 and 180. To fix this I used:
if (x < -180 || x > 180)
{
x %= 180;
}
However, this doesn’t really work because once you go past 180 it should hit -179, instead it hits 181 which would give 1 using the formula above. I feel like this is something that should be figured out automatically when using the wrap mode.
Any ideas?