曲線上の矢印

Last modified: 2018 年 12 月 30 日 03 時

曲線上に矢印を入れて線積分の図示を再現する。関連: sample:矢印の描画

主な使用関数: Arrowheaddata, Listplot, Paramplot.

曲線上の矢印

曲線のプロット

円弧C1と折れ線L1を描画します:

Setwindow([-0.2,1.2], [-0.2,1.2]);

function f=f(t)
  f=[cos(t), sin(t)];
endfunction

C1=Paramplot('f(t)', 't=[0,%pi/2]');
L1=Listplot([1,0], [0,1], [0,0], [1,0]);

L1=Listplot([1,0],[0,1],[0,0],[1,0])により、(1,0) > (0,1) > (0,0) > (1,0)の順番に通る折れ線のプロットデータを得ることができます。

[このページのトップへ]

矢じり (矢印)

Arrowheaddata([0.5,0.5],Listplot([1,0],[0,1]),0.8,25,1.5,'lc')などにより、矢じりのプロットデータを得ます:

A1=Arrowheaddata([0.5, 0.5], Listplot([1, 0], [0, 1]),..
                 0.6, 25, 1.5, 'lc');  // ".."は関数の途中で改行するときに入れます
A2=Arrowheaddata([0, 0.5], Listplot([0, 1], [0, 0]),..
                 0.6, 25, 1.5, 'lc');
A3=Arrowheaddata([0.5, 0], Listplot([0, 0], [1, 0]),..
                 0.6, 25, 1.5, 'lc');
A4=Arrowheaddata(f(%pi/4), Paramplot('f(t)', 't=[0,2*%pi]'),..
                 0.6, 25, 1.5, 'lc');

Arrowheaddataについては、sample:矢印の描画に書いたとおりで、Arrowhead([0.5,0.5],Listplot([1,0],[0,1]),0.8,25,1.5,'lc')の最後のオプション'lc'は、矢じりの中心を(0.5,0.5)に合わせるように描画します。

[このページのトップへ]

ソースコード

scilabファイル(.sce)のダウンロード
Setwindow([-0.2,1.2], [-0.2,1.2]);

function f=f(t); f=[cos(t), sin(t)]; endfunction

C1=Paramplot('f(t)', 't=[0,%pi/2]');
L1=Listplot([1,0], [0,1], [0,0], [1,0]);

//Windisp(L1, C1);

A1=Arrowheaddata([0.5, 0.5], Listplot([1, 0], [0, 1]),..
                 0.6, 25, 1.5, 'lc');
A2=Arrowheaddata([0, 0.5], Listplot([0, 1], [0, 0]),..
                 0.6, 25, 1.5, 'lc');
A3=Arrowheaddata([0.5, 0], Listplot([0, 0], [1, 0]),..
                 0.6, 25, 1.5, 'lc');
A4=Arrowheaddata(f(%pi/4), Paramplot('f(t)', 't=[0,2*%pi]'),..
                 0.6, 25, 1.5, 'lc');

Openfile('tex/arrow_sample2.tex');
Beginpicture('2cm');
Setax(6, 'O')
//Drwline(Projpara(surface));
Drwline(L1, C1, A1, A2, A3, A4, 1.8);

Setpen(4);
Drwpt([1, 0], [0, 1] , [0, 0]);

Setpen(0.8);

Expr([0.5, 0.5], 'ws', 'C_1');
Expr([0, 0.5], 'w1', 'C_2');
Expr([0.5, 0], 's1.5', 'C_3');
Expr(f(%pi/4), 'ne', 'C_4');
Expr([1, 0], 'se', 'A');
Expr([0, 1], 'nw', 'B');

Setpen(0.8);
Endpicture(1);
Closefile();

[このページのトップへ]