位置:首頁(yè) > 軟件操作教程 > 其它 > 其它 > 問(wèn)題詳情

Origin畫(huà)出擬合曲線(xiàn)上任意一點(diǎn)的切線(xiàn)的方法

提問(wèn)人:周麗平發(fā)布時(shí)間:2021-09-23

1、記下如下代碼:

dotool 3; // Data Reader tool

def pointproc {

dotool -q;

%b=xof(%c); // X dataset for the current one

p1=(%C[index+1]-%C[index])/(%b[index+1]-%b[index]);

p2=(%C[index]-%C[index-1])/(%b[index]-%b[index-1]);

p=(p1+p2)/2;

c=y-p*x;

ftang(x)=$(p)*x+$(c);

layer -i200 ftang; // Plot as Line...

set ftang -c 4; // ...in blue

};

2、先將數(shù)據(jù)處理好,畫(huà)出擬合曲線(xiàn)。

image.png

3、快捷鍵ALT+3打開(kāi)腳本窗口,復(fù)制上述腳本至腳本窗口中,按回車(chē)運(yùn)行。

image.png

4、此時(shí)Data Reader Tool會(huì)被激活,鼠標(biāo)指針變成十字方框,用此工具選擇圖像中的任意一點(diǎn),雙擊后切線(xiàn)將自動(dòng)生成。

image.png

image.png

5、如有需要,可以自行制作一個(gè)按鈕將此腳本關(guān)聯(lián)。

至此,切線(xiàn)的繪制完成。

如需要制作多條切線(xiàn),把ftang

ftang(x)=$(p)*x+$(c);

layer -i200 ftang; // Plot as Line...

set ftang -c 4; // ...in blue

};

改成不同的名字后重新運(yùn)行就可以了。

ftang2(x)=$(p)*x+$(c);

layer -i200 ftang; // Plot as Line...

set ftang2 -c 4; // ...in blue

};

繼續(xù)查找其他問(wèn)題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部