0

How can I draw between two specific coordinates? Cord are (1,0) and (5,0)

\documentclass{article}
\usepackage[margin=1.5cm,top=1cm,headheight=16pt,headsep=0.1in,heightrounded]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes,positioning,intersections,quotes}
\usetikzlibrary{positioning} % <---

    \begin{document}
    \begin{tikzpicture}
    %\path[name path=t] (1,0) to[out=90,in=180] (2,1) to[out=0,in=90] (3,0); % top arc
    \draw[blue] (0,0)--++(0,1);
    \draw[red] (0,1)--++(6,0);
    \draw[yellow] (6,1)--(6,0);
    \draw[green] (0,0)--(1,0);
    \draw[orange] (6,0)--++(-1,0);
    \draw[magenta] (1,0) arc
        [
            start angle=160,
            end angle=20,
            x radius=2cm,
            y radius =0.5cm
        ] ;
    \end{tikzpicture}
    \end{document}

enter image description here

3
  • Is what you want different from what you get? (then, what do you want?)
    – user202729
    May 17 at 15:11
  • An arc betwenn (0,1) and (5,0) coordinates May 17 at 15:14
  • stackoverflow.com/a/198137/2907484 may help. If you need exactly an ellipse with the given radiuses; otherways you can just (0,1) to [bend left] (5,0)
    – Rmano
    May 17 at 15:28

2 Answers 2

2

Here are some different arcs:

\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[yshift=0cm]  (1,0) to [bend right=45] (5,0);
\draw[yshift=2cm]  (1,0) to [bend left=45] (5,0);
\draw[yshift=4cm]  (1,0) to [out=135, in=45] (5,0);
\draw[yshift=6cm]  (1,0) to [out=135, in=45, looseness=2] (5,0);
\end{tikzpicture}
\end{document}

Four different arcs

4
  • Add an example with OP's MWE to make the answer complete.
    – antshar
    May 17 at 15:49
  • @antshar: I can not do that, as I do not understand what OPs code has to do with the question. May 17 at 15:57
  • Clearly, they want to connect ends of a polyline with an arc (magenta) imgur.com/EAGAmEl
    – antshar
    May 17 at 16:03
  • 1
    @antshar I disagree on the word "clearly". May 17 at 19:57
3
\documentclass{article}
\usepackage[margin=1.5cm,top=1cm,headheight=16pt,headsep=0.1in,heightrounded]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes,positioning,intersections,quotes,patterns,positioning} % <---
\begin{document}
\begin{tikzpicture}
    \draw[gray,pattern=dots, pattern color=gray,] (0,0)--++(0,1) 
    to (0,1)--++(12,0)
    to (12,1)--(12,0) 
    to (12,0)--(11,0)
    to (11,0) to [bend left=-15] (1,0)
    to (1,0) to (0,0);
\end{tikzpicture}
\end{document}

enter image description here

1
  • 4
    Do not use the answer section to ask a new question. Please delete this "answer". TikZ will rotate around (0,0) if nothing else is given. You can specify the point to rotate around with rotate around={180:(6,5)} - choose the coordinates to be above the center of your shape. May 17 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.