GPS and compass steering to waypoint

Hello,

Firstly I’m new to the whole programming scene, though have had some luck in the past by following instructions with a little bit of guidance.

I have been researching a ton on the problem that I face, and there are several threads on this site and others that have the same issue, though never have seemed to get working.

I have a boat, and I would like to turn it out, it receives a GPS signal and records this as Waypoint 1. It then takes a heading in the direction that I am pointing the craft with a compass on and records this as a heading.

I would then like some code to calculate a waypoint of a given distance perpendicular from Waypoint 1 and record this as Waypoint 2.

The craft then uses the compass to maintain the heading with a servo connected to the rudder, while navigating to Waypoint 2 also using the servo.

Some guidance and help with the code would be absolutely fantastic. I know there are some of you on here that have replied to similar threads in the past, and I appreciate that.

Im thinking about using the Mega2560, any GPS module, compass and servo powered from a 12 v battery. The whole thing doesnt need to be super accurate, I would however like the craft to go more or less in a straight line from my start point, dealing with currents and tides as it navigates to the waypoint 2.

Cheers,

Zac