3
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
every label/.append style = {font = \scriptsize},
dot/.style = {inner sep = +0pt, shape = circle,
  draw = black, label = {#1}},
small dot/.style = {minimum size = .05cm, dot = {#1}},
big dot/.style = {minimum size = .1cm, dot = {#1}},
]
\node[fill = black, big dot = {below left: \(F\)}] (F) at (2, 0) {};
\node[fill = black, big dot = {above left: \(A\)}] (A) at (2, 0) -- ++({2 * cos(45)}, {3 * sin(45)}) {};
\end{tikzpicture}
\end{document}

I want my node to be 45 degrees from the point (2, 0) and not the origin. How can I do this?

With Jakes comment, the node is placed correctly but the dot isn't the correct size.

 \path (2, 0) -- ++({2 * cos(45)}, {3 * sin(45)})
 node[fill = black, big dot = {above right: \(A\)}] (A) {x};

enter image description here

By removing the {x} as suggested by Qrrbrbirlbel, Jakes comment worked perfectly.

 \path (2, 0) -- ++({2 * cos(45)}, {3 * sin(45)})
 node[fill = black, big dot = {above right: \(A\)}] (A) {};
dustin
  • 18,617
  • 23
  • 99
  • 204

1 Answers1

4

You can use the shift option inside the coordinate options, this is the same as adding the coordinates.

Instead of ({2 * cos(45)}, {3 * sin(45)}), I have also used a polar coordinate: (45:3 and 2). The space after the x radius is mandatory so if you have the radii saved in a macro, you need to do (45:{\xr} and \yr) or (45:\xr\space and \yr).

There is no difference between

([shift=(F)] 45:3 and 2)

and

([shift=(45:3 and 2)] F)

If you want to place a bunch of nodes relatively to F, you might use a scope:

\begin{scope}[shift=(F)]
     % many \nodes
\end{scope}

or—as in my example—you specify the shift as an option to the path (remember that \node simply expands to \path node):

\path[shift=(F)] \foreach \Angle in {90,135,...,360} {
                                    node[big dot={\Angle:\Angle}] at (\Angle:3 and 2) {}};

If you load the calc library, you also have the possibility to do

($(F)+(45:3 and 2)$)

Code

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[
  every label/.append style = {font = \scriptsize},
  dot/.style = {inner sep = +0pt, shape = circle,
    draw = black, label = {#1}},
  small dot/.style = {minimum size = .05cm, dot = {#1}},
  big dot/.style = {minimum size = .1cm, dot = {#1}},
]
\node[fill = blue,  big dot = {below:      \(O\)}] (O) at (0,0) {};
\node[fill = black, big dot = {below left: \(F\)}] (F) at (2, 0) {};
\node[fill = black, big dot = {above left: \(A\)}] (A) at ([shift=(F)] 45:3 and 2) {};
\path[shift=(F)] \foreach \Angle in {90,135,...,360} {
                                    node[big dot={\Angle:\Angle}] at (\Angle:3 and 2) {}};
\end{tikzpicture}
\end{document}

Output

enter image description here

Qrrbrbirlbel
  • 119,821
  • Can you add in Jake's answer with your suggestion of removing the {x}? I only ask because that is what I used but Jake deleted his comments and didn't pose a solution. – dustin Jul 06 '13 at 18:40