Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a custom command

\newcommand\windturbine[2][]{
  \begin{scope}[shift={(#2)}]
    \draw[#1] (0,0) ellipse (0.7cm and 0.1cm);
    \draw[#1] (0.8,0) circle (0.1cm );
    \draw[#1] (1.6,0) ellipse (0.7cm and 0.1cm);
  \end{scope}
}

Lets draw two wind turbine

\begin{tikzpicture}

  \windturbine[draw=black,fill=black, very thick]{0,0};  
  \windturbine[draw=black,fill=black, very thick]{0,7};

\end{tikzpicture}

I would like to rotate the first one with x degree and connect the two drawings with a line, how can I achieve that?

share|improve this question
    
Does this topic help? –  masu Oct 15 '13 at 12:10
    
Not, that doesn't solve my problem. –  run Oct 15 '13 at 12:35
add comment

1 Answer

up vote 3 down vote accepted

I couldn't find out which one is the "first" (the first you wrote, or the first on the page). Why don't you use the rotate option?

If you set the middle of the coordinates in the middle of the turbine (rewrite the \windturbine command like this), you can easily connect them with a line (using their coordinates).

\documentclass{minimal}

\usepackage{tikz}

\newcommand\windturbine[2][]{
  \begin{scope}[shift={(#2)}]
    \draw[#1] (-0.8,0) ellipse (0.7cm and 0.1cm);
    \draw[#1] (0,0) circle (0.1cm );
    \draw[#1] (0.8,0) ellipse (0.7cm and 0.1cm);
  \end{scope}
}

\begin{document}

\begin{tikzpicture}[scale=2]

  \windturbine[draw=black,fill=black, very thick]{0,0};  
  \windturbine[draw=black,fill=black, very thick, rotate=30]{0,7};
    \draw[very thick] (0,0) -- (0,7);

\end{tikzpicture}

\end{document}
share|improve this answer
    
Thanks for your help, I have one more question, how can I create a node from the \windturbine? –  run Oct 15 '13 at 15:37
    
Check this topic. –  masu Oct 15 '13 at 15:45
    
@run did it help? –  masu Oct 16 '13 at 13:13
    
Yes, Thank you, that solved my problem, –  run Oct 16 '13 at 13:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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