Q:

Why do these two TikZ instructions produce different results?

I'm playing around with intersections to draw an illustration for a lecture about optics. However, I'm having a few issues as the following example shows:
%!TEX encoding = UTF-8 Unicode
%!TEX program = lualatex
\documentclass[11pt,a4paper,fleqn,pdftex]{report}
\usepackage[dvipsnames, table]{xcolor}
\usepackage[utf8]{luainputenc} 
\usepackage[latin,english]{babel}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes.geometric}

\begin{document}
    \begin{figure}[!h]
   \centering
   \begin{tikzpicture}
      \coordinate (M2) at (0,3);
      \def\angleM{10}
% >>>>>>>>>>>>>>>>
      \draw[color=Red, thick] (M2) --  (intersection cs: first line={(M2)--++(90 - \angleM:-8)}, second line={(45:-4)--(45:4)}) circle (2pt);
      \draw[color=Red, thick] (intersection cs: first line={(M2)--++(90 - \angleM:-8)}, second line={(45:-4)--(45:4)}) circle (2pt) -- (M2);
% <<<<<<<<<<<<<<<<
      \draw[thick] (M2) ++(1,0) -- ++(-2,0) node[left]{$M_2$};
      \fill[pattern=north east lines] (M2) ++(1,0) rectangle ++(-2,0.2);
      \draw[very thick] (45:-2) -- (45:2);
   \end{tikzpicture}
\end{figure}
\end{document}

In this example, the two lines between % >>>>>… and % <<<<… should draw the same lines, but don't as you can see here: 

While the instructions are almost the same (only the draw direction differs), the lines don't overlap as they should. What can I do to avoid this? 

A:

This seems to be a rounding problem. This problem and the one discussed in TikZ not computing intersection suggest that there are some problems with the intersection coordinate system (in fact, the PGF manual doesn't mention it and only presents an example of its use).
Anyway, as a workaround, you could load the intersections library and then do
\path
  [name path=line1] (M2) -- ++(90 - \angleM:-8) 
  [name path=line2] (45:-4) -- (45:4); 
\draw[Red,thick,name intersections={of=line1 and line2}] 
  (intersection-1) circle (2pt) -- (M2);

this is just a bit longer than using the intersection cs, but you won't be troubled by different results resulting from rounding problems. A complete example showing both approaches side-by-side:
%!TEX encoding = UTF-8 Unicode
%!TEX program = lualatex
\documentclass[11pt,a4paper,fleqn,pdftex]{report}
\usepackage[dvipsnames, table]{xcolor}
\usepackage[utf8]{luainputenc} 
\usepackage[latin,english]{babel}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{intersections}

\begin{document}

   \begin{tikzpicture}[baseline]
      \coordinate (M2) at (0,3);
      \def\angleM{10}
% >>>>>>>>>>>>>>>>
      \draw[color=Red, thick] (M2) --  (intersection cs: first line={(M2)--++(90 - \angleM:-8)}, second line={(45:-4)--(45:4)}) circle (2pt);
      \draw[color=Red, thick] (intersection cs: first line={(M2)--++(90 - \angleM:-8)}, second line={(45:-4)--(45:4)}) circle (2pt) -- (M2);
% <<<<<<<<<<<<<<<<
      \draw[thick] (M2) ++(1,0) -- ++(-2,0) node[left]{$M_2$};
      \fill[pattern=north east lines] (M2) ++(1,0) rectangle ++(-2,0.2);
      \draw[very thick] (45:-2) -- (45:2);
   \end{tikzpicture}\qquad
%
   \begin{tikzpicture}[baseline]
      \coordinate (M2) at (0,3);
      \def\angleM{10}

      \path
        [name path=line1] (M2) -- ++(90 - \angleM:-8) 
        [name path=line2] (45:-4) -- (45:4); 
      \draw[Red,thick,name intersections={of=line1 and line2}] 
        (intersection-1) circle (2pt) -- (M2);

      \draw[thick] (M2) ++(1,0) -- ++(-2,0) node[left]{$M_2$};
      \fill[pattern=north east lines] (M2) ++(1,0) rectangle ++(-2,0.2);
      \draw[very thick] (45:-2) -- (45:2);
   \end{tikzpicture}

\end{document}

