In PGF it is easy to let PGF find the intersection between two defined lines or intersections between one circle and a line etc.
Are there any construct in PGF, or does it exist any macro, which gives intersection between an ellipses and a line say?
Kent Holing
NORWAY
Graphics, Figures & Tables ⇒ intersections
- Stefan Kottwitz
- Site Admin
- Posts: 10315
- Joined: Mon Mar 10, 2008 9:44 pm
intersections
Hi Kent,
sure, you can make an intersection of the paths, give them a name before.
If you like, post your example with the ellipse, and we will see how to exactly write this intersection.
Stefan
sure, you can make an intersection of the paths, give them a name before.
If you like, post your example with the ellipse, and we will see how to exactly write this intersection.
Stefan
LaTeX.org admin
intersections
Code: Select all
%Say I have the below circle node c1 definition
\coordinate (O) at (0,0);
\coordinate (A) at (2.0,2.0);
\coordinate [label=left:$B$] (B) at (-2.0,2.0);
\coordinate [label=above:$S$] (S) at (2.0,3.0);
\node (c1) [draw,red,thick,circle through=(B)] at (S) {};
%and the following ellipse definition
\draw[green,thin,] (A) ellipse (5.0cm and 2.0cm);
%how do I create a node c2 for the ellipse such that I can use
\coordinate (X) at (intersection 2 of c1 and c2);
%to get one of the intersections between the circle and the ellipse?
intersections
I have tried several ways to define the (c2) ellipse node, but I can't make it work.
Anybody help?
Anybody help?
- Stefan Kottwitz
- Site Admin
- Posts: 10315
- Joined: Mon Mar 10, 2008 9:44 pm
intersections
Here is an example of intersections of a circle and an ellipse.
Stefan
Code: Select all
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\coordinate (A) at (2.0,2.0);
\draw [name path = c1, red, thick] (A) circle [radius = 4cm];
\draw [name path = c2, green, thin] (A) ellipse (5.0cm and 2.0cm);
\draw [name intersections = {of = c1 and c2}]
(intersection-1) -- (intersection-2) -- (intersection-3)
-- (intersection-4) -- cycle;
\end{tikzpicture}
\end{document}
LaTeX.org admin
intersections
Thanks!
Very nice indeed. This is PGF version 3?
I see that I need to install the latest PGF version. Mine is too old for the stuff I like to do.
Kent
Very nice indeed. This is PGF version 3?
I see that I need to install the latest PGF version. Mine is too old for the stuff I like to do.
Kent
- Stefan Kottwitz
- Site Admin
- Posts: 10315
- Joined: Mon Mar 10, 2008 9:44 pm
intersections
Yes, I use PFG/TikZ version 3. It has been released already more than 3 years ago, so time to update.
See news post with features: TikZ and PGF 3.0 released on CTAN.
Stefan

Stefan
LaTeX.org admin