How can I draw only part of an ellipse using TikZ? I was only the top left quarter of it. I tried to use a white square box to hide the rest, but that is a tedious and ineffective method.
[Tex/LaTex] Drawing an ellipse with TikZ
tikz-pgf
Related Solutions
PSTricks' ellipse syntax might be closer to your requirement. Here it is \psellipse(<centerX, centerY>)(<semi-major-length, semi-minor-length>)
.
\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture}[showgrid=true](8,6)
\psellipse[linecolor=red](4,3)(4,3)
\pscircle[linecolor=blue](4,3){2}
\end{pspicture}
\end{document}
Well, as Jake commented you have an underdefined problem so the best approach is the manually placed arc and be done with it. Because to automate it, you have to supply more info. A possibility is to make a quarter arc directly
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,calc}
\begin{document}
\begin{tikzpicture}[
dot/.style = {outer sep = +0pt, inner sep = +0pt, shape = circle, draw = black, label = {#1}},
small dot/.style = {minimum size = 1pt, dot = {#1}},
big dot/.style = {minimum size = 2pt, dot = {#1}},
line join = round, line cap = round, >=triangle 45
]
\node[ fill = black, big dot = {below: \(F\)}] (F) at (0, 0) {};
\node[ fill = black, big dot = {below: \(P_1\)}] (P1) at (2, 0) {};
\node[ fill = black, big dot = {above right=.25cm:\(P_2\)}] (P2) at (-2, 2) {};
\draw let
\p0 = ($(P2)-(F)$),
\p1 = ($(P1)-(P2)$)
in (P2|-P1) ++(\x1,0) arc (0:270:\x1 and \y0);
\end{tikzpicture}
\end{document}
A possible visual solution is to add
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,calc}
\begin{document}
\begin{tikzpicture}[
dot/.style = {outer sep = +0pt, inner sep = +0pt, shape = circle, draw = black, label = {#1}},
small dot/.style = {minimum size = 1pt, dot = {#1}},
big dot/.style = {minimum size = 2pt, dot = {#1}},
line join = round, line cap = round, >=triangle 45
]
\node[ fill = black, big dot = {below: \(F\)}] (F) at (0, 0) {};
\node[ fill = black, big dot = {below: \(P_1\)}] (P1) at (2, 0) {};
\node[ fill = black, big dot = {above right=.25cm:\(P_2\)}] (P2) at (-2, 2) {};
\begin{scope}[decoration={%
markings,%
mark=at position .5 with {\arrow[line width=0.4pt]{triangle 45}}%
},
]
\pgfpathmoveto{\pgfpointanchor{P1}{center}}
\pgfpatharcto{2.55cm}{4cm}{0}{0}{1}{\pgfpointanchor{P2}{center}}
\pgfgetpath\temppath
\pgfusepath{draw}
\pgfsetpath\temppath
\pgfdecoratecurrentpath{markings}
\end{scope}
\end{tikzpicture}
\end{document}
Best Answer
Next time, please remember to provide a Minimum (non-)Working Example.
In this case, just draw it as an arc: