Menu

#108 Add Intersection coordinate system documentation

Next Release
wont-fix
nobody
None
5
2019-12-01
2017-08-25
AndréC
No

Can you add to the official documentation 3.0.1a, the section 10.2.4 called Intersection Coordinate Systems P 87 of the manual 1.18 which works perfectly and which is very useful for teaching mathematics (planar geometry) in the sixth and fifth class in France (Junior High Scholl in the USA).
Thanks

Discussion

  • AndréC

    AndréC - 2018-05-02

    Which is very practical because it allows to solve a system of 2 equations to 2 unknown and thus to find the intersection of 2 straight lines whose intersection is not visible.
    This is not possible with the intersection library (section 13.3.2 of manual 3.0.1a).
    For example, we can calculate the intersection of two lines that do not intersect on the figure, like this:

    \documentclass{article}
    \usepackage{tikz}
    \begin{document}
    \begin{tikzpicture}
    \draw(0,0)coordinate(A)--(3,0)coordinate(B);
    \draw(0,2)--(3,1);
    \fill[red] (intersection of A--B and 0,2--3,1) circle (2pt);
    \end{tikzpicture}
    \end{document}
    

    Output:

    image

     

    Last edit: AndréC 2018-05-02
  • Torbjorn

    Torbjorn - 2018-05-06

    For reference, the description is still found in the .tex file of the manual, commented out with an additional comment saying it is deprecated:

    https://sourceforge.net/p/pgf/git/ci/master/tree/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex#l468

    That change came way back in 2008, with this commit: https://sourceforge.net/p/pgf/git/ci/3dba4acd1ced8625a41ab4af1e59f56a36f0933c/


    That said, it's perfectly possible to do this with intersections, but I think the lines have to be extended manually with e.g. the calc library. I cannot argue the fact that the old intersection coordinate system makes doing this a lot more convenient.

    \documentclass[border=5mm]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{intersections, calc}
    \begin{document}
    \begin{tikzpicture}
    \draw (0,0) coordinate(A) -- (3,0) coordinate(B);
    \draw (0,2) coordinate(C) -- (3,1) coordinate(D);
    \fill[red] (intersection of A--B and 0,2--3,1) circle (2pt);
    
    \path [name path=a, overlay] (A) -- ($(A)!2!(B)$);
    \path [name path=b, overlay] (C) -- ($(C)!2!(D)$);
    \path [name intersections={of=a and b,by={i}}];
    
    \fill [blue] (i) circle[radius=1pt];
    \end{tikzpicture}
    \end{document}
    
     
  • AndréC

    AndréC - 2018-05-06

    The advantage of the old intersection calculation system is that the intersection point calculation is performed via the resolution of a system by LaTeX itself. Therefore, there is no need to calculate the coordinates of this point manually or to enlarge the paths as you just did.
    As proof, I took your code by swapping \path and \draw.

    \documentclass[border=5mm]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{intersections, calc}
    \begin{document}
    \begin{tikzpicture}
    \path(0,0) coordinate(A) -- (3,0) coordinate(B);
    \path (0,2) coordinate(C) -- (3,1) coordinate(D);
    \fill[red] (intersection of A--B and 0,2--3,1) circle (2pt);
    
    \draw [name path=a, overlay] (A) -- ($(A)!2!(B)$);
    \draw [name path=b, overlay] (C) -- ($(C)!2!(D)$);
    \path [name intersections={of=a and b,by={i}}];
    
    \fill [blue] (i) circle[radius=1pt];
    \end{tikzpicture}
    \end{document}
    

    Mon image

     

    Last edit: AndréC 2018-05-06
  • Torbjorn

    Torbjorn - 2018-05-06

    You don't have to prove anything to me, and I'm not sure what you're trying to prove either. I was merely pointing out that it's possible to get the same result with the intersections library, at the same time acknowledging that it's less convenient than the old intersection cs.

     
  • Stefan Pinnow

    Stefan Pinnow - 2019-12-01
    • status: open --> wont-fix
     
  • Stefan Pinnow

    Stefan Pinnow - 2019-12-01
     
MongoDB Logo MongoDB