Theory of Horology

Theory of Horology


4-2 Sa,ple Program on "Gnuplot"

4-2-5 Drawing of Inner Terminal Curve (an example) of Hairspring

# setting the aspect ratio of graph
set size ratio 1

# setting the numbers of sample
set samples 100000

# setting of grid
set grid

# setting the kinds of lines of graph
set style line 1 linetype 1
set style line 1 linecolor 3
set style line 1 linewidth 2

set style line 2 linetype 1
set style line 2 linecolor 1
set style line 2 linewidth 2

set style line 3 linetype 1
set style line 3 linecolor -1
set style line 3 linewidth 1

set style line 4 linetype 1
set style line 4 linecolor 2
set style line 4 linewidth 2

# setting the y-range of graph
set yrange[-1.5:1.5]

# setting the label of x and y axes
set xlabel "{/=26 {x/r}{/=16 {0}}"
set ylabel "{/=26 {y/r}{/=16 {0}}"

# graphing
plot [-1.5:1.5] dummy=0,\
[-1.5:1.5] -sqrt(0.8154**2-(x-0.1846)**2) \
w l linestyle 1 title "r=0.8154",\
[-1.5:-0.34]sqrt(0.6308**2-x**2) \
w l linestyle 2 title "r=0.6308",\
[-0.34:-0.096]sqrt(0.18**2-(x+0.24)**2)+0.375\
w l linestyle 4 title "r=0.18" ,\
[-1.5:1.5] sqrt(1-x**2) w l linestyle 3 notitle,\
[-1.5:1.5] -sqrt(1-x**2) w l linestyle 3 notitle,\
[-1.5:1.5] sqrt(0.25-x**2) w l linestyle 3 notitle,\
[-1.5:1.5] -sqrt(0.25-x**2) w l linestyle 3 notitle,\
[-1.5:1.5] 0 w l linestyle 3 notitle

# designating the output format and option
set terminal jpeg

# designating the output file name
set output "innner-terminal-sample.jpeg"

# regraphing
replot

# resetting the format and output
set output
set terminal win
[EOF]

The execution result can be obtained as shown in the figure below.