0

I'm writing a Script for a math lecture. The professor draws some sketches and there are a few of sets, sometimes including other sets or points. There would be a way I know by seting some points and conect them with an given input and output angle, but that would be pretty much work and would propebly not be completly smooth on the corners. Normaly I draw pictures in the TeX-document with Tikz and I try to keep everything relativ so I would like to avoid mesurements like "cm" or somthing simular. I was looking in the Internet for quite some time now to find a easy solution to draw what I want. But now to the question it self.

Is there an easy way to draw a sketch of a mathematical set (in best case by giving some coordinates on the outer line) useing Tikz and avoiding absolute mesurements (like in plots)?

Something like this is what I would like to get as an output

The relevant part of the picture is the \Omega-set and the U-set.

Thanks in advance for any kind of help.

Kai
  • 105
  • 2
    There is this saying: "Ein Bild sagt mehr als tausend Worte" –  May 02 '19 at 21:06
  • 4
    The answer to your question is: yes there is, see chapter IV Graph Drawing of the pgfmanual. If you make your question more concrete, then the chances of getting a more concrete answer will increase a lot, I think. –  May 02 '19 at 21:09
  • 3
    You could be looking for the hobby library, which allows you to draw a smooth curve through some points. \documentclass[tikz,border=3.14mm]{standalone} \usetikzlibrary{hobby,shapes.misc} \begin{document} \begin{tikzpicture}[use Hobby shortcut] \draw[dashed,rotate=-90,scale=2] (3,0) .. +(1,0) .. +(1,2) .. +(1,3) .. +(0,3) .. (3,0); \draw[densely dashed] (2.5,-5.5) coordinate (M) circle[radius=2cm]; \draw[-] (M) node[cross out,label=below:$z$] {}-- ++ (180:2) node[midway,below]{$\rho$}; \end{tikzpicture} \end{document} –  May 03 '19 at 00:02
  • @marmot you should post your fine sketch as an answer! :) –  May 03 '19 at 04:29
  • 4
    I'm voting to close this question as off-topic because this is a just-do-it-for-me question. – Raaja_is_at_topanswers.xyz May 17 '19 at 07:56

1 Answers1

5

This discussion is closely related to this one, and I borrow the peanut shape from this nice answer by the author of the hobby library, which seems to be the tool you were looking for. In my above comment I forgot to draw the cross, which I am doing now, and the comment was mainly to gauge if this goes in the right direction.

\documentclass[tikz,border=3.14mm]{standalone} 
\usetikzlibrary{hobby,shapes.misc} 
\begin{document} 
\begin{tikzpicture}[use Hobby shortcut] 
\draw[dashed,rotate=-90,scale=2] (3,0) .. +(1,0) .. +(1,2) .. +(1,3) .. 
+(0,3) .. (3,0); 
\draw[densely dashed] (2.5,-5.5) coordinate (M) circle[radius=2cm]; 
\draw[-] (M) node[cross out,label=below:$z$,inner sep=0.6ex,draw] {}-- ++ 
(180:2) node[midway,below]{$\rho$}; 
\end{tikzpicture} 
\end{document}    

enter image description here