Linked Questions

7
votes
1answer
4k views

Using sin inside of tikz ``\foreach`` [duplicate]

Possible Duplicate: Problems with TikZ calculations I am trying to generate a surface in tikzpicture environment. The surface is composed of spheres so I have created this: \documentclass{...
1
vote
0answers
348 views

How to use trigonometric functions in tikz coordinates [duplicate]

Possible Duplicate: Problems with TikZ calculations I am trying to get the following arrows to get lengths defined by a trigonometric function, in this case cos. This was my attempt, but it does ...
37
votes
3answers
24k views

Using math in TikZ

I know it has been asked and answered before, and I need to put { and } around it, but for some reason this doesn't work: \draw (0,0) -- ({atan(1)}:{sqrt(2)}); Any idea why?
15
votes
1answer
10k views

TikZ \foreach loop evaluate variable using pgfmath function

I have problem with defining a new variable within the \foreach loop using the evaluate option using a pgfmath function: \documentclass{article} \usepackage{tikz} \begin{document} \begin{...
8
votes
2answers
1k views

TikZ: can I get an arbitrary list format for foreach?

I'd like very much to define a foreach loop that looks like this: \foreach \pointA-\pointB in {(1,0)-(2,2),(3,4)-(2,1)}{ \draw \pointA -- \pointB } so that for each couple of points the lines ...
5
votes
2answers
948 views

Calculations and undefined control sequence with TikZ

I already produced several figures with TikZ, but I can't see what's wrong with this snippet: \documentclass[a4paper,10pt,twoside]{scrbook} \usepackage[utf8x]{inputenc} \usepackage{tikz} \begin{...
6
votes
1answer
2k views

Apply Math operations on loaded data inside PGF/Tikz plot

What I want: \abs{S21/S12-1}*100% where S21 and S12 are columns in txt-files What I have: no idea; really. I am profoundly unsure, if it is even possible in PGF/tikz to make this calculation. If ...
2
votes
1answer
2k views

Drawing nodes by polar coordinates with translation

I have plotted 12 nodes in a circle with radius 2 and center (0,0) (I suppose). Now I want to plot it once more in the same figure but with centre (2,0), how could this be achieved? Many thanks for ...
5
votes
1answer
588 views

Tikz error: Missing number, treated as zero

I am having an issue with Tikz. Here is the code: \begin{tikzpicture}[scale=0.6] % Variables \def\mu{0.1} \def\R{10} %Celestial bodies \draw [thick, fill=yellow] (0,0) circle (1); \draw [thick, ...
3
votes
1answer
393 views

Syntax error: missing semi-colon

After a few days working and reading about tikz and with everyone help, I'm starting to reach my goals. One of my graphs was working ok, but I decided to make it accept "parameters", hence I would be ...
6
votes
1answer
98 views

Why do we need extra braces in ellipse when using a constant?

What is the best way to declare a constant to be used within TikZ? I am using \pgfmathsetmacro because I have seen others do it on this site. A constant should be a simple thing, so I am bit confused ...
1
vote
1answer
78 views

Tikz error when using trigonometric functions

When I use the following code: \usetikzlibrary{calc} \begin{tikzpicture} \draw (0,0) circle (.2*tan(10) and .4*tan(10)); \end{tikzpicture} ... then I get an error message. How can I solve this ...