LaTeX forum ⇒ Graphics, Figures & Tables ⇒ A node on an exact coordinate Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
ehud
Posts: 3
Joined: Tue Jul 18, 2017 11:38 pm

A node on an exact coordinate

I want my filldraw circle to be placed at coordinates (x,y)=(cos(30°), sin(30°)) - a point on the unit circle with angle 30°.
These are (actually) equivalent to (x,y)=(√3/2,1/2), or approximately (0.866,0.5).

So, how can I assign these coordinate as (cos(30°), sin(30°)) to my node, label, or any other object in my TikZ document, so that I am not working in the approximated regime?

\documentclass[tikz,border=2mm]{standalone}\begin{document}\begin{tikzpicture}[scale=1]\draw [help lines] (-4,-4) grid (4,4);\filldraw [black] (0,0) circle [radius=2pt];\filldraw [black] (+0.866,-0.5) circle [radius=2pt]; %right\filldraw [black] (-0.866,-0.5) circle [radius=2pt]; %left\filldraw [black] (0,1) circle [radius=2pt];         %top\draw [blue, very thin] (0,0) circle [radius=1 cm];\end{tikzpicture}\end{document}

thomasb
Posts: 76
Joined: Thu Aug 03, 2017 10:54 am
Location: france
Formulas seem to be for plot function only (section 3.9, page 11) : http://cremeronline.com/LaTeX/minimaltikz.pdf

(redit : Tikz doesn't have \frac{\pi}{2} (section 2.12, page 32) : http://www.texample.net/media/pgf/builds/pgfmanualCVS2012-11-04.pdf)

rais
Posts: 146
Joined: Sun Nov 16, 2014 8:51 pm
ehud wrote:I want my filldraw circle to be placed at coordinates (x,y)=(cos(30°), sin(30°)) - a point on the unit circle with angle 30°.
These are (actually) equivalent to (x,y)=(√3/2,1/2), or approximately (0.866,0.5).

So, how can I assign these coordinate as (cos(30°), sin(30°)) to my node, label, or any other object in my TikZ document, so that I am not working in the approximated regime?

you could use polar coordinates, see texdoc pgfmanual', section (2.15) Specifying Coordinates.
\documentclass[tikz,border=2mm]{standalone}    \begin{document}    \begin{tikzpicture}[scale=1]    \draw [help lines] (-4,-4) grid (4,4);    \filldraw [black] (0,0) circle [radius=2pt];    \filldraw [black] (+0.866,-0.5) circle [radius=2pt]; %right    \filldraw [black] (-0.866,-0.5) circle [radius=2pt]; %left    \filldraw [black] (0,1) circle [radius=2pt];         %top    \filldraw [red] (30:1) circle [radius=2pt];  % top right    \filldraw [red] (150:1) circle [radius=2pt]; % top left    \filldraw [red] (270:1) circle [radius=2pt]; % bottom    \draw [blue, very thin] (0,0) circle [radius=1 cm];    \end{tikzpicture}    \end{document}`

KR
Rainer

ehud
Posts: 3
Joined: Tue Jul 18, 2017 11:38 pm
@rais - Thank you. It works.