Hello everyone
I have problems designing an algorithm for my rc sailing boat which decides if the course given is possible to sail or if it is necessary to go beating.
I have given the direction of the wind, which can be calculated by the direction relative to the boat and a compass, and a direction the boat should go transferred to the arduino by rc.
My trouble is now to define the sector of the circle (0-359degrees), in which the boat has to beat and cannot sail directly.
My idea was to define : direction is ok if smaller than wind direction - 35 degrees, or bigger than wind direction + 35 degrees.
This unfortunately only works if the north (0 degrees) is between these two boundaries. I don't know how to define it for the case that e.g. the sector is 280 - 350 degrees.
I hope it is understandable what I mean, thank you for all help ![]()
PS: please link me to any topic where this problem is already discussed, but I didn't find any ![]()