I am trying to draw a circle with an offset, in gnuplot. I can do that by adding the offset in the equations, as shown below. However, I want to do some more complicated rendering, e.g. render multiple circles each with a different angular offset around an offset origin. The script would be much more comprehensive if I do that by changing the origin of each circle's plot.
I am testing with a single circle:
set size square
set parametric
set xrange [-2:2]
set yrange [-2:2]
set trange [0:2*pi]
set multiplot
# circle centered at 0,0
fx(t) = sin(t)
fy(t) = cos(t)
plot fx(t), fy(t)
# circle centered at -1,-1
fx(t) = -1 + sin(t)
fy(t) = -1 + cos(t)
plot fx(t), fy(t)
# can't center this circle properly at 1,1
set origin 0.113, 0.23
fx(t) = sin(t)
fy(t) = cos(t)
plot fx(t), fy(t)
To achieve an offset of (1, 1), I have to use an origin of (0.113, 0.233). So, what is the equation that gives these coordinates? I have tried various sin/cos combinations since this might be related to polar coordinates, but no lack. The same exact situation occurs when using polar mode instead of parametric mode.