Skip to content

Intersections are incorrect under transformations #889

Description

@AndreC75

The problem is explained here: How to make so that the calculation of an intersection is correct during a change of scale?

\documentclass{article}
\usepackage{tikz}   
\usetikzlibrary{calc,intersections}
\usepackage{esvect}
   
\begin{document}

Faux 

 \begin{tikzpicture}[x={(-1,0)},scale=0.9]
\coordinate (O) at (0,0);
\coordinate (Od) at ($(O)+(0.4,0)$);
\coordinate (Og) at ($(O)-(0.4,0)$);

\draw[dashed] ($(O)-(0,3.5)$) -- ($(O) +(0,1.5)$);
\draw[blue,thick,fill=green!40] (Og) --++(-4,0)coordinate(bout) coordinate[pos=0.8](Of)--++(0,-0.2) --++(3.7,-0.3) --++(0,-1.5)coordinate(Ob)-|(Og);
\draw[blue,thick,fill=green!40] (Od) --++(0.3,0)coordinate(Oa) -- (Ob-|Oa) -| (Od);
\draw[fill] (Od) coordinate(A) circle (0.05) node[above left]{$A$};
\draw[fill] (Og|-Ob) coordinate(B) circle (0.05) node[below right]{$B$};
\draw[latex-,ultra thick] (Of)node[above left]{$\vv{F}$}node[below]{$C$} -- ++(0,1.5);

\draw[thin, red,opacity=0.3,fill] ($(A) +(2,0.6)$) -- (A) --($(A) +(2,-0.6)$);
\draw[name path =aa, dashed,red] (A) --++(-5,-1.5);
\draw[ultra thick, red, -latex] (A) -- ++(3,0.9)node[above]{$\vv{R_A}$};
\draw[thin, red,opacity=0.3,fill] ($(B) +(-2,0.6)$) -- (B) --($(B) +(-2,-0.6)$);
\draw[ultra thick, red, -latex] (B) -- ++(-3,0.9)node[above]{$\vv{R_B}$};
\draw[name path =bb, dashed,red] (B) --++(-5,1.5);

\coordinate [name intersections={of=aa and bb, by=I}];
\draw [dashed, blue] (I)node[below]{$I$} --++(0,3);

\draw[thin,-latex] ($(O)+(0,1)$)coordinate(oo) -- node[above]{$x_{lim}$} (oo-|I);
\draw[-latex] (O) -- (-5,0) node[below]{$\vv{x}$};
\draw[-latex] (O) -- (0,2) node[right]{$\vv{y}$};
\end{tikzpicture}

Correct

 \begin{tikzpicture}[x={(-1,0)}]
\coordinate (O) at (0,0);
\coordinate (Od) at ($(O)+(0.4,0)$);
\coordinate (Og) at ($(O)-(0.4,0)$);

\draw[dashed] ($(O)-(0,3.5)$) -- ($(O) +(0,1.5)$);
\draw[blue,thick,fill=green!40] (Og) --++(-4,0)coordinate(bout) coordinate[pos=0.8](Of)--++(0,-0.2) --++(3.7,-0.3) --++(0,-1.5)coordinate(Ob)-|(Og);
\draw[blue,thick,fill=green!40] (Od) --++(0.3,0)coordinate(Oa) -- (Ob-|Oa) -| (Od);
\draw[fill] (Od) coordinate(A) circle (0.05) node[above left]{$A$};
\draw[fill] (Og|-Ob) coordinate(B) circle (0.05) node[below right]{$B$};
\draw[latex-,ultra thick] (Of)node[above left]{$\vv{F}$}node[below]{$C$} -- ++(0,1.5);

\draw[thin, red,opacity=0.3,fill] ($(A) +(2,0.6)$) -- (A) --($(A) +(2,-0.6)$);
\draw[name path =aa, dashed,red] (A) --++(-5,-1.5);
\draw[ultra thick, red, -latex] (A) -- ++(3,0.9)node[above]{$\vv{R_A}$};
\draw[thin, red,opacity=0.3,fill] ($(B) +(-2,0.6)$) -- (B) --($(B) +(-2,-0.6)$);
\draw[ultra thick, red, -latex] (B) -- ++(-3,0.9)node[above]{$\vv{R_B}$};
\draw[name path =bb, dashed,red] (B) --++(-5,1.5);

\coordinate [name intersections={of=aa and bb, by=I}];
\draw [dashed, blue] (I)node[below]{$I$} --++(0,3);

\draw[thin,-latex] ($(O)+(0,1)$)coordinate(oo) -- node[above]{$x_{lim}$} (oo-|I);
\draw[-latex] (O) -- (-5,0) node[below]{$\vv{x}$};
\draw[-latex] (O) -- (0,2) node[right]{$\vv{y}$};
\end{tikzpicture}
\end{document}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions