public static double getTurtleHeading(double x1,double y1,
                                        double x2,double y2)
  {
    double heading = 0;
    // don't allow a divide by zero
    if (x1 == x2)
    {
      if (y2 > y1)
        heading = 180;
      else
        heading = 0;
    }
    // calculate the heading from the slope angle
    else {
      double slopeAngle = getSlopeAngle(x1,y1,x2,y2);
      heading = 180 - (90 - slopeAngle);
      if (x2 < x1)
        heading = heading * -1;
    }
    return heading;
  }