Relative vs Absolute
CJam, 57 53 49

{"NESW""FRBL"_3$&amp;!!:Q$:R^^f#0\{{+0\}Q*_@-R=\}%);}


Previous version

{"NESW""FRBL"_3$0=#W&gt;:Q{\}*:R;f#0\{{+0\}Q*_@-R=\}%);}


Example:

{"NESW""FRBL"_3$0=#W&gt;:Q{\}*:R;f#0\{{+0\}Q*_@-R=\}%);}:T;
"NNWEESEE"T
N
"FFLBFRLF"T


Output:

FFLBFRLF
NNWEESEE


How it works

{
  "NESW""FRBL"             " Push the two strings. ";
  _3$0=#W&gt;                 " Check if the first character is in FRBL. ";
  :Q                       " Assign the result to Q. ";
  {\}*                     " Swap the two strings if true. ";
  :R;                      " Assign the top string to R and discard it. ";
  f#                       " Find each character of the input in the string. ";
  0\                       " Push a 0 under the top of the stack. ";
  {                        " For each item (index of character): ";
    {                      " If Q: ";
      +0\                  " A B -&gt; 0 (A+B) ";
    }Q*
    _@-                    " C D -&gt; D (D-C) ";
    R=                     " E -&gt; E-th character in R ";
    \                      " Swap the top two items. ";
  }%
  );                       " Discard the last item in the list. ";
}