diff options
Diffstat (limited to 'Master/texmf-dist/doc/support')
321 files changed, 17863 insertions, 204 deletions
diff --git a/Master/texmf-dist/doc/support/ketcindy/Scriptkelib.txt b/Master/texmf-dist/doc/support/ketcindy/Scriptkelib.txt index bd9197bac9d..b8fbed38694 100644 --- a/Master/texmf-dist/doc/support/ketcindy/Scriptkelib.txt +++ b/Master/texmf-dist/doc/support/ketcindy/Scriptkelib.txt @@ -1,4 +1,4 @@ -use("KetCindyPlugin");
-Dircdy=loaddirectory;
-setdirectory(plugindirectory);
-import("dirhead.txt");
+use("KetCindyPlugin"); +Dircdy=loaddirectory; +setdirectory(plugindirectory); +import("ketcindy.ini"); diff --git a/Master/texmf-dist/doc/support/ketcindy/CindyJS/Cindy.js b/Master/texmf-dist/doc/support/ketcindy/ketcindyjs/Cindy.js index 04aa2fd9134..04aa2fd9134 100644 --- a/Master/texmf-dist/doc/support/ketcindy/CindyJS/Cindy.js +++ b/Master/texmf-dist/doc/support/ketcindy/ketcindyjs/Cindy.js diff --git a/Master/texmf-dist/doc/support/ketcindy/CindyJS/CindyJS.css b/Master/texmf-dist/doc/support/ketcindy/ketcindyjs/CindyJS.css index 2fdefb34c40..2fdefb34c40 100644 --- a/Master/texmf-dist/doc/support/ketcindy/CindyJS/CindyJS.css +++ b/Master/texmf-dist/doc/support/ketcindy/ketcindyjs/CindyJS.css diff --git a/Master/texmf-dist/doc/support/ketcindy/CindyJS/ketcindylib.txt b/Master/texmf-dist/doc/support/ketcindy/ketcindyjs/ketcindylib.txt index 72469da831a..72469da831a 100644 --- a/Master/texmf-dist/doc/support/ketcindy/CindyJS/ketcindylib.txt +++ b/Master/texmf-dist/doc/support/ketcindy/ketcindyjs/ketcindylib.txt diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figure.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figure.cdy Binary files differdeleted file mode 100644 index 23b2ec4aa50..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figure.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0102figure2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0102figure2.cdy Binary files differdeleted file mode 100644 index 7c5f4f7c67a..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0102figure2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0103polygon.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0103polygon.cdy Binary files differdeleted file mode 100644 index adb3f4523d1..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0103polygon.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0104shade.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0104shade.cdy Binary files differdeleted file mode 100644 index 13c7b8a4147..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0104shade.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0105vector.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0105vector.cdy Binary files differdeleted file mode 100644 index d928672b4ca..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0105vector.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowhatch.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowhatch.cdy Binary files differdeleted file mode 100644 index 459feeac48a..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowhatch.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0107hyperbolahatch.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0107hyperbolahatch.cdy Binary files differdeleted file mode 100644 index cd2cb8e44d3..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0107hyperbolahatch.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0108cycloid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0108cycloid.cdy Binary files differdeleted file mode 100644 index 6c5668e54b8..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0108cycloid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0109epitrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0109epitrochoid.cdy Binary files differdeleted file mode 100644 index 22995717144..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0109epitrochoid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0110hypotrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0110hypotrochoid.cdy Binary files differdeleted file mode 100644 index ce4cc21dda6..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0110hypotrochoid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0201basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0201basic.cdy Binary files differdeleted file mode 100644 index 375e477f0ff..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0201basic.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0202graph1.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0202graph1.cdy Binary files differdeleted file mode 100644 index fb5f231c90b..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0202graph1.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0203graph2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0203graph2.cdy Binary files differdeleted file mode 100644 index 577cd958a8c..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0203graph2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0204graph3.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0204graph3.cdy Binary files differdeleted file mode 100644 index 274c96637ac..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0204graph3.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0205coniccurve.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0205coniccurve.cdy Binary files differdeleted file mode 100644 index f07f094a49f..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0205coniccurve.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0206defexp.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0206defexp.cdy Binary files differdeleted file mode 100644 index 3aabbc4844e..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0206defexp.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0207envelope.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0207envelope.cdy Binary files differdeleted file mode 100644 index 4f3f48b0a93..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0207envelope.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0208intersecthatch.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0208intersecthatch.cdy Binary files differdeleted file mode 100644 index 866e0cacbfb..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0208intersecthatch.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0209diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0209diffeq.cdy Binary files differdeleted file mode 100644 index 5ef84953657..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0209diffeq.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0210diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0210diffeq2.cdy Binary files differdeleted file mode 100644 index df2280441e0..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0210diffeq2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0211plotdataS.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0211plotdataS.cdy Binary files differdeleted file mode 100644 index dba596a3136..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0211plotdataS.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0212implicit.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0212implicit.cdy Binary files differdeleted file mode 100644 index 3ad386c75b9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0212implicit.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0213implicithatch.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0213implicithatch.cdy Binary files differdeleted file mode 100644 index c118ca94b63..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0213implicithatch.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0301table.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0301table.cdy Binary files differdeleted file mode 100644 index edbd6159f57..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0301table.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2.cdy Binary files differdeleted file mode 100644 index fb5f02d6f84..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2line.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2line.cdy Binary files differdeleted file mode 100644 index 87cfe10f8c0..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2line.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0303papersquared.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0303papersquared.cdy Binary files differdeleted file mode 100644 index 1a127585329..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0303papersquared.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0304graphforincanddec.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0304graphforincanddec.cdy Binary files differdeleted file mode 100644 index f46a2a29657..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0304graphforincanddec.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0305incanddec.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0305incanddec.cdy Binary files differdeleted file mode 100644 index bc9c08cb2c2..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0305incanddec.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0402bezier2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0402bezier2.cdy Binary files differdeleted file mode 100644 index 0a637398428..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0402bezier2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0405dogwalk.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0405dogwalk.cdy Binary files differdeleted file mode 100644 index 06bb52f8058..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0405dogwalk.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501basic.cdy Binary files differdeleted file mode 100644 index 3850f7e07ce..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501basic.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0502spacecurve.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0502spacecurve.cdy Binary files differdeleted file mode 100644 index 57cf43131fa..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0502spacecurve.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0507polyhedron.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0507polyhedron.cdy Binary files differdeleted file mode 100644 index beee239a562..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0507polyhedron.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0601cycloid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0601cycloid.cdy Binary files differdeleted file mode 100644 index 13ee3cd04f2..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0601cycloid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0602diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0602diffeq.cdy Binary files differdeleted file mode 100644 index 0bb3cb64ba7..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0602diffeq.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0603envelope.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0603envelope.cdy Binary files differdeleted file mode 100644 index e762e8dbf9d..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0603envelope.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0604diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0604diffeq2.cdy Binary files differdeleted file mode 100644 index 643743520f5..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0604diffeq2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0605cycloid2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0605cycloid2.cdy Binary files differdeleted file mode 100644 index 9e1d541c019..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0605cycloid2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0606epitrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0606epitrochoid.cdy Binary files differdeleted file mode 100644 index df32beb363a..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0606epitrochoid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0607hypotrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0607hypotrochoid.cdy Binary files differdeleted file mode 100644 index b49ee406be6..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0607hypotrochoid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/slide0.tex b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/slide0.tex deleted file mode 100644 index 3ff4376514f..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/slide0.tex +++ /dev/null @@ -1,11 +0,0 @@ -{\Large\bf -\color[cmyk]{1,1,0,0} - -\begin{layer}{120}{0} -{\Huge \putnotes{60}{20}{メインタイトル}} -\putnotes{60}{50}{名前} -\putnotes{60}{60}{所属} -\putnotes{60}{70}{情報} -\end{layer} - -} diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.cdy Binary files differdeleted file mode 100644 index 886b5bc01ce..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.cdy Binary files differdeleted file mode 100644 index 0025ed37400..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graph.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graph.cdy Binary files differdeleted file mode 100644 index 6ce49ec73b7..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graph.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.cdy Binary files differdeleted file mode 100644 index 4b59de6c9ad..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.txt b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.txt deleted file mode 100644 index 295050c5615..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.txt +++ /dev/null @@ -1,19 +0,0 @@ -title::slideE::%wallpaper//
-
-%%%%%%%%%%%%%%%%//
-main::Main Slide//
-
-%%%%%%%%%%%%%%%%//
-new::input and layer//
-
-layer::{100}{0}//
-putnote::s{65}{10}::figsin,1.2//
-end//
-
-%%%%%%%%%%%%%%%%//
-new::includegrpahics and layer//
-
-layer::{100}{0}//
-putnote::s{60}{5}
-::include[bb=0.00 0.00 803.00 285.00,width=100mm]::cindyscreen.pdf//
-end//
diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.cdy Binary files differdeleted file mode 100644 index fa5099527fc..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.cdy Binary files differdeleted file mode 100644 index 1da10768bd9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.cdy Binary files differdeleted file mode 100644 index 012e8971df5..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705para.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705para.cdy Binary files differdeleted file mode 100644 index ffc2f5de4f9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705para.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.cdy Binary files differdeleted file mode 100644 index 2b898539f33..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.cdy Binary files differdeleted file mode 100644 index d87de868f3d..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.cdy Binary files differdeleted file mode 100644 index 5cb1238a727..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0801plotR.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0801plotR.cdy Binary files differdeleted file mode 100644 index b0040070ed3..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0801plotR.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0802plotR2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0802plotR2.cdy Binary files differdeleted file mode 100644 index 54148975b4f..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0802plotR2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0803boxplot.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0803boxplot.cdy Binary files differdeleted file mode 100644 index cc97d6e8163..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0803boxplot.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0804histplot.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0804histplot.cdy Binary files differdeleted file mode 100644 index 06eb56d79b9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0804histplot.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0805random.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0805random.cdy Binary files differdeleted file mode 100644 index b6b701349ac..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0805random.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0806dataframe.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0806dataframe.cdy Binary files differdeleted file mode 100644 index 70cc8213f1e..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0806dataframe.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0807timecount.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0807timecount.cdy Binary files differdeleted file mode 100644 index 88f2cc3bcf1..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0807timecount.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0808ttest.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0808ttest.cdy Binary files differdeleted file mode 100644 index c6260d136fe..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0808ttest.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0901paraboloid.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0901paraboloid.cdy Binary files differdeleted file mode 100644 index 88fdaf1cb37..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0901paraboloid.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0902cone.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0902cone.cdy Binary files differdeleted file mode 100644 index 17f96400435..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0902cone.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0904mant.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0904mant.cdy Binary files differdeleted file mode 100644 index e209bfa5068..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0904mant.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0905sphere.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0905sphere.cdy Binary files differdeleted file mode 100644 index 3f4d4ca4cc2..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0905sphere.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0907intersectcrvsf.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0907intersectcrvsf.cdy Binary files differdeleted file mode 100644 index 40b54a57ba3..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0907intersectcrvsf.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0909wiredata.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0909wiredata.cdy Binary files differdeleted file mode 100644 index f412eadc965..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0909wiredata.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0910conecut.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0910conecut.cdy Binary files differdeleted file mode 100644 index 275819e94eb..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0910conecut.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1000list.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1000list.cdy Binary files differdeleted file mode 100644 index be193e2c2c9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1000list.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1001basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1001basic.cdy Binary files differdeleted file mode 100644 index c0b659d5521..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1001basic.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1002equation.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1002equation.cdy Binary files differdeleted file mode 100644 index a332c2a4ab5..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1002equation.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1003trig.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1003trig.cdy Binary files differdeleted file mode 100644 index 5c2e8f1d9e4..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1003trig.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1004calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1004calcby.cdy Binary files differdeleted file mode 100644 index f5bb31c8a82..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1004calcby.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1005diffint.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1005diffint.cdy Binary files differdeleted file mode 100644 index 4b581c9a83e..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1005diffint.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1006calculus.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1006calculus.cdy Binary files differdeleted file mode 100644 index 956678bee05..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1006calculus.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1007linalg.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1007linalg.cdy Binary files differdeleted file mode 100644 index 44bcaa1d765..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1007linalg.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1008idtable.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1008idtable.cdy Binary files differdeleted file mode 100644 index 8aeb42708d5..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1008idtable.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1009diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1009diffeq.cdy Binary files differdeleted file mode 100644 index 691ff457506..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1009diffeq.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier.cdy Binary files differdeleted file mode 100644 index e8cabe3e63b..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier2.cdy Binary files differdeleted file mode 100644 index 3967749af0e..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier3.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier3.cdy Binary files differdeleted file mode 100644 index f096d6ed716..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier3.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop.cdy Binary files differdeleted file mode 100644 index 622b7e58f7a..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop2.cdy Binary files differdeleted file mode 100644 index ceee9ea0f42..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1012fourierpw.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1012fourierpw.cdy Binary files differdeleted file mode 100644 index f6e4420a127..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1012fourierpw.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1013for.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1013for.cdy Binary files differdeleted file mode 100644 index 99d01ad91b6..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1013for.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1014incdec2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1014incdec2.cdy Binary files differdeleted file mode 100644 index 1a48ee9bae1..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1014incdec2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1015primenumber.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1015primenumber.cdy Binary files differdeleted file mode 100644 index 564749b1c94..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1015primenumber.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1100list.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1100list.cdy Binary files differdeleted file mode 100644 index 575037fbdcc..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1100list.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1101calculator1.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1101calculator1.cdy Binary files differdeleted file mode 100644 index 6d5ab14b9e1..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1101calculator1.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1102calculator2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1102calculator2.cdy Binary files differdeleted file mode 100644 index 996a293500c..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1102calculator2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1103calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1103calcby.cdy Binary files differdeleted file mode 100644 index 66e58f97d04..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1103calcby.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1104diff.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1104diff.cdy Binary files differdeleted file mode 100644 index 43727b1f8a5..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1104diff.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fint101.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fint101.cdy Binary files differdeleted file mode 100644 index ed7d7dfa0db..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fint101.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fzero109.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fzero109.cdy Binary files differdeleted file mode 100644 index 475b00188ab..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fzero109.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1106fmmx110.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1106fmmx110.cdy Binary files differdeleted file mode 100644 index c360a5cc7a2..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1106fmmx110.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1110integrate.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1110integrate.cdy Binary files differdeleted file mode 100644 index 8151daf2677..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1110integrate.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1111grobner1.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1111grobner1.cdy Binary files differdeleted file mode 100644 index 9ac5a504cde..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1111grobner1.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1112residue.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1112residue.cdy Binary files differdeleted file mode 100644 index b8db8601b6b..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1112residue.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate.cdy Binary files differdeleted file mode 100644 index 42fb8d3faf9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate2.cdy Binary files differdeleted file mode 100644 index 13b0cdb330e..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202calcby.cdy Binary files differdeleted file mode 100644 index d79f82f56b9..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202calcby.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202equations.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202equations.cdy Binary files differdeleted file mode 100644 index bbc19ef9968..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202equations.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1301basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1301basic.cdy Binary files differdeleted file mode 100644 index 2489208ecaf..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1301basic.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1303objparts.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1303objparts.cdy Binary files differdeleted file mode 100644 index 2675c4d996d..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1303objparts.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1304symbol.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1304symbol.cdy Binary files differdeleted file mode 100644 index 8f5d0012254..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1304symbol.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1305hyperpara.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1305hyperpara.cdy Binary files differdeleted file mode 100644 index 2768c455e6c..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1305hyperpara.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1308discont.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1308discont.cdy Binary files differdeleted file mode 100644 index 01f65394d21..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1308discont.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1309discont2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1309discont2.cdy Binary files differdeleted file mode 100644 index 160b1fbad56..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1309discont2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1401csvprocessing.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1401csvprocessing.cdy Binary files differdeleted file mode 100644 index 8339f560622..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1401csvprocessing.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1402copypaste.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1402copypaste.cdy Binary files differdeleted file mode 100644 index acdc2d25ee2..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1402copypaste.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1501mant.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1501mant.cdy Binary files differdeleted file mode 100644 index 59bfc5cfa8c..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1501mant.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1502torus.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1502torus.cdy Binary files differdeleted file mode 100644 index ec9a5966348..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1502torus.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1503parabola.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1503parabola.cdy Binary files differdeleted file mode 100644 index 5b45f933ab1..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1503parabola.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdy Binary files differdeleted file mode 100644 index ac2ecd2d8df..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdy Binary files differdeleted file mode 100644 index 1bbe45a7d2e..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdy Binary files differdeleted file mode 100644 index 1305329e437..00000000000 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdy +++ /dev/null diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdy Binary files differnew file mode 100644 index 00000000000..1eeb8c32a42 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figurepdf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figurepdf.cdy Binary files differindex 0ce178ecd78..310ab7ae491 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figurepdf.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figurepdf.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdy Binary files differnew file mode 100644 index 00000000000..f1fd981e571 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdy Binary files differnew file mode 100644 index 00000000000..e52af2ec813 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdy Binary files differnew file mode 100644 index 00000000000..07dd75aedb2 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdy Binary files differnew file mode 100644 index 00000000000..10fd5a3f042 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowdotfill.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowdotfill.cdy Binary files differindex 1723fe89ba9..c52a28a5365 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowdotfill.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowdotfill.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdy Binary files differnew file mode 100644 index 00000000000..0f6688dd002 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdy Binary files differnew file mode 100644 index 00000000000..1c24d989416 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdy Binary files differnew file mode 100644 index 00000000000..477b251149c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdy Binary files differnew file mode 100644 index 00000000000..184cfff875c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdy Binary files differnew file mode 100644 index 00000000000..d216acdf030 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdy Binary files differnew file mode 100644 index 00000000000..c96e2286b76 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdy Binary files differnew file mode 100644 index 00000000000..8884df23cba --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdy Binary files differnew file mode 100644 index 00000000000..1720d6c0ef8 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdy Binary files differnew file mode 100644 index 00000000000..4af50fdad7c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdy Binary files differnew file mode 100644 index 00000000000..89fe447023c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdy Binary files differnew file mode 100644 index 00000000000..4850eea641c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdy Binary files differnew file mode 100644 index 00000000000..a99645a07f6 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdy Binary files differnew file mode 100644 index 00000000000..b3b397fcef5 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdy Binary files differnew file mode 100644 index 00000000000..d2c75f24b96 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdy Binary files differnew file mode 100644 index 00000000000..773bb202869 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdy Binary files differnew file mode 100644 index 00000000000..0eb5f4ac32c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdy Binary files differnew file mode 100644 index 00000000000..b93c78c22a0 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdy Binary files differnew file mode 100644 index 00000000000..7805e90cb57 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdy Binary files differnew file mode 100644 index 00000000000..1725d889493 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdy Binary files differnew file mode 100644 index 00000000000..5afc3327679 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdy Binary files differnew file mode 100644 index 00000000000..d2dee489192 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdy Binary files differnew file mode 100644 index 00000000000..78fae48b3b4 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdy Binary files differnew file mode 100644 index 00000000000..25e66b6c357 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdy Binary files differnew file mode 100644 index 00000000000..94b517bf64d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/dogwalk.png b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/dogwalk.png Binary files differindex 4cb91fa046b..4cb91fa046b 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/dogwalk.png +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/dogwalk.png diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/heart.png b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/heart.png Binary files differindex 1aa2d7fde13..1aa2d7fde13 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/heart.png +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/heart.png diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/mtfuji.png b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/mtfuji.png Binary files differindex 4a060da9e10..4a060da9e10 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/mtfuji.png +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/mtfuji.png diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0401bezierbasic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0401bezierbasic.cdy Binary files differindex 9b74b35e4eb..375099bfc0a 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0401bezierbasic.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0401bezierbasic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdy Binary files differnew file mode 100644 index 00000000000..80bcb1721fa --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0403bezierspline.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0403bezierspline.cdy Binary files differindex 4a295326b3a..8050f7d7920 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0403bezierspline.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0403bezierspline.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0404heart.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0404heart.cdy Binary files differindex cde6c433f84..0cc03098b70 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0404heart.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0404heart.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdy Binary files differnew file mode 100644 index 00000000000..0d6808ce912 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0406mtfuji.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0406mtfuji.cdy Binary files differindex 2b20596a00b..a39cdbe97e5 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0406mtfuji.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0406mtfuji.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdy Binary files differnew file mode 100644 index 00000000000..7d8f7a740ce --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501plane.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501plane.cdy Binary files differindex d930b0e3ae3..6e8f0c03c73 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501plane.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501plane.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdy Binary files differnew file mode 100644 index 00000000000..b40c881ace0 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0503perp.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0503perp.cdy Binary files differindex 7be0735c1af..46450431174 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0503perp.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0503perp.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0504embed.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0504embed.cdy Binary files differindex 20a97e8e5a2..e818c2e9250 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0504embed.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0504embed.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0505bezier3d.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0505bezier3d.cdy Binary files differindex ae22c81098c..02bb4397ae7 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0505bezier3d.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0505bezier3d.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0506embedhatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0506embedhatch.cdy Binary files differindex ef336e0ab26..bb8f9b305b7 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0506embedhatch.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0506embedhatch.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdy Binary files differnew file mode 100644 index 00000000000..38fd68d95a9 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0508concatobj.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0508concatobj.cdy Binary files differindex 66164a2de14..4ab993db1ff 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0508concatobj.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0508concatobj.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05092cubiccut.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0509cubiccut.cdy Binary files differindex 0f9663eeb9b..67ae430ceff 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05092cubiccut.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0509cubiccut.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05093cubiccut2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0510cubiccut2.cdy Binary files differindex d2cb0ed5d7e..c197d139e62 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05093cubiccut2.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0510cubiccut2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05091tetra.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0511tetra.cdy Binary files differindex a97222480ca..d4b13e14777 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05091tetra.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0511tetra.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0921totaldiffskeleton.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0521totaldiffskeleton.cdy Binary files differindex f45a3fbc6c7..0215d3e52e0 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0921totaldiffskeleton.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0521totaldiffskeleton.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0922conecutmaxima.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0522conecutmaxima.cdy Binary files differindex 431401797e8..086025ed1b7 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0922conecutmaxima.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0522conecutmaxima.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdy Binary files differnew file mode 100644 index 00000000000..37bc71a29a2 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdy Binary files differnew file mode 100644 index 00000000000..bd8bb17841a --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdy Binary files differnew file mode 100644 index 00000000000..d5c8689b5af --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdy Binary files differnew file mode 100644 index 00000000000..30f5dacf0a1 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdy Binary files differnew file mode 100644 index 00000000000..98b9baaf391 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdy Binary files differnew file mode 100644 index 00000000000..2e819ba6f62 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdy Binary files differnew file mode 100644 index 00000000000..839f079d58d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/wallpaper.tex b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/figwall/wallpaper.tex index 5c08113b42c..5c08113b42c 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/wallpaper.tex +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/figwall/wallpaper.tex diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/howtouseslideE.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/howtouseslideE.txt index b7fc171bbc5..b7fc171bbc5 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/howtouseslideE.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/howtouseslideE.txt diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/howtouseslideJ.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/howtouseslideJ.txt index 440fefea4f1..da7ac114f65 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/howtouseslideJ.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/howtouseslideJ.txt @@ -1,4 +1,4 @@ -ketslideによるプレゼンテーション 2018.03.30
+ketslideによるプレゼンテーション 2018.05.31
0.作成の流れ
@@ -36,12 +36,13 @@ ketslideによるプレゼンテーション 2018.03.30 注)タイトル画面が不要の場合は,
タイトル(またはtitle)::notitle//
・main::段落タイトル名//
+ 注)ページ番号を表示するときは,直後に\slidepage[1]//を入れる.
・new(::行下げ)::タイトル((::位置)::読み込みファイル)//
- mainslide
例)new::[10]::最初に::{50}{20}::figure//
注)読み込みファイルのサイズ変更するとき
new::[10]::最初に::{50}{20}::figure,0.8//
他も同様
+ 注)ページ番号を表示するときは,repeat文(5)の後に\slidepage//を入れる.
・enumerate/
enumerate環境の始まり
・itemize//
@@ -88,6 +89,11 @@ ketslideによるプレゼンテーション 2018.03.30 注)%repeat=,para=...と続けて書いてもよい.
注)一時的に無効にするときは,%%とする.
+ 7)page番号を表示するとき
+ mainの場合 \slidepage[m]//
+ slideの場合 %repeatの後に \slidepage//
+ 注)総ページ数を取得するため,TeXを2度通すことが必要である.
+
2.スライドの設定
1)cdyのfigureに記述する.
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.cdy Binary files differnew file mode 100644 index 00000000000..73149dccb3e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.txt index 9650b53ce76..893fde032d4 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.txt @@ -2,9 +2,11 @@ %%%%%%%%%%%%%%%%//
main::メインスライド1//
+\slidepage[m]//
%%%%%%%%%%%%%%%%//
new::itemize環境の使い方//
+\slidepage//
itemize//
item::内容//
@@ -13,6 +15,7 @@ end// %%%%%%%%%%%%%%%%//
new::enumerate環境の使い方//
+\slidepage//
enumerate::[(1)]//
item::番号を変えるには,例えば [(1)]//
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.cdy Binary files differnew file mode 100644 index 00000000000..019c8ca16f1 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.txt index a6c607e7f83..3884dfece1f 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.txt @@ -2,9 +2,11 @@ title::slide0::%wallpaper// %%%%%%%%%%%%%%%%//
main::Main Slide//
+\slidepage[m]//
%%%%%%%%%%%%%%%%//
new::How to use itemize//
+\slidepage//
itemize//
item::Contents//
@@ -13,6 +15,7 @@ end// %%%%%%%%%%%%%%%%//
new::How to use enumerate//
+\slidepage//
enumerate::[(1)]//
item::Change the style of number adding, for example, [(1)]//
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.cdy Binary files differnew file mode 100644 index 00000000000..364cf572519 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.txt new file mode 100644 index 00000000000..7f297ed05a4 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.txt @@ -0,0 +1,28 @@ +%タイトル::slide0::kabegami// +タイトル::slide0// + +%%%%%%%%%%%%%%%%// +main::メインスライド1// +\slidepage[m]// + +%%%%%%%%%%%%%%%%// +new::$\bm{\sin x}$のグラフとlayer// +%repeat=2// +\slidepage// + +%まず,sinecurveの図を作っておく(1)// + +layer::{100}{0}// +%[1]::putnote::se{10}{15}::sinecurve,0.8// +%[2]::putnote::se{60}{25}::sinecurve,0.8// +end// + +%%%%%%%%%%%%%%%%// +new::includegrpahicsとlayer// +\slidepage// + +%まず,diffeq.pdfを作っておく(2)// + +layer::{100}{0}// +putnote::s{60}{15}::include[bb=0.00 0.00 283.46 113.39,width=100mm]::diffeq.pdf// +end// diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.cdy Binary files differnew file mode 100644 index 00000000000..745c4087062 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.txt new file mode 100644 index 00000000000..316b6ae337e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.txt @@ -0,0 +1,23 @@ +title::slideE::%wallpaper//
+
+%%%%%%%%%%%%%%%%//
+main::Main Slide//
+\slidepage[m]//
+
+%%%%%%%%%%%%%%%%//
+new::input and layer//
+%repeat=2//
+\slidepage//
+
+layer::{100}{0}//
+%[1]::putnote::se{10}{15}::sinecurve,0.8//
+%[2]::putnote::se{60}{25}::sinecurve,0.8//
+end//
+
+%%%%%%%%%%%%%%%%//
+new::includegrpahics and layer//
+\slidepage//
+
+layer::{100}{0}//
+putnote::s{60}{15}::include[bb=0.00 0.00 283.46 113.39,width=100mm]::diffeq.pdf//
+end//
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.cdy Binary files differnew file mode 100644 index 00000000000..cac282b325c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.txt index 3f29c04c3ef..8c65a8a9cbd 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.txt @@ -2,10 +2,12 @@ %%%%%%%%%%%%%%%%//
main::メインスライド1//
+\slidepage[m]//
%%%%%%%%%%%%%%%%//
new::itemize環境の使い方//
-%repeat=2//
+%repeat=2,para//
+\slidepage//
itemize//
item::内容//
@@ -14,7 +16,8 @@ end// %%%%%%%%%%%%%%%%//
new::enumerate環境の使い方//
-%repeat=3//
+%repeat=3,para//
+\slidepage//
enumerate::[(1)]//
%thin[2,-]::item::番号を変えるには,例えば [(1)]//
@@ -23,10 +26,11 @@ end// %%%%%%%%%%%%%%%%//
new::グラフとrepeat//
-%repeat=2//
+%repeat=2,para//
+\slidepage//
layer::{100}{0}//
-%[1]::putnote::se{10}{15}::figsin,0.8//
-%[2]::putnote::se{30}{40}::figsin,0.8//
+%[1]::putnote::se{10}{15}::sinecurve,0.8//
+%[2]::putnote::se{30}{40}::sinecurve,0.8//
end//
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.cdy Binary files differnew file mode 100644 index 00000000000..7762575fc79 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.txt index 6ae811a162e..90bd08f3561 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.txt @@ -2,10 +2,12 @@ title::slideE::%wallpaper// %%%%%%%%%%%%%%%%//
main::Main Slide//
+\slidepage[m]//
%%%%%%%%%%%%%%%%//
new::itemize and repeat//
-%repeat=2//
+%repeat=2,para//
+\slidepage//
itemize//
item::Contents//
@@ -14,7 +16,8 @@ end// %%%%%%%%%%%%%%%%//
new::enumerate and repeat//
-%repeat=3//
+%repeat=3,para//
+\slidepage//
enumerate::[(1)]//
%thin[2,-]::item::Contents//
@@ -23,10 +26,10 @@ end// %%%%%%%%%%%%%%%%//
new::Graph and repeat//
-%repeat=2//
+%repeat=2,para//
+\slidepage//
layer::{100}{0}//
-%[1]::putnote::se{10}{15}::figsin,0.8//
-%[2]::putnote::se{30}{40}::figsin,0.8//
-end//
-
+%[1]::putnote::se{10}{15}::sinecurve,0.8//
+%[2]::putnote::se{30}{40}::sinecurve,0.8//
+end//
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.cdy Binary files differnew file mode 100644 index 00000000000..5ac9feddda0 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.txt index 7c97865ebab..6adc1874f8c 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.txt @@ -2,9 +2,11 @@ %%%%%%%%%%%%%%%%//
main::メインスライド1//
+\slidepage[m]//
%%%%%%%%%%%%%%%%//
new::画面上のボタン//
+\slidepage//
itemize//
item::\Ltab{20mm}{Figure}静止画(Fhead+".tex")をfigに作成//
@@ -17,7 +19,8 @@ end// %%%%%%%%%%%%%%%%//
new::enumerate環境の使い方//
-%repeat=3//
+%repeat=3,para//
+\slidepage//
%[2,-]::enumerate::[(1)]//
%[2,-]::item::番号を変えるには,例えば [(1)]//
@@ -27,7 +30,8 @@ new::enumerate環境の使い方// %%%%%%%%%%%%%%%%//
new::薄文字の使い方//
-%repeat=4//
+%repeat=4,para//
+\slidepage//
itemize//
%thin[2,-]::item::Setslidebodyの3番目の引数で濃さを変更\\//
@@ -38,7 +42,8 @@ end// %%%%%%%%%%%%%%%%//
new::layerの使い方//
-%repeat=5//
+%repeat=5,para//
+\slidepage//
\setthin{0}//
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.cdy Binary files differnew file mode 100644 index 00000000000..623ff70d46a --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.txt new file mode 100644 index 00000000000..0ecb2e6abc9 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.txt @@ -0,0 +1,10 @@ +%%タイトル::slide0::kabegami//
+タイトル::slide0//
+
+%%%%%%%%%%%%%%%%//
+new::parapara//
+%repeat=,para=sinemove:{0}:s{65}{10}:input:1.2//
+
+%%%%%%%%%%%%%%%%//
+%new::parapara2//
+%%repeat=,para=sinemove2:{0}:s{65}{10}:input:1.2//
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.cdy Binary files differnew file mode 100644 index 00000000000..380c28c8f69 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.txt index b3ff212af74..b3ff212af74 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.txt diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.cdy Binary files differnew file mode 100644 index 00000000000..0e7f029d1dd --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.txt index 3793cad5698..3793cad5698 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.txt diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.cdy Binary files differnew file mode 100644 index 00000000000..483cea9135a --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.txt b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.txt index c0c985642e6..c0c985642e6 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.txt +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.txt diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0801plotR.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0801plotR.cdy Binary files differnew file mode 100644 index 00000000000..77a23481240 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0801plotR.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdy Binary files differnew file mode 100644 index 00000000000..b708a8e3e7c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdy Binary files differnew file mode 100644 index 00000000000..1ca5da50591 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdy Binary files differnew file mode 100644 index 00000000000..251e815522d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdy Binary files differnew file mode 100644 index 00000000000..c4ce13e642f --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdy Binary files differnew file mode 100644 index 00000000000..3ff7e341d7d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdy Binary files differnew file mode 100644 index 00000000000..f34ea605bf6 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdy Binary files differnew file mode 100644 index 00000000000..39ce85fd6c1 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1501mant.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1501mant.cdy Binary files differnew file mode 100644 index 00000000000..d98388705ee --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1501mant.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1502torus.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1502torus.cdy Binary files differnew file mode 100644 index 00000000000..7b1719cea76 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1502torus.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1503parabola.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1503parabola.cdy Binary files differnew file mode 100644 index 00000000000..e7bf918b186 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1503parabola.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1504conecut.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1504conecut.cdy Binary files differindex 43fe8655eda..28e136575a7 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1504conecut.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1504conecut.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1505skeleton.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1505skeleton.cdy Binary files differindex 0497a177100..f416f09842e 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1505skeleton.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1505skeleton.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdy Binary files differnew file mode 100644 index 00000000000..c0a627326c3 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdy Binary files differnew file mode 100644 index 00000000000..ccb6114845d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdy Binary files differnew file mode 100644 index 00000000000..13cd1dd4ffb --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdy Binary files differnew file mode 100644 index 00000000000..477db07018b --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdy Binary files differnew file mode 100644 index 00000000000..bc5fe0d9806 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdy Binary files differnew file mode 100644 index 00000000000..5a0dc0cddcf --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdy Binary files differnew file mode 100644 index 00000000000..809581a524f --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdy Binary files differnew file mode 100644 index 00000000000..ef9c9410409 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdy Binary files differnew file mode 100644 index 00000000000..6c1ae540720 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdy Binary files differnew file mode 100644 index 00000000000..aef27dd2167 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdy Binary files differnew file mode 100644 index 00000000000..9f26f43a268 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdy Binary files differnew file mode 100644 index 00000000000..4aa04fe367e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdy Binary files differnew file mode 100644 index 00000000000..cc7ab2d2a3c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdy Binary files differnew file mode 100644 index 00000000000..0d47da0281e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdy Binary files differnew file mode 100644 index 00000000000..d1e60697e68 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdy Binary files differnew file mode 100644 index 00000000000..2ccbe7156e0 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdy Binary files differnew file mode 100644 index 00000000000..4b8e42e7b4e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdy Binary files differnew file mode 100644 index 00000000000..f1d38f17616 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdy Binary files differnew file mode 100644 index 00000000000..a8b08ff6ac4 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdy Binary files differnew file mode 100644 index 00000000000..bfb23dc436b --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdy Binary files differnew file mode 100644 index 00000000000..a01f3343bd9 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdy Binary files differnew file mode 100644 index 00000000000..27f893b8a6d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdy Binary files differnew file mode 100644 index 00000000000..1cb429f23c4 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdy Binary files differnew file mode 100644 index 00000000000..797aad90622 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdy Binary files differnew file mode 100644 index 00000000000..bcf2086dd1e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdy Binary files differnew file mode 100644 index 00000000000..e598705e9bc --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdy Binary files differnew file mode 100644 index 00000000000..4c746b03a39 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdy Binary files differnew file mode 100644 index 00000000000..0b4da7e4820 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdy Binary files differnew file mode 100644 index 00000000000..9f5fa021f90 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdy Binary files differnew file mode 100644 index 00000000000..c137e6f7632 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdy Binary files differnew file mode 100644 index 00000000000..541bcea8878 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdy Binary files differnew file mode 100644 index 00000000000..3cdf29aa625 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdy Binary files differnew file mode 100644 index 00000000000..be024649c31 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdy Binary files differnew file mode 100644 index 00000000000..776d3c0d46c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdy Binary files differnew file mode 100644 index 00000000000..96d661c1ed6 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdy Binary files differnew file mode 100644 index 00000000000..47f0b20cf59 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdy Binary files differnew file mode 100644 index 00000000000..fff2939ee33 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdy Binary files differnew file mode 100644 index 00000000000..c07f0ed0498 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdy Binary files differnew file mode 100644 index 00000000000..7d51533f519 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdy Binary files differnew file mode 100644 index 00000000000..6ceb10fe84f --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdy Binary files differnew file mode 100644 index 00000000000..f5def33c897 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdy Binary files differnew file mode 100644 index 00000000000..d8e397d839c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdy Binary files differnew file mode 100644 index 00000000000..1f177c97ee4 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdy Binary files differnew file mode 100644 index 00000000000..95516f75e18 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdy Binary files differnew file mode 100644 index 00000000000..d89a8f10fcc --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdy Binary files differnew file mode 100644 index 00000000000..94b57a047a7 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdy Binary files differnew file mode 100644 index 00000000000..18c0f84a57f --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdy Binary files differnew file mode 100644 index 00000000000..3bc01af4486 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdy Binary files differnew file mode 100644 index 00000000000..1f96b01b252 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdy Binary files differnew file mode 100644 index 00000000000..4b8d719a410 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdy Binary files differnew file mode 100644 index 00000000000..695c714ffab --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1306poly.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1306poly.cdy Binary files differindex e357ce0bcaa..7be5752753d 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1306poly.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1306poly.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1307poly2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1307poly2.cdy Binary files differindex 0f3f54b2b89..0df2bfe0786 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1307poly2.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1307poly2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdy Binary files differnew file mode 100644 index 00000000000..099e6e9d24a --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdy Binary files differnew file mode 100644 index 00000000000..1c2dd0b6cd8 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1310totaldiff.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1310totaldiff.cdy Binary files differindex 7a526d7eca7..01854f5acbe 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1310totaldiff.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1310totaldiff.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1311plate.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1311plate.cdy Binary files differindex 6afb901b4ac..7823e170fd1 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1311plate.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1311plate.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1312plane.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1312plane.cdy Binary files differindex 777d29723b0..430c0a738ed 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1312plane.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1312plane.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1313changescale.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1313changescale.cdy Binary files differindex 91721733724..ccafa6056bc 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1313changescale.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1313changescale.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdy Binary files differnew file mode 100644 index 00000000000..a5a6ccaa5ec --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdy Binary files differnew file mode 100644 index 00000000000..b8ff97f3e29 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1403maketableJ.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1403maketableJ.cdy Binary files differindex 88c81f69f70..85b80685337 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1403maketableJ.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1403maketableJ.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/sample1.csv b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/sample1.csv index 38d5fa8c714..38d5fa8c714 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/sample1.csv +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/sample1.csv diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/sample2.csv b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/sample2.csv index f6273be2c7d..f6273be2c7d 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/sample2.csv +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/sample2.csv diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1501paraboloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1501paraboloid.cdy Binary files differnew file mode 100644 index 00000000000..1f7718dd3c6 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1501paraboloid.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdy Binary files differnew file mode 100644 index 00000000000..3a4b6e8efec --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0903saddle.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1503saddle.cdy Binary files differindex 6279bf88cdd..edfe4f8a210 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0903saddle.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1503saddle.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdy Binary files differnew file mode 100644 index 00000000000..ac94f28f73c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdy Binary files differnew file mode 100644 index 00000000000..cc18ebdd421 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0906curveonsurf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1506curveonsurf.cdy Binary files differindex 16a413ca150..a70078cede3 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0906curveonsurf.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1506curveonsurf.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdy Binary files differnew file mode 100644 index 00000000000..cb86ef9210d --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0908multisurfaces.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1508multisurfaces.cdy Binary files differindex d078a6d825d..b4e7057690a 100644 --- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0908multisurfaces.cdy +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1508multisurfaces.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdy Binary files differnew file mode 100644 index 00000000000..33a66a806b5 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdy Binary files differnew file mode 100644 index 00000000000..2c4a4398813 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdy Binary files differnew file mode 100644 index 00000000000..5f706e9b863 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdy Binary files differnew file mode 100644 index 00000000000..7aced3612cc --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.html b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.html new file mode 100644 index 00000000000..fcea620c29e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.html @@ -0,0 +1,229 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + + <title>s1602diffeq2.cdy</title> + <style type="text/css"> + * { + margin: 0px; + padding: 0px; + } + + #CSConsole { + background-color: #FAFAFA; + border-top: 1px solid #333333; + bottom: 0px; + height: 200px; + overflow-y: scroll; + position: fixed; + width: 100%; + } + </style> + <link rel="stylesheet" href="https://cindyjs.org/dist/v0.8/CindyJS.css"> + <script type="text/javascript" src="https://cindyjs.org/dist/v0.8/Cindy.js"></script> + <script type="text/javascript" src="https://cindyjs.org/dist/v0.8/KetCindyPlugin.js"></script> +<script id="csinit" type="text/x-cindyscript"> +use("KetCindyPlugin"); +Dircdy=loaddirectory; +setdirectory(plugindirectory); +import("dirhead.txt"); +; +</script> +<script id="cskeytyped" type="text/x-cindyscript"> +if(key()=="?" % keydownlist()==[32], + if(!isreal(NumTyped),NumTyped=0); + if(NumTyped==0, + DispStr= + "Figure(1) Parent(2) Parapara(3) Movie(4) Surf(5)"; + ); + if(NumTyped==1, + DispStr= + "Shift+ Title(T) Para(P) Slide(S) Digest(D)"; + ); + if(NumTyped==2, + DispStr="Shift+ Meshlab(M)"; + ); + if(NumTyped==3, + DispStr= + "Ch : disp(0) chg(9) N(+,-) add(<) rmv(>)"; + ); + drawtext(mouse().xy,DispStr,size->24); + NumTyped=mod(NumTyped+1,4); +, + NumTyped=0; +); +if(key()=="1",//Mkfigure + Viewtex(); + kc(); +); +if(key()=="2",//Mkparent + Viewparent(); +); +if(key()=="3",//Flipbook(Parapara) + Flipbook(); +); +if(key()=="4",//Texmovie + Texmovie(); + kc(); +); +if(key()=="5",//Surface + Cheader(); + Cmain(); + kcC(); + if(ChNum>0, + Ch=[ChNum]; + , + Ch=[1]; + ); + ChNum=0; +); +if(key()=="T",//Title + Maketitle(); +); +if(key()=="P",//ParaF + Parafolder(); +); +if(key()=="S",//Slide + Mkslides(); +); +if(key()=="D",//Digest(Summary) + Mkslidesummary(); +); +if(key()=="M",//Meshlab + Mkviewobj(OCNAME,OBJCMD,OCOPTION); +); + +if(key()=="0", + Dispchoice(); +); +if(key()=="9", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=append(Ch,ChNum); + ChNum=Ch_(length(Ch)-1); + Ch=remove(Ch,[ChNum]); + Ch=sort(Ch); + ); + ); + Dispchoice(); +); +if(key()=="+", + ChNum=ChNum+1; + Dispchoice(); +); +if(key()=="-", + ChNum=ChNum-1; + Dispchoice(); +); +if(key()=="<", + if(length(select(Ch,#==ChNum))==0, + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ChNum=ChNum+1; + ); + Dispchoice(); +); +if(key()=="^", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=Ch_(1..(length(Ch)-1)); + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ); + ); + ChNum=ChNum+1; + Dispchoice(); +); +if(key()=="~", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=Ch_(1..(length(Ch)-1)); + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ); + ); + ChNum=max(ChNum-1,1); + Dispchoice(); +); +if(key()==">", + if(length(Ch)>0, + ChNum=Ch_(length(Ch)); + Ch=Remove(Ch,[ChNum]); + ); + Dispchoice(); +); +; +</script> +<script id="csdraw" type="text/x-cindyscript"> +Ketinit(); + +//Deqplot("1","y`=y","x",0,1); +Deqplot("2","y``=-L.x*y`-G.x*y","t=[0,XMAX]",0,[C.y,0],["Num=200"]); +//Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",0,A,["Num=200"]); + +Expr([M,"e","\displaystyle\frac{d^2 x}{dt^2}+"+L.x+"\frac{dx}{dt}+"+G.x+"x=0"]); + +Windispg(); + +//Help("De"); + +; +</script> + <script type="text/javascript"> +var cdy = CindyJS({ + scripts: "cs*", + defaultAppearance: { + dimDependent: 0.7, + fontFamily: "sans-serif", + lineSize: 1, + pointSize: 5.0, + textsize: 12.0 + }, + angleUnit: "°", + geometry: [ + {name: "SW", type: "Free", pos: [-2.5744680851063833, -4.0, 0.8525536333742482], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "NE", type: "Free", pos: [4.0, 2.4285714285714284, 0.44032989855593035], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "A", type: "Free", pos: [0.0, -4.0, -0.8], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "B", type: "Free", pos: [-0.02366863905325444, -4.0, 0.9484028584281579], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "a", type: "Segment", color: [0.0, 0.0, 1.0], args: ["A", "B"], labeled: true}, + {name: "C", type: "PointOnSegment", pos: [0.011092747971205843, -4.0, -1.619421523013707], color: [1.0, 0.0, 0.0], args: ["a"], labeled: true}, + {name: "E", type: "Free", pos: [0.0, -4.0, 0.6666666666666666], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "F", type: "Free", pos: [4.0, -2.1818181818181817, 0.36363636363636365], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "b", type: "Segment", color: [0.0, 0.0, 1.0], args: ["E", "F"], labeled: true}, + {name: "G", type: "PointOnSegment", pos: [3.5770716007636896, -4.0, 0.6666666666666666], color: [1.0, 0.0, 0.0], args: ["b"], labeled: true}, + {name: "H", type: "Free", pos: [0.0, -4.0, 0.5714285714285714], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "K", type: "Free", pos: [4.0, -2.5454545454545454, 0.36363636363636365], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "c", type: "Segment", color: [0.0, 0.0, 1.0], args: ["H", "K"], labeled: true}, + {name: "L", type: "PointOnSegment", pos: [0.5714285657142855, -4.0, 0.5714285714285713], color: [1.0, 0.0, 0.0], args: ["c"], labeled: true}, + {name: "M", type: "Free", pos: [-2.0, -4.0, -1.0], color: [1.0, 0.0, 0.0], size: 2.0}, + {name: "Text0", type: "Button", color: [0.0, 0.0, 0.0], fillcolor: [0.0, 1.0, 1.0], fillalpha: 0.27272728085517883, script: "Mkketcindyjs();", text: "KeTJS", textsize: 18.0, dock: {corner: "UL", offset: [143.0, -20.0]}}, + {name: "Text33", type: "Button", color: [0.0, 0.0, 0.0], fillcolor: [1.0, 0.29, 0.29], fillalpha: 0.27272728085517883, script: "Viewtex();\nkc();", text: "Figure", textsize: 18.0, dock: {corner: "UL", offset: [10.0, -20.0]}}, + {name: "Text134", type: "Button", color: [0.0, 0.0, 0.0], fillcolor: [1.0, 1.0, 0.0], fillalpha: 0.27272728085517883, script: "if(length(Shellparent)>0,\n Makeshell(),Makebat();\n);\nWritetoSci(2);\nkc();", text: "Parent", textsize: 18.0, dock: {corner: "UL", offset: [77.0, -20.0]}}, + {name: "Text05''", type: "Button", color: [0.0, 0.0, 0.0], fillcolor: [0.0, 1.0, 1.0], fillalpha: 0.27272728085517883, script: "Mkketcindyjs([\"Net=n\",\"TeX=n\"]);\n", text: "KeTJSoff", textsize: 18.0, dock: {corner: "UL", offset: [202.0, -20.0]}} + ], + ports: [{ + id: "CSCanvas", + width: 1024, + height: 545, + transform: [{visibleRect: [-9.745440419289913, 6.700770173058494, 15.809824598259054, -6.900420681008095]}], + axes: true, + grid: 1.0, + snap: true, + background: "rgb(168,176,192)" + }], + csconsole: false, + cinderella: {build: 1901, version: [2, 9, 1901]} +}); + </script> +</head> +<body> + <div id="CSCanvas"></div> +</body> +</html>
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindy.html b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindy.html new file mode 100644 index 00000000000..d60f372b9c9 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindy.html @@ -0,0 +1,6639 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + + <title>s1602diffeq2.cdy</title> + <style type="text/css"> + * { + margin: 0px; + padding: 0px; + } + + #CSConsole { + background-color: #FAFAFA; + border-top: 1px solid #333333; + bottom: 0px; + height: 200px; + overflow-y: scroll; + position: fixed; + width: 100%; + } + </style> + <link rel="stylesheet" href="file:////Applications/KeTTeX.app/texlive/texmf-dist/scripts/ketcindy/ketcindyjs/CindyJS.css"> + <script type="text/javascript" src="file:////Applications/KeTTeX.app/texlive/texmf-dist/scripts/ketcindy/ketcindyjs/Cindy.js"></script> + <script type="text/javascript" src="https://cindyjs.org/dist/v0.8/KetCindyPlugin.js"></script> +<script id="csdraw" type="text/x-cindyscript"> +Ketinit(); + +//Deqplot("1","y`=y","x",0,1); +Deqplot("2","y``=-L.x*y`-G.x*y","t=[0,XMAX]",0,[C.y,0],["Num=200"]); +//Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",0,A,["Num=200"]); + +Expr([M,"e","\displaystyle\frac{d^2 x}{dt^2}+"+L.x+"\frac{dx}{dt}+"+G.x+"x=0"]); + +Windispg(); + +//Help("De"); + +; +</script> +<script id="cskeytyped" type="text/x-cindyscript"> +if(key()=="?" % keydownlist()==[32], + if(!isreal(NumTyped),NumTyped=0); + if(NumTyped==0, + DispStr= + "Figure(1) Parent(2) Parapara(3) Movie(4) Surf(5)"; + ); + if(NumTyped==1, + DispStr= + "Shift+ Title(T) Para(P) Slide(S) Digest(D)"; + ); + if(NumTyped==2, + DispStr="Shift+ Meshlab(M)"; + ); + if(NumTyped==3, + DispStr= + "Ch : disp(0) chg(9) N(+,-) add(<) rmv(>)"; + ); + drawtext(mouse().xy,DispStr,size->24); + NumTyped=mod(NumTyped+1,4); +, + NumTyped=0; +); +if(key()=="1",//Mkfigure + Viewtex(); + kc(); +); +if(key()=="2",//Mkparent + Viewparent(); +); +if(key()=="3",//Flipbook(Parapara) + Flipbook(); +); +if(key()=="4",//Texmovie + Texmovie(); + kc(); +); +if(key()=="5",//Surface + Cheader(); + Cmain(); + kcC(); + if(ChNum>0, + Ch=[ChNum]; + , + Ch=[1]; + ); + ChNum=0; +); +if(key()=="T",//Title + Maketitle(); +); +if(key()=="P",//ParaF + Parafolder(); +); +if(key()=="S",//Slide + Mkslides(); +); +if(key()=="D",//Digest(Summary) + Mkslidesummary(); +); +if(key()=="M",//Meshlab + Mkviewobj(OCNAME,OBJCMD,OCOPTION); +); + +if(key()=="0", + Dispchoice(); +); +if(key()=="9", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=append(Ch,ChNum); + ChNum=Ch_(length(Ch)-1); + Ch=remove(Ch,[ChNum]); + Ch=sort(Ch); + ); + ); + Dispchoice(); +); +if(key()=="+", + ChNum=ChNum+1; + Dispchoice(); +); +if(key()=="-", + ChNum=ChNum-1; + Dispchoice(); +); +if(key()=="<", + if(length(select(Ch,#==ChNum))==0, + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ChNum=ChNum+1; + ); + Dispchoice(); +); +if(key()=="^", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=Ch_(1..(length(Ch)-1)); + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ); + ); + ChNum=ChNum+1; + Dispchoice(); +); +if(key()=="~", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=Ch_(1..(length(Ch)-1)); + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ); + ); + ChNum=max(ChNum-1,1); + Dispchoice(); +); +if(key()==">", + if(length(Ch)>0, + ChNum=Ch_(length(Ch)); + Ch=Remove(Ch,[ChNum]); + ); + Dispchoice(); +); +; +</script> +<script id="csinit" type="text/x-cindyscript"> +// 17.08.26 Slider +// 16.11.27 +Ketinit():=Ketinit(1); +Ketinit(sy):=Ketinit(sy,[-5,5],[-5,5]); +Ketinit(sy,rangex,rangey):=( + regional(pt,tmp,tmp1,tmp2); + PenThickInit=8; + ULEN="1cm"; + KETPICLAYER=20; + MilliIn=1/2.54*1000; + PenThick=round(MilliIn*0.02); + PenThickInit=PenThick; + TenSizeInit=0.02; + TenSize=TenSizeInit; + YaSize=1; YaAngle=18; YaPosition=1; + YaThick=1; YaStyle='tf'; + KETPICCOUNT=1; + KCOLOR=[0,0,0]; + GLIST=[]; + GCLIST=[]; +// GDATALIST=[]; + GOUTLIST=[]; + POUTLIST=[]; + VLIST=[]; + FUNLIST=[]; + LETTERlist=[]; + COM0thlist=[]; + COM1stlist=[]; + COM2ndlist=[]; + SCIWRLIST=[]; + SCIRELIST=[]; + ADDAXES="1"; + LFmark=unicode("000a"); + Dq=unicode("0022"); + WaitUnit=10; + CONTINUED=0; + OutComList=[]; + OutFileLIst=[]; // 15.10.22 + FigPdfList=[]; // 16.04.08 + ADDPACK=[]; // 16.05.16 + ErrFlag=0; + setdirectory(Dirwork); + if(isstring(Fhead), // 15.04.06 + Fnametex=Fhead+".tex"; + Fnamesci=Fhead+".sce"; + Fnamescibody=Fhead+"body.sce"; + Fnameout=Fhead+".txt"; + ); + if(!isstring(Mackc),// 16.06.07 + Mackc="sh"; + ); + ArrowlineNumber=1; // 15.01.05 + ArrowheadNumber=1; + BezierNumber=1; //15.01.03 + SCALEX=1; + SCALEY=sy; +// Setscaling(sy); + XMIN=rangex_1/SCALEX; + XMAX=rangex_2/SCALEX; + YMIN=rangey_1/SCALEY; + YMAX=rangey_2/SCALEY; + Setwindow("Msg=n"); // 16.05.31 +); + +DqDq(str):=unicode("0022")+str+unicode("0022"); + +Tab2list(dtstr):=Tab2list(dtstr,[]); +Tab2list(dtstr,options):=( +//help:Tab2list(datastr); +//help:Tab2list(options=[0]); + regional(dtall,dt,rep,out,crm,lfm,htm,first,tmp,tmp1,tmp2); + crm=unicode("000d"); + lfm=unicode("000a"); + htm=unicode("0009"); + rep=0; + if(length(options)>0,rep=options_1); + first=lfm; // 16.09.05from + if(indexof(dtstr,crm)>0, + first=crm; + if(indexof(dtstr,crm+lfm)>0, + first=first+lfm; + ); // 16.09.05upto + ); + tmp1=Indexall(dtstr,first); + tmp1=prepend(0,tmp1); + tmp1=append(tmp1,length(dtstr)); + dtall=[]; + forall(1..(length(tmp1)-1), + tmp=substring(dtstr,tmp1_#,tmp1_(#+1)-1); + if(length(tmp)>0, + dtall=append(dtall,tmp); + ); + ); + out=[]; + forall(dtall,dt, + tmp1=tokenize(dt,unicode("0009")); + tmp2=[]; + forall(tmp1, + if(isstring(#),tmp=parse(#),tmp=#); + if(!isreal(tmp), + if(length(#)>0,tmp=#,tmp=rep); + ); + tmp2=append(tmp2,tmp); + ); + out=append(out,tmp2); + ); + out; +); + +Columnlist(dt,list):=( // 16.09.04 +//help:Columnlist(dt,1..3); + apply(dt,#_list); +); + +Dispmat(dt):=( // 16.09.16 +//help:Dispmat(dt); + regional(htm,crm,lfm,row,tmp,tmp1,tmp2); + htm=unicode("0009"); + crm=unicode("000d"); + lfm=unicode("000a"); + tmp2=""; + forall(dt,row, + tmp1=""; + forall(row, + if(isstring(#), + tmp1=tmp1+#+htm; + , + tmp1=tmp1+text(#)+htm; + ); + ); + tmp1=substring(tmp1,0,length(tmp1)-1); + tmp1=tmp1+lfm; + tmp2=tmp2+tmp1; + ); + print(tmp2); + println(); +); + +norm(v1):=( // 16.09.01 +//help:norm([2,1,3]); + regional(out,tmp,tmp1,tmp2); + out=0; + forall(1..length(v1), + out=out+(v1_#)^2; + ); + out=sqrt(out); + out; +); +norm(v1,v2):=( + norm(v2-v1); +); + +// 16.03.28 +Removespace(str):=( +//help:Removespace(" a b c "); + regional(tmp,flg,out); + tmp=length(str)+1; + flg=0; + forall(1..length(str), + if(flg==0, + if((str_#)!=" ", + tmp=#; + flg=1; + ); + ); + ); + out=substring(str,tmp-1,length(str)); + flg=0; + tmp=0; + forall(reverse(1..length(out)), + if(flg==0, + if((out_#)!=" ", + tmp=#; + flg=1; + ); + ); + ); + out=substring(out,0,tmp); +); + +Indexall(str,key):=( + regional(rest,out,flg,tmp,tmp1,); + out=[]; + rest=str; + flg=0; + forall(1..length(str), + if(flg==0, + tmp=indexof(rest,key); + if(tmp>0, + tmp1=tmp+length(str)-length(rest); + out=append(out,tmp1); + rest=substring(rest,tmp,length(rest)); + , + flg=1; + ); + ); + ); + out; +); + +Changestyle(nameL,style):=( +//help:Changestyle(["sgAB"],["da"]); + regional(nmL,name,Ltype,Ltypeorg,Noflg,opcindy,tmp); + tmp=Divoptions(style); + Ltypeorg=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + if(islist(nameL),nmL=nameL,nmL=[nameL]); + forall(nmL,name, + Ltype=Ltypeorg; + GCLIST=select(GCLIST,#_1!=name); + COM2ndlist=select(COM2ndlist,indexof(#,"("+name)==0); // 15.05.23 + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); +); + +Op(n,object):=( // 16.05.25 +//help:Op(4,[1,2,3,4]); +//help:Op(3,"abcd"); + regional(out); + if(islist(object), + out=object_n; + , + if(isstring(object), + out=substring(object,n-1,n); + ); + ); + out; +); + +Toupper(str):=( + regional(alphabet,out,tmp,tmp1); + alphabet="abcdefghijklmnopqrstuvwxyz"; + out=""; + forall(1..length(str), + tmp=substring(str,#-1,#); + tmp1=indexof(alphabet,tmp); + if(tmp1>0, + out=out+unicode(text(tmp1+64),base->10); + , + out=out+tmp; + ); + ); + out; +); + +Textformat(value,dig):=( +//help:Textformat(2/3,4); +//help:Textformat([gr1,gr2],5); + regional(vv,tmp,tmp1); + if(islist(value), + tmp1="["; + forall(value, + tmp1=tmp1+Textformat(#,dig)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]"; + , + if(ispoint(value) % isstring(value), +// vv=Lcrd(value); +// tmp1=Textformat(vv,dig); +// tmp1=text(value); // 15.04.07 + if(isstring(value),tmp1=Dq+value+Dq,tmp1=text(value)); // 15.10.02 + , + tmp1=format(value,dig); + ); + ); + tmp1; +); + +Sprintf(value,dig):=( +//help:Sprintf(5.1,4); + regional(vv,tmp,tmp1); + if(!islist(value), + vv=Textformat(value,dig); + if(indexof(vv,".")==0,vv=vv+"."); + vv=vv+"0000000000000000"; + tmp=indexof(vv,".")+dig; + vv=substring(vv,0,tmp); + , + vv=apply(value,Sprintf(#,dig)); + ); + vv; +); + +Assign(funstr,vrL):=( + regional(nn,out,tmp,tmp1); + nn=length(vrL)/2; + out=funstr; + forall(1..nn, + out=Assign(out,vrL_(2*#-1),vrL_(2*#)); + ); + out; +); + +Assign(funstr,varname,rep):=( +//help:Assign("x^2+a*x","a",1.3); +//help:Assign("a*x^2+b*x",["a",1,"b",2]); + regional(repstr,ii,jj,tmp,tmp1,tmp2,Notvar,Flg); + if(isstring(rep),repstr=rep,repstr="("+Textformat(rep,5)+")"); // 15.02.09, 07.06 + tmp=[46]; // 12.20 + tmp=concat(tmp,48..57); + tmp=concat(tmp,65..90); + tmp=concat(tmp,97..122); + Notvar=apply(tmp,unicode(text(#),base->10)); + tmp2=""; + forall(1..100, + ii=indexof(funstr,varname); + if(ii>0, + Flg=0; + if(ii>1, + tmp=substring(funstr,ii-2,ii-1); + if(contains(Notvar,tmp), + tmp2=tmp2+substring(funstr,0,ii); + funstr=substring(funstr,ii,length(funstr)); + Flg=1; + ); + ); + if(Flg==0, + jj=ii-1+length(varname); + if(jj<length(funstr), + tmp=substring(funstr,jj,jj+1)); + if(contains(Notvar,tmp), + tmp2=tmp2+substring(funstr,0,jj); + funstr=substring(funstr,jj,length(funstr)); + Flg=1; + ); + ); + if(Flg==0, + tmp2=tmp2+substring(funstr,0,ii-1)+repstr; + funstr=substring(funstr,jj,length(funstr)); + ); + ); + ); + funstr=tmp2+funstr; + funstr; +); + +MeasureDepth(list):=( + regional(tmp,Depth,Flg); + Flg=0; + Depth=0; + if(ispoint(list), // 15.01.22 + Depth=0; + Flg=1; + , + tmp=list_1; + ); + repeat(4, + if(Flg==0, + if(islist(tmp), + tmp=tmp_1; + Depth=Depth+1; + , + if(ispoint(tmp),Depth=Depth+1); + Flg=1; + ); + ); + ); + Depth; +); + +Flattenlist(pltlist):=( +//help:Flattenlist([[2,3],[[1,2],[5,6]]]); + regional(Out,nn,Dt,ii,tmp,flg); + Out=[]; + if(MeasureDepth(pltlist)==1, + Out=[pltlist]; + , + forall(1..length(pltlist),nn, + Dt=pltlist_nn; + if(MeasureDepth(Dt)<2, + Out=append(Out,Dt); + , + forall(1..length(Dt),ii, + tmp=Flattenlist(Dt_ii); + Out=concat(Out,tmp); + ); + ); + ); + ); + Out; +); + +Divoptions(options):=( +//help:Divoptions(options); + regional(Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy,flg,tmp,tmp1); + Ltype="dr"; // 2015.01.13 + Noflg=0; + Inflg=0; + Outflg=0; + eqL=[]; + realL=[]; + strL=[]; + opstr=""; + opcindy=""; + forall(options, + flg=0; + if(flg==0, + if(isreal(#) % ispoint(#) % islist(#), + realL=append(realL,#); + opstr=opstr+","+text(#); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"=")>0, + eqL=append(eqL,#); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"no")+indexof(#,"No")>0, + if(indexof(#,"tex")>0,Noflg=1); + if(indexof(#,"disp")>0,Noflg=2); + if(indexof(#,"data")>0,Noflg=3); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"->")>0, + opcindy=opcindy+","+#; + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"out")+indexof(#,"Out")>0, + if(indexof(#,"-")==0, + Outflg=1; + , + Outflg=2; + ); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"in")+indexof(#,"In")>0, + if(indexof(#,"-")==0, + Inflg=1; + , + Inflg=2; + ); + flg=1; + ); + ); + if(flg==0, + tmp=substring(#,0,2); + tmp1=indexof(tmp,"dr")+indexof(tmp,"Dr"); + tmp1=tmp1+indexof(tmp,"da")+indexof(tmp,"Da"); + tmp1=tmp1+indexof(tmp,"id")+indexof(tmp,"Id"); + tmp1=tmp1+indexof(tmp,"do")+indexof(tmp,"Do"); + tmp1=tmp1+indexof(tmp,"dp")+indexof(tmp,"Dp"); + if(tmp1>0, + Ltype=#; + flg=1; + ); + if(flg==0, + strL=append(strL,#); + opstr=opstr+","+Dq+#+Dq; + ); + ); + ); + if(indexof(opcindy,"color->")==0,// 16.10.07from + opcindy=opcindy+",color->[0,0,0]"; + ); + [Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy]; +); + +Dotprod(vec1,vec2):=( +//help:Dotprod(vec1,vec2); + regional(v1,v2,tmp); + if(ispoint(vec1),v1=vec1.xy,v1=vec1); + if(ispoint(vec2),v2=vec2.xy,v2=vec2); + v1*v2; +); + +Crossprod(a,b):=( +//help:Crossprod(vec1,vec2); + regional(tmp1,tmp2,tmp3,Out); + if(length(a)==3, + tmp1=a_2*b_3-a_3*b_2; + tmp2=a_3*b_1-a_1*b_3; + tmp3=a_1*b_2-a_2*b_1; + Out=[tmp1,tmp2,tmp3]; + , + Out=a_1*b_2-a_2*b_1; + ); + Out; +); + +Ptstart(Fig):=( +//help:Ptstart("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); // 16.01.21 + tmp_1; +); + +Ptend(Fig):=( +//help:Ptend("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); + tmp_(length(tmp)); // 15.04.12 +); + +Numptcrv(Fig):=( +//help:Numptcrv("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); // 15.12.23 + length(tmp); +); + +Ptcrv(Num,Fig):=( +//help:Ptcrv(10,"gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); + tmp_Num; +); + +Invert(Fig):=( +//help:Invert("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); // 16.01.27 + reverse(tmp); +); +Invert(nm,Fig):=Invert(nm,Fig,["nodisp"]); // from 16.01.27 +Invert(nm,Fig,options):=( +//help:Invert("1","gr1"); + regional(name,tmp); + name="-inv"+nm; + tmp=Invert(Fig); + Listplot(name,tmp,options); +);// upto 16.01.27 + +Paramoncrv(pP,Gdata):=( + regional(Tmp,PtL); +// Eps=10^(-8); + if(isstring(Gdata),PtL=parse(Gdata),PtL=Gdata); + Tmp=Nearestpt(pP,PtL); + Tmp_2; +); + +ParamonCurve(pP,nN,plist):=( +//help:ParamonCurve(A,10,"gr1"); + regional(PtL,Out,Pa,Pb,vV,vW,sS); + if(isstring(plist),PtL=parse(plist),PtL=plist); + PtL=apply(PtL,LLcrd(#));//16.10.16 + if(nN==length(PtL), + Out=nN; + , + Pa=PtL_nN; + Pb=PtL_(nN+1); + vV=Pb-Pa; + vW=pP-Pa; + sS=vV*vW/|vV|^2; + sS=min([max([sS,0]),1]); + Out=nN+sS; + ); + Out; +); + +Pointoncrv(tT,PtL):=PointonCurve(tT,PtL); +PointonCurve(tT,Gdata):=( +//help:PointonCurve(20.5,"gr1"); + regional(Out,Eps,nN,sS,Pa,Pb,PtL); + if(isstring(Gdata),PtL=parse(Gdata),PtL=Gdata); + if(length(PtL)==1,PtL=PtL_1); + Eps=10^(-4); + nN=floor(tT+Eps); + sS=max([tT-nN,0]); + if(nN==length(PtL), + Out=PtL_nN; + , + Pa=PtL_nN; + Pb=PtL_(nN+1); + Out=(1-sS)*Pa+sS*Pb; + ); + Out; +); + +Koutenseg(pA,pB,pC,pD):=Koutenseg(pA,pB,pC,pD,[]); +Koutenseg(pA,pB,pC,pD,options):=( + regional(Eps0,Eps,Eps2,pV,Sv2,Out,pP,pQ,Flg,p1,p2,q1,q2, + em1,eM1,em2,eM2,rT,Tmp1,Tmp2); + Eps0=10^(-4); + pV=pB-pA; + Sv2=|pV|; + pP=pC-pA; pQ=pD-pA; + Eps=10^(-3); + Eps2=0.2; + Tmp1=0; + forall(options, + if(Tmp1==0, + Eps=#; + Tmp1=1; + , + Eps2=#; + ); + ); + Flg=0; + if(Sv2<10^(-3), + Out=["inf","inf"]; + Flg=1; + ); + if(Flg==0, + Eps=min([Eps2,Eps/Sv2]); + p1=pP*pV/Sv2^2; + p2=[pP_2,-pP_1]*pV/Sv2^2; + q1=pQ*pV/Sv2^2; + q2=[pQ_2,-pQ_1]*pV/Sv2^2; + em1=-Eps; eM1=1+Eps; + em2=-Eps; eM2=Eps; + if(max([p1,q1])<em1 % min([p1,q1])>eM1, + Out=["inf","inf"]; + Flg=1; + ); + if(max([p2,q2])<em2 % min([p2,q2])>eM2, + Out=["inf","inf"]; + Flg=1; + ); + ); + if(Flg==0 & p2*q2<0, + rT=p1-(q1-p1)/(q2-p2)*p2; + if(rT>em1 & rT<eM1, + if(rT>-Eps0 & rT<1+Eps0, + Tmp1=pA+rT*pV; + Tmp2=min([max([rT,0]),1]); + Out=[Tmp1,Tmp2,0]; + , + Tmp1=pA+rT*pV; + Tmp2=min([max([rT,0]),1]); + Out=[Tmp1,Tmp2,1]; + ); + Flg=1; + ); + if(Flg==0 & (p1<em1 % p1>eM1 % p2<em2 % p2>eM2), + if(q1<em1 % q1>eM1 % q2<em2 % q2>eM2, + Out=["inf","inf"]; + Flg=1; + ); + if(Flg==0, + rT=min([max([p1,0]),1]); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + Flg=1; + ); + ); + ); + if(Flg==0 & (p1 > -Eps0 & p1 < 1 + Eps0 & p2 > -Eps0 & p2 < Eps0), + rT= p1; + Tmp1=pA+rT*pV; + Out= [Tmp1, rT, 0]; + Flg=1; + ); + if(Flg==0 & (q1 > -Eps0 & q1 < 1 + Eps0 & q2 > -Eps0 & q2 < Eps0), + rT= q1; + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,0]; + Flg=1; + ); + if(Flg==0 & (p1<em1 % p1>eM1 % p2<em2 % p2>eM2), + if(q1<em1 % q1>eM1 % q2<em2 % q2>eM2, + Out=["inf","inf"]; + Flg=1; + ); + if(Flg==0, + rT=min([max([q1,0]),1]); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + Flg=1; + ); + ); + if(Flg==0 & (q1<em1 % q1>eM1% q2<em2 % q2>eM2), + rT=min([max([p1,0]),1]); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + Flg=1; + ); + if(Flg==0, + if(abs(p2)<abs(q2), + rT=min([max([p1,0]),1]); + , + rT=min([max([q1,0]),1]); + ); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + ); + Out; +); + +IntersectcrvsPp(Gr1,Gr2):=IntersectcrvsPp(Gr1,Gr2,[]); +IntersectcrvsPp(Gr1,Gr2,options):=( +//help:IntersectcrvsPp("gr1","pa1"); + regional(Out,Eps,Eps2,Eps0,Flg,Data1,Data2, + Tmp1,Tmp2,Tmp3,Tmp,KL1,KL2,pA,pB,Ni,Nj, + pP,pQ,rT,Flg,eqL,realL,opstr,Dif); + Eps=10^(-4); + Eps2=0.1; + Dif=0.05; // 2015.05.31 + Flg=0; + Tmp1=Divoptions(options); // + eqL=Tmp1_5; + realL=Tmp1_6; + opstr=Tmp1_(length(Tmp1)); + forall(eqL, + if(substring(#,0,1)=="D", + Tmp1=indexof(#,"="); + Dif=parse(substring(#,Tmp1,length(#))); + ); + ); + Tmp1=length(realL); + if(Tmp1>0, + Eps=realL_1; + if(Tmp1>1, + Eps2=realL_2; + ); + ); + Flg=0; + if(isstring(Gr1),Data1=parse(Gr1),Data1=Gr1); + if(isstring(Gr2),Data2=parse(Gr2),Data2=Gr2); + if(MeasureDepth(Data1)==2,Data1=Data1_1); + if(MeasureDepth(Data2)==2,Data2=Data2_1); + Data1=apply(Data1,LLcrd(#)); + Data2=apply(Data2,LLcrd(#)); + if(length(Data1)==length(Data2), + Tmp1=Reverse(Data2); + Eps0=10^(-6); + Tmp2=0; + forall(1..length(Data1), + Tmp2=Tmp2+abs(Data1_#-Data2_#); + ); + Tmp3=0; + forall(1..length(Data1), + Tmp3=Tmp3+abs(Data1_#-Tmp1_#); + ); + if(Tmp2<Eps0 % Tmp3<Eps0, + Out=[]; + Flg=1; + ); + ); + if(Flg==0, + KL1=[]; + KL2=[]; + forall(1..(length(Data1)-1),Ni, + pA=Data1_Ni; + pB=Data1_(Ni+1); + forall(1..(length(Data2)-1), + pP=Data2_#; pQ=Data2_(#+1); + Tmp=Koutenseg(pA,pB,pP,pQ,[Eps,Eps2]); + if(Tmp!=["inf","inf"], + if(Tmp_3==0, + Tmp1=[Tmp_1,Tmp_2,Ni,#]; + KL1=concat(KL1,[Tmp1]); + , + Tmp2=[Tmp_1,Tmp_2,Ni,#]; + KL2=concat(KL2,[Tmp2]); + ); + ); + ); + ); + Out=[]; + if(length(KL1)>0, + Tmp=KL1_1; + pP=Tmp_1; + rT=Tmp_2; + Ni=Tmp_3; + Nj=Tmp_4; + Tmp=[pP,Ni+rT,Nj]; + Out=[Tmp]; + ); + forall(2..length(KL1),Ni, + Tmp=KL1_Ni; + pP=Tmp_1; + Tmp2=0; + Flg=0; + forall(1..length(Out),Nj, + if(Flg==0, + Tmp=Out_Nj; + if(|pP-Tmp_1|<Eps, + Tmp2=1; + Flg=1; + ); + ); + ); + if(Tmp2==0, + Tmp=KL1_Ni; + pP=Tmp_1; + rT=Tmp_2; + Tmp1=Tmp_3; + Tmp2=Tmp_4; + Tmp=[pP,Tmp1+rT,Tmp2]; + Out=concat(Out,[Tmp]); + ); + ); + forall(1..length(KL2),Ni, + Tmp=KL2_Ni; // 15.11.21 Usui + pP=Tmp_1; + Tmp2=0; + Flg=0; + forall(1..length(Out),Nj, + if(Flg==0, + Tmp=Out_Nj; + if(|pP-Tmp_1|<Eps, + Tmp2=1; + Flg=1; + ); + ); + ); + if(Tmp2==0, + Tmp=KL2_Ni; + rT=Tmp_2; + rT=min([max([rT,0]),1]); // 15.11.21 Usui + Tmp=[pP,Tmp_3+rT,Tmp_4]; + Out=concat(Out,[Tmp]); + ); + ); + ); + Tmp1=Out; // 15.04.06 from + Out=[]; + forall(Tmp1,Tmp2, + Tmp3=select(1..(length(Out)),|Out_#_1-Tmp2_1|<Dif);//16.11.27 + if(length(Tmp3)==0, + Out=append(Out,Tmp2); + , + forall(Tmp3,//16.11.27 + Out_#=(Out_#+Tmp2)/2; + ); + ); + ); // 15.04.06 upto + Out; +); + +Intersectcrvs(Gr1,Gr2):=Intersectcrvs(Gr1,Gr2,[]); +//help:Intersectcrvs("gr1","pa1"); +Intersectcrvs(Gr1,Gr2,options):=( + regional(tmp,tmp1,tmp2); + tmp1=IntersectcrvsPp(Gr1,Gr2,options); + apply(tmp1,#_1); +); + +NearestptcrvPhy(point,PL):=( + regional(tmp,pP,plist); + pP=Pcrd(point); + if(isstring(PL),plist=parse(PL),plist=PL); + if(MeasureDepth(plist)==2,plist=plist_1); + plist=apply(plist,#); // 14.12.18 + tmp=Nearestpt(pP,plist); + tmp=tmp_1; + [tmp_1/SCALEX,tmp_2/SCALEY]; +); + +Nearestptcrv(point,plist):=( +//help:Nearestptcrv(A,"gr1"); + regional(tmp); + tmp=Nearestpt(point,plist); + tmp_1; +); + +Nearestpt(point,PL2):=( + regional(PL1,PL,Ans,Flg,Eps,pA,Pm,Im,Sm,Nn,Ni, + a1,b1,a2,b2,v1,v2,x1,x2,Tmp,rT,pP,sS,Lm,Pm,Sm,Flg); +//help:Nearestpt("gr1","gr2"); + if(isstring(point),PL1=parse(point),PL1=point); + if(MeasureDepth(PL1)==2,PL1=PL1_1); + if(!islist(PL1_1), + PL1=[PL1]; + Flg=0; + , + Flg=1; + ); + if(isstring(PL2),PL=parse(PL2),PL=PL2); + if(MeasureDepth(PL)==2,PL=PL_1); + Eps=10^(-6); + Ans=[PL1_1,1,PL_1,1,|PL1_1-PL_1|]; + forall(1..length(PL1),Nn, // 16.05.04 + pA=PL1_Nn; + Pm=PL_1; + Im=1; + Sm=|Pm-pA|; + forall(1..(length(PL)-1),Ni, + a1=PL_Ni_1; a2=PL_Ni_2; + b1=PL_(Ni+1)_1; b2=PL_(Ni+1)_2; + v1=b1-a1; v2=b2-a2; + x1=pA_1; x2=pA_2; + Tmp=v2^2+v1^2; + if(abs(Tmp)>Eps, + rT=(-a2*v2-v1*a1+v1*x1+x2*v2)/Tmp; + if(rT<-Eps, + pP=[a1,a2]; + , + if(rT>1+Eps, + pP=[b1,b2]; + , + pP=[a1+rT*v1,a2+rT*v2]; + ); + ); + sS=|pP-pA|; + if(sS<Sm-Eps, + Tmp=ParamonCurve(pP,Ni,PL); + Pm=pP; Lm=Tmp; Sm=sS; + ); + ); + if(Sm<Ans_5, // 16.05.03from + Ans=[pA,Nn,Pm,Lm,Sm]; + ); + ); // 16.05.03upto + ); + if(Flg==0, + Ans=Ans_(3..5); + ); + Ans; +); + +Derivative(fun,var,value):=( +//help:Derivative("x^3","x",2); + regional(str,tmp); + str="d("; + str=str+replace(fun,var,"#")+","; + str=str+value+")"; + tmp=Pcrd([1,parse(str)]); // 14.11.08 + tmp_2; +); + +Integrate(pltdata,range):=Integrate(pltdata,range,[]); +Intergrate(Arg1,Arg2,Arg3):=( + regional(pltdata,range,options,fnstr,vartr); + if(islist(Arg2), + pltdata=Arg1; + range=Arg2; + options=Arg3; + Integrate(pltdata,range,options); + , + fnstr=Arg1; + vastr=Arg2; + range=Arg3; + Integrate(fnstr,vastr,range,[]); + ); +); + +Integrate(pltdata,range,options):=( +//help:Integrate("gr1",[1,3]); +//help:Integrate("gr1",[1,3],["Rule=t"]); + regional(tmp,tmp1,eqL,Rule,pdata,Sm,ptP,ptQ,list,va1,va2); + tmp=Divoptions(options); + eqL=tmp_5; + Rule="o"; + forall(eqL, + if(Toupper(substring(#,0,1))=="R", + tmp=indexof(#,"="); + Rule=substring(#,tmp,tmp+1); + ); + ); + if(Rule=="o", + Sm= IntegrateO(pltdata,range); + , + if(isstring(pltdata),pdata=parse(pltdata),pdata=pltdata); + if(MeasureDepth(pdata)==2,pdata=pdata_1); + va1=MeetCurve(pdata,range_1,0); + va2=MeetCurve(pdata,range_2,0); + list=select(pdata,(#_1>range_1 & #_1<range_2)); + list=apply(list,LLcrd(#)); // 15.09.14 + list=concat([va1],list); + list=concat(list,[va2]); + Sm=0; + forall(1..(length(list)-1), + ptP=list_#; // 15.09.14 + ptQ=list_(#+1); + Sm=Sm+(ptP_2+ptQ_2)*(ptQ_1-ptP_1)/2; + ); + Sm; + ); +); + +Integrate(fnstr,vastr,range,options):=( +//help:Integrate("sin(x)","x",[0,pi],["Num=100","Rule=s"]); + regional(tmp,tmp1,Sm,Lx,Rx,va1,va2,Num,Waysx,ex,dx,xn,yn,x0,x1,x2,y0,y1,y2); + Num=100; + Way="t"; + forall(options, + if(indexof(#,"=")>0, + if(indexof(#,"N=")>0, + Num=parse(substring(#,indexof(#,"="),length(#))); + ); + if(indexof(#,"Num=")>0, + Num=parse(substring(#,indexof(#,"="),length(#))); + ); + if(Toupper(substring(#,0,1))=="R", + tmp=indexof(#,"="); + Way=substring(#,tmp,tmp+1); + ); + ); + ); + Sm=0; + if(Way=="t", + forall(1..Num, + Lx=range_1+(range_2-range_1)*(#-1)/Num; + Rx=range_1+(range_2-range_1)*#/Num; + va1=parse(replace(fnstr,vastr,textformat(Lx,5))); + va2=parse(replace(fnstr,vastr,textformat(Rx,5))); + Sm=Sm+(va1+va2)*(Rx-Lx)/2; + ); + , + sx=range_1; + ex=range_2; + dx=(ex-sx)/Num; + xn=apply(0..Num,sx+#*dx); + yn=apply(xn,parse(replace(fnstr,vastr,textformat(#,5)))); + dx=dx/2; + repeat(Num,s, + x0=xn_s; + x1=(xn_s+xn_(s+1))/2; + x2=xn_(s+1); + y0=yn_s; + y1=parse(replace(fnstr,vastr,textformat(x1,5))); + y2=yn_(s+1); + Sm=Sm+dx*(y0+4*y1+y2)/3; + ); + ); + Sm; +); + +IntegrateO(p0org,p1org,p2org,p3org):=( + regional(p0,p1,p2,p3,pQ,pR,cc,p01,p02, + p11,p12,p21,p22,p31,p32, tmp); + if(ispoint(p0org),p0=p0org.xy,p0=p0org); // 16.03.10 + if(ispoint(p1org),p1=p1org.xy,p1=p1org); // 16.03.16 + if(ispoint(p2org),p2=p2org.xy,p2=p2org); + if(ispoint(p3org),p3=p3org.xy,p3=p3org); + tmp=1+sqrt((1+Dotprod(p2-p0,p3-p1)/|p2-p0|/|p3-p1|)/2); + cc=4*|p2-p1|/3/(|p2-p0|+|p3-p1|)/tmp; + pQ=p1+cc*(p2-p0); + pR=p2+cc*(p1-p3); + p01=p1_1; p02=p1_2; + p31=p2_1; p32=p2_2; + p11=pQ_1; p12=pQ_2; + p21=pR_1; p22=pR_2; + tmp=-6*p12*p01+3*p12*p21+3*p12*p31+6*p02*p11- + 10*p02*p01+3*p02*p21+p02*p31-3*p22*p11- + 3*p22*p01+6*p22*p31-3*p32*p11-p32*p01- + 6*p32*p21+10*p32*p31; + tmp=tmp/20; +); +IntegrateO(pltdata,rangeorg):=( +//help:IntegrateO("gr1",[0,2]); + regional(tmp,tmp1,tmp2,pdata,va1,va2,list,Bzk,Bzc,range,pmflg, + Sm,p0,p1,p2,p3,pQ,pR,cc,p01,p02,p11,p12,p21,p22,p31,p32); + if(isstring(pltdata),pdata=parse(pltdata),pdata=pltdata); + if(MeasureDepth(pdata)==2,pdata=pdata_1); + range=rangeorg; + pmflg=1; + if(range_2<range_1, + range=reverse(range); + pmflg=-1; + ); + va1=MeetCurve(pdata,range_1,0); + va2=MeetCurve(pdata,range_2,0); + list=select(pdata,(#_1>range_1 & #_1<range_2)); + if((length(list)>0) & (list_1_1>list_(length(list))_1), + list=reverse(list); +// pmflg=pmflg*(-1); + ); + list=apply(list,LLcrd(#)); + list=concat([va1],list); + list=concat(list,[va2]); + Sm=0; + forall(1..(length(list)-1), + p1=list_#; + p2=list_(#+1); + if(#==1 % #==length(list)-1, + tmp1=(p1_2+p2_2)*(p2_1-p1_1)/2; + Sm=Sm+tmp1; + , + p0=list_(#-1); + p3=list_(#+2); + tmp=1+sqrt((1+Dotprod(p2-p0,p3-p1)/|p2-p0|/|p3-p1|)/2); + cc=4*|p2-p1|/3/(|p2-p0|+|p3-p1|)/tmp; + pQ=p1+cc*(p2-p0); + pR=p2+cc*(p1-p3); + p01=p1_1; p02=p1_2; + p31=p2_1; p32=p2_2; + p11=pQ_1; p12=pQ_2; + p21=pR_1; p22=pR_2; + tmp1=-6*p12*p01+3*p12*p21+3*p12*p31+6*p02*p11- + 10*p02*p01+3*p02*p21+p02*p31-3*p22*p11- + 3*p22*p01+6*p22*p31-3*p32*p11-p32*p01- + 6*p32*p21+10*p32*p31; + tmp1=tmp1/20; + Sm=Sm+tmp1; + ); + ); + if(pmflg==-1, + Sm=-Sm; + ); + Sm; +); + +Findarea(pdstr):=( +//help:Findarea("sgABCA"); + regional(pd,p1,p2,s,tmp); + if(isstring(pdstr),pd=parse(pdstr),pd=pdstr); + s=0; + forall(1..(length(pd)-1), + p1=Lcrd(pd_#); + p2=Lcrd(pd_(#+1)); + tmp=(p1_2+p2_2)*(p2_1-p1_1)/2; + s=s+tmp; + ); + if(s<0,s=-s); + s; +); + +Findarea(pdstr):=( // 15.11.27 +//help:Findarea("cr1"); + regional(pd,p0,p1,p2,p3,s,tmp); + if(isstring(pdstr),pd=parse(pdstr),pd=pdstr); + s=0; + forall(1..(length(pd)-1), + p1=pd_#; + p2=pd_(#+1); + if(#==1,p0=pd_(length(pd)-1),p0=pd_(#-1)); + if(#==length(pd)-1,p3=pd_2,p3=pd_(#+2)); + tmp=IntegrateO(p0,p1,p2,p3); + s=s+tmp; + ); + if(s<0,s=-s); + s; +); + +Findlength(pdstr):=( +//help:Findlength("gr1"); + regional(pd,p1,p2,s,tmp); + if(isstring(pdstr),pd=parse(pdstr),pd=pdstr); + s=0; + forall(1..(length(pd)-1), + p1=Lcrd(pd_#); + p2=Lcrd(pd_(#+1)); + tmp=|p2-p1|; + s=s+tmp; + ); + s; +); + +Inversefun(fnstr,rngstr,value):=( + regional(tmp,varstr,range,x1,x2,x3,va1,va2); + tmp=indexof(rngstr,"="); + varstr=substring(rngstr,0,tmp-1); + range=parse(substring(rngstr,tmp,length(rngstr))); + x1=range_1; x2=range_2; + repeat(15, + x3=(x1+x2)/2; + va1=parse(replace(fnstr,varstr,textformat(x1,5))); + va2=parse(replace(fnstr,varstr,textformat(x3,5))); + if((va1>value & va2>value) % (va1<value & va2<value), + x1=x3; + , + x2=x3; + ); + ); + va1=parse(replace(fnstr,varstr,textformat(x1,5)))-value; + va2=parse(replace(fnstr,varstr,textformat(x2,5)))-value; + if(x1==range_1 % x2==range_2, + println("not found in ("+textformat(range_1,5) + +","+textformat(range_2,5)+")"); + ); + if(abs(va1)<=abs(va2),x1,x2); +); + +Lcrd(pt):=( + regional(tmp); + if(ispoint(pt), + tmp=[pt.x/SCALEX,pt.y/SCALEY]; + , + tmp=pt; + ); + tmp; +); + +Pcrd(pt):=( + regional(tmp); + if(ispoint(pt), + tmp=re(pt.xy); // 15.07.24 + , + tmp=[pt_1*SCALEX,pt_2*SCALEY]; + ); + tmp; +); + +LLcrd(pt):=( + regional(tmp); + if(ispoint(pt), + tmp=pt.xy + , + tmp=pt; + ); + tmp=[tmp_1/SCALEX,tmp_2/SCALEY]; + tmp; +); + +Doscaling(pltdata):=( + regional(Level,Out,gL,gr,tmp); + if(ispoint(pltdata) % isreal(pltdata_1), + gL=[[pltdata]]; + Level=0; + , + if(ispoint(pltdata_1) % isreal(pltdata_1_1), + gL=[pltdata]; + Level=1; + , + gL=pltdata; + Level=2; + ); + ); + Out=[]; + forall(gL,gr, + tmp=apply(gr,Lcrd(#)); + tmp=apply(tmp,LLcrd(#)); + Out=concat(Out,[tmp]); + ); + if(Level==0, + Out=Out_1_1; + ); + if(Level==1, + Out=Out_1; + ); + Out; +); + +Unscaling(pltdata):=( + regional(Level,Out,gL,gr,tmp); + if(ispoint(pltdata) % isreal(pltdata_1), + gL=[[pltdata]]; + Level=0; + , + if(ispoint(pltdata_1) % isreal(pltdata_1_1), + gL=[pltdata]; + Level=1; + , + gL=pltdata; + Level=2; + ); + ); + Out=[]; + forall(gL,gr, + tmp=apply(gr,Lcrd(#)); + tmp=apply(tmp,LLcrd(#)); + Out=concat(Out,[tmp]); + ); + if(Level==0, + Out=Out_1_1; + ); + if(Level==1, + Out=Out_1; + ); + Out; +); + +Definecolor(name,data):=( +//help:Definecolor("mycolor",[1,1,1,0]); + regional(type,tmp); + if(length(data)>3,type="cmyk",type="rgb"); + tmp=text(data); + tmp=substring(tmp,1,length(tmp)-1); + tmp="\definecolor{"+name+"}{"+type+"}{"+tmp+"}"; + Texcom(tmp); +); + +Setcolor(Par):=( +//help:Setcolor([1,0,0,1]); +//help:Setcolor([1,1,0]); + if(islist(Par), + if(length(Par)==3, + Setcolorrgb(Par); // 2015.04.28 +// KCOLOR=Par; + ); + if(length(Par)==4, + Setcolor(Par,[]); + ); + , + Setcolor(Par,[]); + ); +); + +Setcolor(colorname,options):=( +//help:Setcolor("greenyellow",0.3); + regional(tmp); + if(isstring(colorname), + tmp="Setcolor("+Dq+colorname+Dq; + if(length(options)>0, + tmp=tmp+","+text(options_1); + ); + Com2nd(tmp+")"); + ); + if(islist(colorname), + tmp=text(colorname); + tmp=substring(tmp,1,length(tmp)-1); + tmp="Texcom("+Dq+"\color[cmyk]{"+tmp+"}"+Dq+")"; + Com2nd(tmp); + ); +); + +Setcolorrgb(colorlist):=( +// help:Setcolorrgb([0.5,0.3,0.4]); + regional(tmp); + tmp=text(colorlist); + tmp=substring(tmp,1,length(tmp)-1); + tmp="Texcom("+Dq+"\color[rgb]{"+tmp+"}"+Dq+")"; + Com2nd(tmp); +); + +ColorRgb2Cmyk(clr):=( +// help:ColorRgb([0.2,0.5,0.1]); + regional(clrnew,tmp,black); + tmp=apply(clr,1-#); + black=min(tmp); + tmp=apply(clr,(1-#-black)/(1-black)); + clrnew=append(tmp,black); + clrnew; +); + +ColorCmyk2Rgb(clr):=( +// help:ColorRgb([0.2,0.5,0.1,0.2]); + regional(clrnew,tmp,black); + black=clr_4; + tmp=apply(clr,1-min(1,#*(1-black)+black)); + clrnew=tmp_(1..3); + clrnew; +); + +Colorrgbhsv(rgb):=( + regional(varR,varG,varB,varMin,varMax,delMax,hh,ss,vv,delR,delG,delB); + varR = rgb_1; + varG = rgb_2; + varB = rgb_3; + varMin = min( [varR, varG, varB] ); + varMax = max( [varR, varG, varB] ); + delMax = varMax - varMin ; + vv = varMax; + if ( delMax == 0 , + hh = 0 ; + ss = 0 ; + , + ss = delMax / varMax; + delR = ( ( ( varMax - varR ) / 6 ) + ( delMax / 2 ) ) / delMax; + delG = ( ( ( varMax - varG ) / 6 ) + ( delMax / 2 ) ) / delMax; + delB = ( ( ( varMax - varB ) / 6 ) + ( delMax / 2 ) ) / delMax; + if( varR == varMax , + hh = delB - delG; + , + if ( varG == varMax, + hh = ( 1 / 3 ) + delR - delB; + , + if ( varB == varMax , + hh = ( 2 / 3 ) + delG - delR; + ); + ); + ); + if ( hh < 0 ,hh = hh+1); + if ( hh > 1 ,hh = hh-1); + ); + [hh*360,ss,vv]; +); + +Colorhsvrgb(sL):=( + regional(tmp,tmp1,tmp2,tmp3,hi,ff,dL); + tmp=[sL_1/60,sL_2,sL_3]; + hi=mod(floor(tmp_1),6); + ff=tmp_1-floor(tmp_1); + tmp2=tmp_3*[1-tmp_2,1-tmp_2*ff,1-tmp_2*(1-ff)]; + tmp2=append(tmp2,tmp_3); + if(hi==0,dL=tmp2_[4,3,1]); + if(hi==1,dL=tmp2_[2,4,1]); + if(hi==2,dL=tmp2_[1,4,3]); + if(hi==3,dL=tmp2_[1,2,4]); + if(hi==4,dL=tmp2_[3,1,4]); + if(hi==5,dL=tmp2_[4,1,2]); + dL; +); + +Colorrgbhsl(rgb):=( + regional(rr,gg,bb,mn,mx,delta,deltaR,deltaG,deltaB,hh,ss,ll); + rr = rgb_1 ; + gg = rgb_2 ; + bb = rgb_3 ; + mn = min([rr, gg, bb]); + mx = max([rr, gg, bb]); + delta = mx - mn; + ll = (mx + mn) / 2; + if (delta == 0, + hh=0; + ss=0; + , + if (ll < 0.5, + ss = delta/ (mx + mn); + , + ss = delta / (2 - mx - mn); + ); + deltaR = (((mx - rr) / 6) + (delta / 2)) / delta; + deltaG = (((mx - gg) / 6) + (delta / 2)) / delta; + deltaB = (((mx - bb) / 6) + (delta / 2)) / delta; + if (rr == mx, + hh = deltaB - deltaG; + , + if (gg == mx, + hh = (1 / 3) + deltaR - deltaB; + , + if (bb == mx, + hh = (2 / 3) + deltaG - deltaR; + ); + ); + ); + if ( hh < 0, hh = hh+1); + if ( hh > 1, hh = hh-1); + ); + [hh*360,ss,ll]; +); + +Colorhslrgb(hsl):=( + regional(hh,ss,ll,rr,gg,bb,var1,var2); + hh=hsl_1/360; + ss=hsl_2; + ll=hsl_3; + if ( ss == 0.0, + rr = ll ; + gg = ll ; + bb = ll ; + , + if ( ll < 0.5 , + var2 = ll * ( 1.0 + ss ); + , + var2 = ( ll + ss ) - ( ss * ll ); + ); + var1 = 2.0 * ll - var2; + rr = hue2rgb( var1, var2, hh + ( 1.0 / 3.0 ) ); + gg = hue2rgb( var1, var2, hh ); + bb = hue2rgb( var1, var2, hh - ( 1.0 / 3.0 ) ); + ); + [rr,gg,bb]; +); + +hue2rgb(vv1,vv2,vh):=( + regional(out); + if ( vh < 0.0 ,vh =vh+1); + if ( vh > 1.0 ,vh =vh-1); + if ( 6.0*vh < 1.0 , + out = vv1 + ( vv2 - vv1 ) * 6.0 * vh ; + , + if( 2.0*vh < 1.0 , + out = vv2; + , + if ( 3.0*vh < 2.0 , + out = vv1 + ( vv2 - vv1 ) * ( ( 2.0 / 3.0 ) - vh ) * 6.0 ; + , + out= vv1 ; + ); + ); + ); + out; +); + +Colorrgbhwb(sL):=( + regional(dl1,dl2,dl3); + dl1 = Colorrgbhsl(sL)_1;//Colorcode("rgb","hsl",sL)_1; + dl2 = min(sL); + dl3 = 1 - max(sL); + dL= [dl1, dl2 , dl3 ]; +); + +Colorhwbrgb(sLorg):=( + regional(sL,tmp,tmp1,tmp2,tmp3,ratio,ff,ii,vv,nn,dL,flg); + sL=sLorg; + sL=[sL_1/360,sL_2,sL_3]; + ratio = sL_2 + sL_3; + // sL_2 + sL_3 cant be > 1 + if (ratio > 1., + sL_2 =sL_2 / ratio; + sL_3 = sL_3 / ratio; + ); + ii = floor(6 * sL_1); + vv = 1 - sL_3; + ff = 6 * sL_1 - ii; + if(mod(ii,2)==1,ff = 1 - ff); + nn = sL_2 + ff * (vv - sL_2); // linear interpolation + tmp=[[vv,nn,sL_2],[nn,vv,sL_2],[sL_2,vv,nn], + [sL_2,nn,vv],[nn,sL_2,vv],[vv,sL_2,nn],[vv,nn,sL_2]]; + flg=0; + forall(0..6, + if(flg==0 & ii == # , + dL=tmp_(#+1); + flg=1; + ); + ); + dL; +); + +Colorhslhsv(sL):=( + regional(dl1,dl2,dl3,dL); + dl1=sL_1; + if(sL_3 == 0, + // no need to do calc on black + // also avoids divide by 0 error + dL= [0, 0, 0]; + , + sL_3 = sL_3 * 2; + if(sL_3 <= 1,sL_2 = sL_2 * sL_3,sL_2 = sL_2 * (2 - sL_3)); + dl3 = (sL_3 + sL_2) / 2; + dl2 = (2 * sL_2) / (sL_3 + sL_2); + dL = [dl1, dl2, dl3]; + ); + dL; +); + +Colorcode(src,dest,sL):=( +//help:Colorcode("rgb","cmyk",[1,0.5,0]); + regional(tmp,tmp1,tmp2,tmp3,mn,mx,delta,black,dL,flg); + regional(dl1,dl2,dl3); + if(src=="rgb" & dest=="hsv", dL=Colorrgbhsv(sL)); + if(src=="hsv" & dest=="rgb", dL=Colorhsvrgb(sL)); + if(src=="rgb" & dest=="hsl", dL=Colorrgbhsl(sL)); + if(src=="hsl" & dest=="rgb", dL=Colorhslrgb(sL)); + if(src=="rgb" & dest=="hwb", dL=Colorrgbhwb(sL)); + if(src=="hwb" & dest=="rgb", dL=Colorhwbrgb(sL)); + if(src=="hsl" & dest=="hsv", dL=Colorhslhsv(sL)); + if(src=="hsv" & dest=="hsl", + dl1 = sL_1; + dl3 = (2 - sL_2) * sL_3; + dl2 = sL_2 * sL_3; + if(dl3 <= 1,dl2 = dl2/dl3,dl2=dl2/(2 - dl3)); + dl3 =d l3/ 2; + dL = [dl1, dl2 , dl3 ]; + ); + + if(src=="rgb" & dest=="cmyk", + tmp=apply(sL,1-#); + black=min(tmp); + tmp=apply(sL,(1-#-black)/(1-black)); + dL=append(tmp,black); + ); + if(src=="cmyk" & dest=="rgb", + black=sL_4; + tmp=apply(sL,1-min(1,#*(1-black)+black)); + dL=tmp_(1..3); + ); + if(src=="hsv" & dest=="cmyk", + tmp=Colorcode("hsv","rgb",sL); + dL=Colorcode("rgb","cmyk",tmp); + ); + if(src=="cmyk" & dest=="hsv", + tmp=Colorcode("cmyk","rgb",sL); + dL=Colorcode("rgb","hsv",tmp); + ); + + if(src=="hsv" & dest=="hwb", + tmp = Colorcode("hsv","rgb",sL); + dL = Colorcode("rgb","hwb",tmp); + ); + if(src=="hwb" & dest=="hsv", + tmp = Colorcode("hwb","rgb",sL); + dL = Colorcode("rgb","hsv",tmp); + ); + if(src=="hsl" & dest=="hwb", + tmp = Colorcode("hsl","rgb",sL); + dL = Colorcode("rgb","hwb",tmp); + ); + if(src=="hwb" & dest=="hsl", + tmp = Colorcode("hwb","rgb",sL); + dL = Colorcode("rgb","hsl",tmp); + ); + if(src=="hsl" & dest=="cmyk", + tmp = Colorcode("hsl","rgb",sL); + dL = Colorcode("rgb","cmyk",tmp); + ); + if(src=="hwb" & dest=="cmyk", + tmp = Colorcode("hwb","rgb",sL); + dL = Colorcode("rgb","cmyk",tmp); + ); + if(src=="cmyk" & dest=="hsl", + tmp = Colorcode("cmyk","rgb",sL); + dL = Colorcode("rgb","hsl",tmp); + ); + if(src=="cmyk" & dest=="hwb", + tmp = Colorcode("cmyk","rgb",sL); + dL = Colorcode("rgb","hwb",tmp); + ); + if(src=="hsb" & dest=="rgb",dL=Colorcode("hsv","rgb",sL)); + if(src=="rgb" & dest=="hsb",dL=Colorcode("rgb","hsv",sL)); + + if(src=="hsb" & dest=="hsl",dL=Colorcode("hsv","hsl",sL)); + if(src=="hsl" & dest=="hsb",dL=Colorcode("hsl","hsv",sL)); + + if(src=="hsb" & dest=="hwb",dL=Colorcode("hsv","hwb",sL)); + if(src=="hwb" & dest=="hsb",dL=Colorcode("hwb","hsv",sL)); + + if(src=="hsb" & dest=="cmyk",dL=Colorcode("hsv","cmyk",sL)); + if(src=="cmyk" & dest=="hsb",dL=Colorcode("cmyk","hsv",sL)); + + dL; +); + +Addcolor(cmdorg,list):=( +//help:Addcolor("Plotdata('1','x^2','x',[])",[1,1,0]); + regional(rgb,cmyk,cmd,tmp,tmp1,tmp2,tmp3,tmp4); + cmd=replace(cmdorg,"'",Dq); + if(length(list)==3, + rgb=list; + cmyk=Colorcode("rgb","cmyk",list); + , + cmyk=list; + rgb=Colorcode("cmyk","rgb",list); + ); + tmp1="color->"+text(rgb); + tmp2="Setcolor("+text(cmyk)+");"; + tmp3=substring(cmd,0,length(cmd)-2); + tmp=substring(tmp3,length(tmp3)-1,length(tmp3)); + if(tmp!="[", + tmp3=tmp3+","; + ); + tmp3=tmp3+Dq+tmp1+Dq+"])"; + parse(tmp2); + parse(tmp3); + Setcolor("black"); +); + +Colorinfile(filename,clrf,clrt):=( + regional(tmp,tmp1,tmp2,head,cstrL,chstrL,head,body); + if(length(clrf_1)==3, + head="[rgb]{"; + , + head="[cmyk]{"; + ); + tmp=apply(clrf,text(#)); + cstrL=apply(tmp,head+substring(#,1,length(#)-1)+"}"); + if(length(clrt_1)==3, + head="[rgb]{"; + , + head="[cmyk]{"; + ); + tmp=apply(clrt,text(#)); + chstrL=apply(tmp,head+substring(#,1,length(#)-1)+"}"); + tmp1=load(filename); + tmp=tokenize(tmp1,"{\unitlength"); + head=tokenize(tmp_1,"%%%"); + head=head_(2..length(head)); + head=apply(head,"%%%"+#); + tmp2=tmp_2; + forall(1..5, + tmp2=replace(tmp2,cstrL_#,chstrL_#); + ); + body=tokenize(tmp2,"%"); + body_1="{\unitlength"+body_1; + body=apply(body,#+"%"); + body=body_(1..(length(body)-1)); + tmp=replace(filename,".tex","new.tex"); + SCEOUT=openfile(tmp); + forall(head, + println(SCEOUT,#); + ); + forall(1..length(body), + tmp=body_#; + if(#<length(body), + println(SCEOUT,tmp); + , + print(SCEOUT,tmp) + ); + ); + closefile(SCEOUT); +); + +GetLinestyle(str,name):=( + regional(noflg,tmp,tmp1,tmp2,Dop,Ltype,subflg); + Ltype=-1; + Dop=""; + tmp1=indexof(str,","); + if(tmp1>0, + Dop=","+substring(str,tmp1,length(str)); + ); + noflg=parse(substring(str,0,1)); + if(substring(name,0,3)=="sub",subflg=1,subflg=0); // 16.02.29 + tmp1=substring(str,1,3); + if(tmp1=="dr" % tmp1=="Dr", + Ltype=0; + if(noflg==0 & subflg==0, // 16.02.29 + Drwline(name+Dop); + ); + ); + if(tmp1=="da" % tmp1=="Da", + Ltype=1; + if(noflg==0 & subflg==0, // 16.02.29 + Dashline(name+Dop); + ); + ); + if(tmp1=="id" % tmp1=="Id", + Ltype=2; // 15.11.09 + if(noflg==0 & subflg==0, // 16.02.29 + Invdashline(name+Dop); + ); + ); + if(tmp1=="do" % tmp1=="Do", + Ltype=3; + if(noflg==0 & subflg==0, // 16.02.29 + Dottedline(name+Dop); + ); + ); + if(tmp1=="dp" % tmp1=="Dp", + Ltype=0; + tmp1=parse(name); + tmp2=""; + forall(tmp1, + tmp2=tmp2+textformat(#_1,5)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); + if(noflg==0, + Drwpt(tmp2+Dop); + ); + ); + if(tmp1=="no" % tmp1=="No", + Ltype=10; + ); + Ltype; +); + +Chunderscore(str):=( + regional(flg,tmp,tmp1,tmp2,tmp3); + if(indexof(str,"]")>0, + tmp1=replace(str,"]",",]"); + , + tmp1=str+","; + ); + flg=0; + tmp2=[]; + tmp3=0; + forall(1..length(tmp1), + if(flg==0, + tmp=substring(tmp1,tmp3,length(tmp1)); + tmp=indexof(tmp,"_"); + if(tmp==0, + flg=1; + , + tmp3=tmp3+tmp; + tmp=substring(tmp1,tmp3,length(tmp1)); + tmp=indexof(tmp,",")-1; + tmp=substring(tmp1,tmp3,tmp3+tmp); + tmp2=append(tmp2,tmp); + ); + ); + ); + forall(tmp2, + tmp1=replace(tmp1,"_"+#,"("+#+")"); + ); + if(indexof(str,"]")>0, + tmp1=replace(tmp1,",]",")"); + tmp1=replace(tmp1,"[","list("); + , + tmp1=substring(tmp1,0,length(tmp1)-1); + ); + tmp1; +); + +//AddGraph(pltdata):=AddGraph("-"+pltdata,pltdata,[]); +AddGraph(nm,pltdata):=AddGraph(nm,pltdata,[]); +// if(isstring(Arg2), +// AddGraph(Arg1,Arg2,[]); +// , +// if(MeasureDepth(Arg2)>0, +// Addgraph(Arg1,Arg2,[]); +// , +// Addgraph("-"+Arg1,Arg1,Arg2); +// ); +// ); +//); +AddGraph(nm,pltdata,options):=( +//help:AddGraph("1","imp1"); // 16.04.04 +//help:Addgraph("1",["[pt1]","gr1"],["nodisp"]); + regional(name,Ltype,Noflg,opcindy,pdata,fname,flg, + tmp,tmp1,tmp2,tmp3); + if(substring(nm,0,1)=="-", + name=substring(nm,1,length(nm)); + , + name="ad"+nm; + ); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_9; + if(isstring(pltdata), + pdata=parse(pltdata) + , + if(!islist(pltdata),pdata=[pltdata],pdata=pltdata); + pdata=apply(pdata,parse(#)); + ); // 15.01.22 + pdata=Flattenlist(pdata); + tmp1=[]; + forall(pdata,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + pdata=tmp1; + if(Noflg<3, + println("generate addgraph "+name); + tmp=name+"="+textformat(pdata,5); + parse(tmp); + if(isstring(pltdata), // 16.04.04 from + if(indexof(pltdata,"]")>0, + tmp1="list(Listplot("+substring(pltdata,1,length(pltdata)); + tmp1=replace(tmp1,"]",",]"); + , + tmp1="Listplot("+substring(pltdata,0,length(pltdata))+",]"; + ); + flg=0; + tmp2=[]; + tmp3=0; + forall(1..length(tmp1), + if(flg==0, + tmp=indexof(substring(tmp1,tmp3,length(tmp1)),"_"); + if(tmp==0, + flg=1; + , + tmp3=tmp3+tmp; + tmp=indexof(substring(tmp1,tmp3,length(tmp1)),",")-1; + tmp=substring(tmp1,tmp3,tmp3+tmp); + tmp2=append(tmp2,tmp); + ); + ); + ); + forall(tmp2, + tmp1=replace(tmp1,"_"+#,"("+#+")"); + ); + tmp1=replace(tmp1,",]",")"); + tmp1=replace(tmp1,",","),Listplot("); + if(indexof(pltdata,"[")>0, + tmp1=tmp1+")"; + ); + GLIST=append(GLIST,name+"="+tmp1); + , + if(MeasureDepth(pdata)==1, + tmp1=name+"=Listplot("+textformat(pdata,5)+")"; + , + tmp1="list("; + forall(1..length(pdata), + tmp=name+"p"+textformat(#,5)+"="; + if(length(pdata_#)>1, // 15.01.22 + tmp=tmp+"Listplot("+textformat(pdata_#,5)+")"; + , + tmp=tmp+"Pointdata("+textformat(pdata_#_1,5)+")"; + ); + GLIST=append(GLIST,tmp); + tmp1=tmp1+name+"p"+textformat(#,5)+","; + ); + tmp1=name+"="+substring(tmp1,0,length(tmp1)-1)+")"; + ); + GLIST=append(GLIST,tmp1); + ); + ); // 16.04.04 upto + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); +); + +Joincrvs(nm,plotstrL):=Joincrvs(nm,plotstrL,[]); +Joincrvs(nm,plotstrL,options):=( +//help:Joincrvs("1",["sgAB","sgDCB"]); + regional(plotlist,PtL,Eps,QdL,Flg,Ni,Qd,pP,pS,pQ,pR,rMN, + opcindy,tmp,tmp1,tmp2,str,name,Ltype,Noflg); + name="join"+nm; + plotlist=[]; + forall(plotstrL,str, + if(isstring(str), + tmp=parse(str); + tmp=apply(tmp,LLcrd(#)); + , + tmp=str; + ); + plotlist=append(plotlist,tmp); + ); + Eps=10^(-4); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + tmp1=tmp_6; + if(length(tmp1)>0,Eps=tmp1_1); + QdL=[]; + forall(plotlist,Qd, + if(ispoint(Qd_1) % !islist(Qd_1_1), + QdL=concat(QdL,[Qd]); + , + forall(Qd, + QdL=concat(QdL,[#]); + ); + ); + ); + Flg=0; + if(length(QdL)==0, + PtL=[]; + Flg=1; + ); + if(Flg==0, + PtL=QdL_1; + forall(2..length(QdL),Ni, + Qd=QdL_Ni; + if(Numptcrv(Qd)>1, + pP=Ptend(PtL); + pS=Ptstart(PtL); + pQ=Ptstart(Qd); + pR=Ptend(Qd); + rMN=min([|pP-pQ|,|pP-pR|,|pS-pQ|,|pS-pR|]); + if(rMN==|pP-pR|, + Qd=reverse(Qd); + , + if(rMN==|pS-pQ|, + PtL=reverse(PtL); + , + if(rMN==|pS-pR|, + PtL=reverse(PtL); + Qd=reverse(Qd); + ); + ); + ); + ); + if(rMN>Eps, + PtL=concat(PtL,Qd); + , + PtL=concat(PtL,Qd_(2..length(Qd))); + ); + ); + ); + if(Noflg<3, + println("generate joincurve "+name); + tmp1=apply(PtL,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=""; + forall(plotstrL, + tmp1=tmp1+#+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1); + GLIST=append(GLIST,name+"=Joincrvs("+tmp1+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PtL; +); + +Partcrv(nm,pA,pB,PkLstr):=Partcrv(nm,pA,pB,PkLstr,[]); +Partcrv(nm,pA,pB,PkLstr,options):=( +//help:Partcrv("1",A,B,"sgABC"); +//help:Partcrv("1",1.3,2.5,"sgABC"); + regional(PkL,Ans,Eps,Npt,Out1,Out2,tmp,tmp1,Flg,nS,nE,PPL,pP, + opcindy,Ta,Tb,name,Ltype,Noflg,DepthFlg); + name="part"+nm; + if(isstring(PkLstr),PkL=parse(PkLstr),PkL=PkLstr); + DepthFlg=0; + if(MeasureDepth(PkL)==2, + PkL=PkL_1; + DepthFlg=1; + ); + PkL=apply(PkL,LLcrd(#)); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + Eps=10^(-3); + Flg=0; + if(isreal(pA), + if(pA>pB+Eps, + Npt=Numptcrv(PkL); + Out1=Partcrv("",pA,Npt,PkLstr,["nodata"]); + Out2=Partcrv("",1,pB,PkLstr,["nodata"]); + tmp=Ptstart(PkL)-Ptend(PkL); + if(|tmp|<Eps, + Ans=Joincrvs("",[Out1,Out2],["nodata"]); + , + Ans=[apply(Out1,Pcrd(#)),apply(Out2,Pcrd(#))]; + ); + Flg=1; + ); + if(Flg==0, + nS=ceil(pA); + nE=floor(pB); + PPL=[]; + if(pA<nS-Eps, + pP=(nS-pA)*PkL_(nS-1)+(1-nS+pA)*PkL_nS; + PPL=[pP]; + ); + PPL=concat(PPL,PkL_(nS..nE)); + if(pB>nE+Eps, + pP=(1-pB+nE)*PkL_nE+(pB-nE)*PkL_(nE+1); + PPL=concat(PPL,[pP]); + ); + Ans=PPL; + Flg=1; + ); + ); + if(Flg==0, + tmp=Nearestpt(LLcrd(Pcrd(pA)),PkL); + Ta=tmp_2; + tmp=Nearestpt(LLcrd(Pcrd(pB)),PkL); // 15.09.12 + Tb=tmp_2; + Ans=Partcrv("",Ta,Tb,PkL,["nodata"] ); + Ans=apply(Ans,Pcrd(#)); + ); + if(Noflg<3, + println("generate partcrv "+name); + tmp1=apply(Ans,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// GLIST=append(GLIST, // 16.04.03 + if(DepthFlg==0, + tmp=PkLstr; + , + tmp=PkLstr+"(1)"; + ); + tmp1=name+"=Partcrv("+textformat(Lcrd(pA),5) + +","+textformat(Lcrd(pB),5)+","+tmp+")"; // 16.04.03 + GLIST=append(GLIST,tmp1); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Ans; +); + +Opcrvs(num,Fig):=Opcrvs(num,Fig,["nodisp"]); +Opcrvs(num,Fig,options):=( + //help:Subgraph(2,"grfs"); + regional(name,tmp,tmp1); + name="-"+Fig+text(num); + tmp=Fig+"_"+text(num); + tmp1=parse(tmp); + Listplot(name,tmp1,options); +); + + +Pointdata(nm,list):=Pointdata(nm,list,[]); +Pointdata(nm,list,options):=( +//help:Pointdata("1",[2,4],["Size=5"]); +//help:Pointdata("2",[[2,3],[4,1]]); + regional(name,nameL,ptlist,opstr,opcindy, + eqL,size,thick,tmp,tmp1,tmp2,tmp3,Ltype,Noflg); + name="pt"+nm; + nameL=name+"L"; + println("generate pointdata "+name); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + opstr=tmp_(length(tmp)-1); + size=""; + eqL=tmp_5; + if(length(eqL)>0, + forall(eqL, + tmp=substring(#,0,1); + if(tmp=="s" % tmp=="S", + tmp=indexof(#,"="); + size=substring(#,tmp,length(#)); + ); + ); + ); + tmp=MeasureDepth(list); + if(tmp>0, // 2015.02.21 + if(tmp==1,ptlist=list,ptlist=list_1); + tmp=apply(ptlist,[textformat(Pcrd(#),5)]); + tmp1=text(tmp); + tmp2=substring(tmp1,1,length(tmp1)-1); + tmp3=tmp1; + , + ptlist=list; + tmp1=textformat(Pcrd(ptlist),5); + tmp2=tmp1; + tmp3="["+tmp1+"]"; + ); + tmp=name+"="+tmp1; + parse(tmp); + tmp=nameL+"="+tmp3; + parse(tmp); + if(Noflg<3, + GLIST=append(GLIST,name+"=Pointdata("+tmp2+")"); + ); + if(Noflg<2, + tmp=[nameL,0,opcindy]; + GCLIST=append(GCLIST,tmp); + if(Noflg==0, + if(length(size)>0, + Com2nd("Setpt("+size+")"); + ); + thick=PenThick/PenThickInit; // 16.04.09 from + if(length(size)>0,tmp1=parse(size),tmp1=1); + tmp1=max(tmp1,1)/8; + Setpen(tmp1); // 16.04.09 upto + Com2nd("Drwpt(list("+name+")"+opstr+")"); + Setpen(thick); // 16.04.09 + if(length(size)>0, + Com2nd("Setpt("+textformat(TenSize/TenSizeInit,1)+")"); + ); + ); + ); + ptlist; +); + +Listplot(nm,list,options):=( +//help:Listplot([A,B]); +// help:Listplot(["A","B"]); +//help:Listplot("1",[[2,1],[3,3]]); +//help:Listplot(options2=["Msg=yes"]); + regional(name,tmp,tmp1,ptlist,Ltype,opcindy,Noflg,eqL,Msg); + if(substring(nm,0,1)=="-", // 16.01.27 from + name=substring(nm,1,length(nm)); + , + name="sg"+nm; + ); // upto + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + eqL=tmp_5; + opcindy=tmp_(length(tmp)); + Msg=1; // 15.09.17 + forall(eqL, + tmp=substring(#,0,1); + if(Toupper(tmp)=="M", + tmp=indexof(#,"="); + tmp1=substring(#,tmp,tmp+1); // 16.06.28 + if(Toupper(tmp1)=="N", // 16.06.28 + Msg=0; + ); + ); + ); + if(Noflg<3, + if(Msg==1, + println("generate Listplot "+name); + ); + if(isstring(list_1),tmp=apply(list,parse(#)),tmp=list); // 15.03.24 + ptlist=apply(tmp,Pcrd(#)); + tmp=name+"="+textformat(ptlist,5); + parse(tmp); + GLIST=append(GLIST,name+"=Listplot("+textformat(list,5)+")"); // 15.12.23 + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + tmp1=apply(list,Lcrd(#)); + tmp1; +); +Listplot(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Listplot(name,list,[]); + , + list=Arg1; + options=Arg2; + name=""; + forall(list, // 16.10.07from + name=name+#.name; + );// 16.10.07upto + Listplot(name,list,options); + ); +); +Listplot(list):=Listplot(list,[]); + +Lineplot(nm,list,options):=( +//help:Lineplot([A,B]); +//help:Lineplot("1",[[2,1],[3,3]]); + regional(name,Out,tmp,tmp1,opstr,opcindy,Mag,Semi, + Vec,pA,pB,Ltype,Noflg); + name="ln"+nm; + Mag=100; + Semi=""; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + opstr=tmp_(length(tmp)-1); + tmp1=tmp_6; + if(length(tmp1)>0,Mag=tmp1_1); + tmp1=tmp_7; + if(length(tmp1)>0,Semi=tmp1_1); + pA=Lcrd(list_1); pB=Lcrd(list_2); + Vec= Mag/dist(pA,pB)*(pB-pA); + if(length(Semi)==0, + Out=[pA-Vec,pA+Vec]; + , + if(Semi=="+", + Out=[pA,pA+Vec]; + , + Out=[pA-Vec,pA]; + ); + ); + if(Noflg<3, + println("generate Lineplot "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST,name+"=Lineplot("+textformat(list,5)+opstr+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); +Lineplot(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Lineplot(name,list,[]); + , + list=Arg1; + options=Arg2; + name=""; + forall(list, // 16.10.07from + name=name+#.name; + );// 16.10.07upto + Lineplot(name,list,options); + ); +); +Lineplot(list):=Lineplot(list,[]); + +Plotdata(name1,func,variable):=Plotdata(name1,func,variable,[]); +Plotdata(name1,func,variable,options):=( +//help:Plotdata("1","sin(x)","x",["Num=100"]); +//help:Plotdata("2","x^2","x=[-1,1]"); +//help:Plotdata("3","Fout(x)","x",["out"]); + regional(Fn,Va,tmp,tmp1,tmp2,eqL,name,Vname,x1,x2,dx, + PdL,QdL,Num,Ec,Dc,Fun,Exfun,x,Ke,Eps,Pa, + Ltype,Noflg,Inflg,Outflg,opstr,opcindy); + name="gr"+name1; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + Inflg=tmp_3; + Outflg=tmp_4; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + Num=50; + Ec=[]; + Exfun=""; + Dc=1000; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+#+"'"; + if(substring(#,0,1)=="N", + Num=parse(tmp1); + ); + if(substring(#,0,1)=="E", + if(substring(tmp1,0,1)=="[", + Ec=parse(tmp1); + , + Exfun=tmp1; + ); + ); + if(substring(#,0,1)=="D", + Dc=parse(tmp1); + ); + ); + if(Inflg==0 & Outflg==0, + Eps=10^(-3); + tmp=replace(func,LFmark,""); + tmp=tokenize(variable,"="); + Vname=tmp_1; + if(length(tmp)>1, + tmp=tmp_2; + tmp=parse(tmp); + x1=tmp_1; + x2=tmp_2; + , + x1=XMIN; + x2=XMAX; + ); + // dx=(x2-x2)/Num; + Ec=append(sort(Ec),10000); + Fun=Assign(func,Vname, "xx"); + Exfun=Assign(Exfun,Vname, "xx"); + PdL=[]; + Ke=1; + forall(0..Num, + xx=x1+#*(x2-x1)/Num; // differs from Scilab ( / Num-1) + if(length(Exfun)>0, + tmp=parse(Exfun); + if(abs(tmp)<Eps, + if(length(Pdt)>0, + PdL=concat(PdL,["inf"]); + ); + ); + , + Pa=[]; + if(xx-Ec_Ke<-Eps, + Pa=[xx,parse(Fun)]; + ); + if(abs(xx-Ec_Ke)<=Eps, + if(length(PdL)>0, + if(PdL_(length(PdL))_1!="inf", + Pa=["inf"]; + ); + ); + ); + if(xx-Ec_Ke>Eps, + Pa=[xx,parse(Fun)]; + Ke=Ke+1; + ); + if(length(Pa)>0, + if(Pa_1=="inf", + PdL=concat(PdL,[Pa]); + , + if(length(PdL)==0, + PdL=[Pa]; + , + tmp=PdL_(length(PdL)); + if(tmp_1=="inf", + PdL=concat(PdL,[Pa]); + , + if(dist(tmp,Pa)<Dc, + PdL=concat(PdL,[Pa]); + , + PdL=concat(PdL,[["inf"],Pa]); + ); + ); + ); + ); + ); + ); + ); + tmp1=[]; + tmp2=select(1..length(PdL),PdL_#==["inf"]); + tmp=1; + forall(tmp2, + if(#>tmp, + tmp1=concat(tmp1,[PdL_(tmp..(#-1))]) + ); + tmp=#+1; + ); + if(tmp<length(PdL), + tmp1=concat(tmp1,[PdL_(tmp..length(PdL))]); + ); + PdL=tmp1; + if(length(PdL)==1, + PdL=PdL_1; + ); + if(Noflg<3, + println("generate Plotdata "+name); + if(MeasureDepth(PdL)==1, + tmp1=apply(PdL,Pcrd(#)); + , + tmp1=[]; + forall(PdL,tmp2, + tmp1=append(tmp1,apply(tmp2,Pcrd(#))); + ); + ); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=replace(func,LFmark,""); + tmp2=replace(variable,LFmark,""); + tmp=name+"=Plotdata('"+tmp1+"','"+tmp2+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; + , + // Inflg or Outflg >0 15.05.15 + if(Noflg<3, + if(Outflg==1, + println("Output Plotdata "+name); + tmp=name+"=Plotdata('"+func+"','"+variable+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + SCIWRLIST=append(SCIWRLIST,name); + if(Inflg==0,Inflg=1); // 15.05.17 + ); + if(Inflg==1, + println("Input Plotdata "+name); + if(length(SCIRELIST)==0, + ReadOutData(Fnameout); + ); + tmp=parse(name); + if(islist(tmp), + Extractdata(name,["nodisp"]); // 12.19 + ); + tmp="// "+name+"=Plotdata('"+func+"','"+variable+"'"+opstr+")"; + Com1st(tmp); + SCIRELIST=append(SCIRELIST,name); + ); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + if(Inflg==1, + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); + ); +); + +Paramplot(name1,funstr,variable):=Paramplot(name1,funstr,variable,[]); +Paramplot(name1,funstr,variable,options):=( +//help:Paramplot("1","[2*cos(t),sin(t)]","t=[0,2*pi]"); + regional(name,Out,tmp,tmp1,tmp2,vname,func,str,Rng,Num, + Ec,Exfun,Dc,eqL,Fntmp,Vatmp,t1,t2,dt,tt,pa,ke, + Ltype,Noflg,Inflg,Outflg,opstr,opcindy); + name="gp"+name1; + Eps=10^(-4); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + Inflg=tmp_3; + Outflg=tmp_4; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + Num=50; + Ec=[]; + Exfun=""; + Dc=1000; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+#+"'"; + if(substring(#,0,1)=="N", + Num=parse(tmp1); + ); + if(substring(#,0,1)=="E", + if(substring(tmp1,0,1)=="[", + Ec=parse(tmp1); + , + Exfun=tmp1; + ); + ); + if(substring(#,0,1)=="D", + Dc=parse(tmp1); + ); + ); + if(Inflg==0 & Outflg==0, + tmp=indexof(variable,"="); + vname=substring(variable,0,tmp-1); + str=substring(variable,tmp,length(variable)); + Rng=parse(str); + t1=Rng_1; t2=Rng_2; + dt=(t2-t1)/Num;// differs from Scilab ( / Num-1) + func=Assign(funstr,vname,"tt"); + Out=[]; + Ec=append(sort(Ec),10000); + ke=1; + forall(0..Num, + pt=[]; + tt=Rng_1+#*dt; + if(tt-Ec_ke<-Eps, + pa=parse(func); + ); + if(abs(tt-Ec_ke)<=Eps, + if(length(Out)>0, + if(Out_(length(Out))_1!="inf", + pa=["inf"]; + ); + ); + ); + if(tt-Ec_ke>Eps, + pa=parse(func); + ke=ke+1; + ); + if(length(pa)>0, + if(pa_1=="inf", + Out=append(Out,pa); + , + if(length(Out)==0, + Out=[pa]; + , + tmp=Out_(length(Out)); + if(tmp_1=="inf", + Out=append(Out,pa); + , + if(|tmp-pa|<Dc, + Out=append(Out,pa); + , + Out=concat(Out,[["inf"],pa]); + ); + ); + ); + ); + ); + ); + tmp1=[]; + tmp2=select(1..length(Out),Out_#==["inf"]); + tmp=1; + forall(tmp2, + if(#>tmp, + tmp1=concat(tmp1,[Out_(tmp..(#-1))]) + ); + tmp=#+1; + ); + if(tmp<length(Out), + tmp1=concat(tmp1,[Out_(tmp..length(Out))]); + ); + Out=tmp1; + if(length(Out)==1, + Out=Out_1; + ); + if(Noflg<3, + println("generate Paramplot "+name); + if(MeasureDepth(Out)==1, + tmp1=apply(Out,Pcrd(#)); + , + tmp1=[]; + forall(Out,tmp2, + tmp1=append(tmp1,apply(tmp2,Pcrd(#))); + ); + ); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=replace(funstr,LFmark,""); // 15.11.13 + tmp2=replace(variable,LFmark,""); + tmp=name+"=Paramplot('"+tmp1+"','"+tmp2+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; + , + // Inflg or Outflg >0 15.05.15 + if(Noflg<3, + if(Outflg==1, + println("Output Paramplot "+name); + tmp=name+"=Paramplot('"+funstr+"','"+variable+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + SCIWRLIST=append(SCIWRLIST,name); + if(Inflg==0,Inflg=1); // 15.05.17 + ); + if(Inflg==1, + println("Input Paramplotdata "+name); + if(length(SCIRELIST)==0, + ReadOutData(Fnameout); + ); + tmp=parse(name); + if(islist(tmp), + Extractdata(name,["nodisp"]); // 12.19 + ); + tmp="// "+name+"=Paramplot('"+func+"','"+variable+"'"+opstr+")"; + Com1st(tmp); + SCIRELIST=append(SCIRELIST,name); + ); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + if(Inflg==1, + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); + ); +); + +Circledata(cenrad):=Circledata(cenrad,[]); +Circledata(para1,para2):=( +//help:Circledata([A,B],["Rng=[0,pi/2]"]); +//help:Circledata([A,B,C]); + regional(name,cenrad,options,str,n); + if(isstring(para1), + name=para1; + cenrad=para2; + options=[]; + , + cenrad=para1; + options=para2; + name="";// 16.10.07from + forall(cenrad, + name=name+#.name; + );// 16.10.07upto + ); + Circledata(name,cenrad,options); +); +Circledata(nm,cenrad,options):=( + regional(name,Out,Ctr,Ptcir,ra,Num,Rg,opstr,opcindy, + tmp,tmp1,tmp1,Th,Ltype,Noflg,eqL,pA,pB,pC,d1,d2,Eps); + name="cr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + Num=50; + Rg=[0,2*pi]; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+#+"'"; + if(substring(#,0,1)=="N", + Num=parse(tmp1); + ); + if(substring(#,0,1)=="R", + Rg=parse(tmp1); + ); + ); + if(length(cenrad)==2, + Ctr=Lcrd(cenrad_1); + Ptcir=Lcrd(cenrad_2); + ra=dist(Ctr,Ptcir); + , + Eps=10^(-1); + pA=Lcrd(cenrad_1); + pB=Lcrd(cenrad_2); + pC=Lcrd(cenrad_3); + tmp=pB-pA; + tmp1=(tmp_2,-tmp_1); + tmp=pC-pB; + tmp2=(tmp_2,-tmp_1); + d1=det([tmp1,tmp2]); + d2=det([pC-pA,tmp2]); + if(abs(d1)<Eps & abs(d2)>10*Eps, + println("points are in a line"); + ra=0; + , + Ctr=1/2*(pA+pB)+1/2*d2/d1*tmp1; + ra=|pA-Ctr|; + tmp=name+"center="+Ctr; + parse(tmp); + Defvar(name+"center",Ctr); + ); + ); + if(ra>0, + Out=[]; + forall(0..Num, + Th=Rg_1+#*(Rg_2-Rg_1)/Num; + Out=append(Out,Ctr+ra*[cos(Th),sin(Th)]); + ); + , + Out=Lineplot("1",[pA,pB],["nodata"]); + ); + if(Noflg<3, + println("generate Circledata "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + if(length(cenrad)==2, + tmp=name+"=Circledata("+cenrad+opstr+")"; + , + if(ra>0, + tmp=name+"=Circledata(["+Ctr+","+cenrad_1+"]"+opstr+")"; + , + tmp=name+"=Lineplot("+cenrad_1+","+cenrad_2+")"; + ); + ); + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +Framedata():=( + regional(pA,pB); + pA=LLcrd((SW+NE)/2); // 15.09.17 + pB=LLcrd(NE); + Framedata("win",[pA,pB]); +); +Framedata(list):=Framedata(list,[]); +Framedata(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Framedata(name,list,[]); + , + list=Arg1; + options=Arg2; + name="";// 16.10.07from + forall(list, + name=name+#.name; + );// 16.10.07upto + Framedata(name,list,options); + ); +); + +Framedata(nm,list,options):=( +//help:Framedata(); +//help:Framedata([A,B]); +//help:Framedata("1",[A,B]); +//help:Framedata("1",[C,dx,dy]); + regional(name,Out,tmp,tmp1,pB,x1,x2,y1,y2,dx,dy, + opcindy,Ltype,Noflg,cent,dx,dy); + name="fr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + if(length(list)==2, // 15.05.12 + pA=Lcrd(list_1); pB=Lcrd(list_2); + dx=abs(pB_1-pA_1); dy=abs(pB_2-pA_2); + , + pA=Lcrd(list_1); + dx=list_2; dy=list_3; + ); + x1=pA_1-dx; x2=pA_1+dx; + y1=pA_2-dy; y2=pA_2+dy; + Out=[[x1,y1],[x2,y1],[x2,y2],[x1,y2],[x1,y1]]; + if(Noflg<3, + println("generate Framedata "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST,name+"=Framedata("+pA+","+dx+","+dy+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); +Framedata(nm,cent,dx,dy):=Framedata(nm,cent,dx,dy,[]); +Framedata(nm,cent,dx,dy,options):=( + regional(name,Out,tmp,tmp1,x1,y1,x2,y2,Ltype,opcindy,Noflg); + name="fr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + x1=cent.x-dx; x2=cent.x+dx; + y1=cent.y-dy; y2=cent.y+dy; + Out=[[x1,y1],[x2,y1],[x2,y2],[x1,y2],[x1,y1]]; + if(Noflg<3, + println("generate Framedata "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST,name+"=Framedata("+cent.xy+","+dx+","+dy+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +Framedata2(nm,list):=Framedata2(nm,list,[]); +Framedata2(nm,list,options):=( +//help:Framedata2("1",[A,B]); + regional(tmp,tmp1,pC,pB); + pC=(Lcrd(list_1)+Lcrd(list_2))/2; + pB=Lcrd(list_2); + Framedata(nm,[pC,pB],options); +); + +Ovaldata(nm,Pdata):=Ovaldata(nm,Pdata,[]); +Ovaldata(nm,Pdata,options):=( +//help:Ovaldata("1",[A,B]); +//help:Ovaldata(optios=[size]); + regional(name,Graph,Ctr,Dx,Dy,Rc,Out,Point,Graph, + opstr,opcindy,tmp,tmp1,tmp2,tmp3,Ltype,Noflg); + name="ov"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + opstr=tmp_(length(tmp)-1); + Rc=0.2; + tmp1=tmp_6; + if(length(tmp1)>0,Rc=tmp1_1*Rc); +// if(length(tmp1)>0,Rc=tmp1_1); //15.11.15 + Ctr=Lcrd(Pdata_1); + if(ispoint(Pdata_2) % islist(Pdata_2), + tmp1=Lcrd(Pdata_2); + Dx=abs(tmp1_1-Ctr_1); + Dy=abs(tmp1_2-Ctr_2); + , + Dx=Pdata_2; + Dy=Pdata_3; + ); + Point=Ctr+[Dx-Rc,Dy-Rc]; + tmp1=Circledata("1",[Point,Point+[Rc,0]], + ["Rng=[0,pi/2]","Num=10","nodata"]); + tmp2=Listplot("1",[Ctr+[Dx-Rc,Dy],Ctr+[0,Dy]], + ["nodata"]); + tmp3=Listplot("2",[Ctr+[Dx,0],Ctr+[Dx,Dy-Rc]], + ["nodata"]); + Graph=Joincrvs("1",[tmp3,tmp1,tmp2],["nodata"]); + tmp1=Reflectdata("1",[Graph],[Ctr,Ctr+[0,1]],["nodata"]); + Graph=Joincrvs("1",[Graph,tmp1],["nodata"]); + tmp2=Reflectdata("2",[Graph],[Ctr,Ctr+[1,0]], + ["nodata"]); + Graph=Joincrvs("2",[Graph,tmp2],["nodata"]); + if(Noflg<3, + println("generate Ovaldata "+name); + tmp1=apply(Graph,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST, + name+"=Ovaldata("+Ctr+","+Dx+","+Dy+opstr+")");//16.01.30 + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + tmp1=apply(Graph,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp=textformat(Ctr,5)+","+textformat(Dx,5)+","+textformat(Dy,5); + GLIST=append(GLIST, + name+"=Ovaldata("+tmp+opstr+")"); + ); + Graph; +); + +Segmark(nm,ptlist):=Segmark(nm,ptlist,[]); +Segmark(nm,ptlist,options):=Drawsegmark(nm,ptlist,options); +Drawsegmark(nm,ptlist):=Drawsegmark(nm,ptlist,[]); +Drawsegmark(nm,ptlist,options):=( +//help:Segmark("1",[A,B]); +//help:Segmark(options=["Type=1","Width=1","Size=1"]); + regional(name,pA,pB,wid,mid,size,tp,dir,nor,eqL, + tmp,tmp1,tmp2); + name="mrk"+nm; + pA=ptlist_1; + pB=ptlist_2; + size=0.15; + wid=0.05; + tp=1; + tmp1=Divoptions(options); + eqL=tmp1_5; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + tmp1=parse(tmp1); + tmp=substring(#,0,1); + if(tmp=="S" % tmp=="s", + size=size*tmp1; + ); + if(tmp=="W" % tmp=="w", + wid=wid*tmp1; + ); + if(tmp=="T" % tmp=="t", + tp=tmp1; + ); + ); + mid=(pA+pB)/2; + dir=(pB-pA)/|pB-pA|; + nor=[-dir_2,dir_1]; +// nor=nor/|nor|; + if(tp==1, + tmp1=mid+size*nor; + tmp2=mid-size*nor; + Listplot(name,[tmp1,tmp2]); + ); + if(tp==2, + tmp1=mid+wid*dir+size*nor; + tmp2=mid+wid*dir-size*nor; + Listplot(name+"r",[tmp1,tmp2]); + tmp1=mid-wid*dir+size*nor; + tmp2=mid-wid*dir-size*nor; + Listplot(name+"l",[tmp1,tmp2]); + ); + if(tp==3, + tmp1=mid; + tmp2=mid+size*dir; + Circledata(name,[tmp1,tmp2]); + ); + if(tp==4, + tmp=mid+size*2/sqrt(3)*nor; + tmp1=mid+size*dir-size/sqrt(3)*nor; + tmp2=mid-size*dir-size/sqrt(3)*nor; + Listplot(name,[tmp,tmp1,tmp2,tmp]); + ); +); + +Parabolaplot(nm,ptlist):=Parabolaplot(nm,ptlist,"[-5,5]",[]); +Parabolaplot(nm,ptlist,Arg):=( + regional(rng,options); + if(isstring(Arg), + rng=Arg; + options=[]; + , + rng="[-5,5]"; + options=Arg; + ); + Parabolaplot(nm,ptlist,rng,options); +); +Parabolaplot(nm,ptlist,rng,options):=( +//help:Parabolaplot("1",[A,B,C]): +//help:Parabolaplot("1",[A,B,C],"[-5,5]"); + regional(pA,pB,pC,angle,tmp,tmp1,tmp2); + tmp1=Lcrd(ptlist_1); + tmp2=Lcrd(ptlist_3); + pB=Lcrd(ptlist_2); + tmp=(tmp2-pB)/|tmp2-pB|; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + pA=Rotatepoint(tmp1,-angle,pB); + pC=Rotatepoint(tmp2,-angle,pB); + tmp1=1/(2*(pA_2-pB_2)); + tmp2=1/2*(pA_2+pB_2); + tmp="("+format(tmp1,5)+")*(x-("+format(pA_1,5)+"))^2"; + tmp=tmp+"+("+format(tmp2,5)+")"; + tmp1=parse(rng); + tmp1=[pA_1-(tmp1_2-tmp1_1)/2,pA_1+(tmp1_2-tmp1_1)/2]; + tmp2="x="+textformat(tmp1,5); + Plotdata(nm+"para",tmp,tmp2,append(options,"nodisp")); + Rotatedata(nm+"para","gr"+nm+"para",angle,append(options,pB)); +); + +Ellipseplot(nm,ptlist):=Ellipseplot(nm,ptlist,"[0,2*pi]",[]); +Ellipseplot(nm,ptlist,Arg):=( + regional(rng,options); + if(isstring(Arg), + rng=Arg; + options=[]; + , + rng="[0,2*pi]"; + options=Arg; + ); + Ellipseplot(nm,ptlist,rng,options); +); +Ellipseplot(nm,ptlist,rng,options):=( +//help:Ellipseplot("1",[A,B,3]); +//help:Ellipseplot("1",[A,B,C],"[0,pi]",[options]); + regional(pA,pB,d,angle,f,a,b,pM,tmp,tmp1,tmp2); + pA=Lcrd(ptlist_1); + tmp1=Lcrd(ptlist_2); + if(ispoint(ptlist_3), + tmp2=Lcrd(ptlist_3); + d=|tmp2-pA|+|tmp2-tmp1|; + , + d=ptlist_3; + ); + tmp=(tmp1-pA)/|tmp1-pA|; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + pB=Rotatepoint(tmp1,-angle,pA); + f=|pB_1-pA_1|/2; + a=d/2; + b=sqrt(d^2/4-f^2); + pM=(pA+pB)/2; + tmp="["+format(pM_1,5)+","+format(pM_2,5)+"]"; + tmp=tmp+"+["+format(a,5)+"*cos(t),"+format(b,5)+"*sin(t)]"; + Paramplot(nm+"elp",tmp,"t="+rng,append(options,"nodisp")); + Rotatedata(nm+"elp","gp"+nm+"elp",angle,append(options,pA)); +); + +Hyperbolaplot(nm,ptlist):=Hyperbolaplot(nm,ptlist,"[-5/2,5/2]",[]); +Hyperbolaplot(nm,ptlist,Arg):=( + regional(rng,options); + if(isstring(Arg), + rng=Arg; + options=[]; + , + rng="[-5/2,5/2]"; + options=Arg; + ); + Hyperbolaplot(nm,ptlist,rng,options); +); +Hyperbolaplot(nm,ptlist,rng,optionsorg):=( +//help:Hyperbolaplot("1",[A,B,C],["Num=200"]): +//help:Hyperbolaplot("1",[A,B,C],"[-5,5]",["Asy=do"]); + regional(pA,pB,d,angle,f,a,b,pM,eqL,options,opasy,tmp,tmp1,tmp2); + tmp=Divoptions(optionsorg); + eqL=tmp_5; + options=optionsorg; + opasy=[]; + forall(eqL, + if(Toupper(substring(#,0,1))=="A", + tmp=indexof(#,"="); + opasy=[substring(#,tmp,length(#))]; + options=remove(options,[#]); + ); + ); + pA=Lcrd(ptlist_1); + tmp1=Lcrd(ptlist_2); + if(ispoint(ptlist_3), + tmp2=Lcrd(ptlist_3); + d=abs(|tmp2-pA|-|tmp2-tmp1|); + , + d=ptlist_3; + ); + tmp=(tmp1-pA)/|tmp1-pA|; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + pB=Rotatepoint(tmp1,-angle,pA); + f=|pB_1-pA_1|/2; + a=d/2; + b=sqrt(f^2-d^2/4); + pM=(pA+pB)/2; + tmp="["+format(pM_1,5)+"+"+format(a,5)+"*(exp(t)+exp(-t))/2,"; + tmp=tmp+format(pM_2,5)+"+"+format(b,5)+"*(exp(t)-exp(-t))/2]"; + Paramplot(nm+"hyp1",tmp,"t="+rng,append(options,"nodisp")); + tmp="["+format(pM_1,5)+"-"+format(a,5)+"*(exp(t)+exp(-t))/2,"; + tmp=tmp+format(pM_2,5)+"+"+format(b,5)+"*(exp(t)-exp(-t))/2]"; + Paramplot(nm+"hyp2",tmp,"t="+rng,append(options,"nodisp")); + tmp=["gp"+nm+"hyp1","gp"+nm+"hyp2"]; + Rotatedata(nm+"hyp",tmp,angle,append(options,pA)); + if(length(opasy)>0, + Lineplot(nm+"asy1",[pM+[a,b],pM+[-a,-b]],["nodisp"]); + Lineplot(nm+"asy2",[pM+[-a,b],pM+[a,-b]],["nodisp"]); + tmp=["ln"+nm+"asy1","ln"+nm+"asy2"]; + Rotatedata(nm+"asy",tmp,angle,append(opasy,pA)); + ); +); + +Polygonplot(nm,ptlist,number):=Polygonplot(nm,ptlist,number,[]); +Polygonplot(nm,ptlist,number,options):=( +//help:Polygonplot("1",[A,B],12); + regional(rr,pA,pB,ptL,angle,tmp,tmp1,tmp2); + pA=Lcrd(ptlist_1); + pB=Lcrd(ptlist_2); + rr=|pB-pA|; + tmp=(pB-pA)/rr; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + ptL=[]; + forall(0..number, + tmp=angle+#*2*pi/number; + tmp1=pA+rr*[cos(tmp),sin(tmp)]; + if(#>0 & #<number, + Putpoint((ptlist_2).name+text(#),tmp1);//16.10.07 + //Pointdata(nm,ptL); + ); + tmp2=tmp1; + ptL=append(ptL,tmp1); + ); + Listplot(nm+"ply",ptL,options); +); + +Putintersect(nm,pdata1,pdata2):=( +//help:Putintersect("Q","gr1","gr2"); + regional(pd1,pd2,tmp); + if(isstring(pdata1),pd1=parse(pdata1),pd1=pdata1); + if(isstring(pdata2),pd2=parse(pdata2),pd2=pdata2); + tmp=Intersectcrvs(pd1,pd2); + if(length(tmp)==1, + Putpoint(nm,tmp_1); + , + if(length(tmp)==0, + err("No intersect point"); + , + err("Multiple intersect points"); + println(tmp); + err("Choose point number"); + ); + ); +); +Putintersect(nm,pdata1,pdata2,ptno):=( + regional(pd1,pd2,tmp); + if(isstring(pdata1),pd1=parse(pdata1),pd1=pdata1); + if(isstring(pdata2),pd2=parse(pdata2),pd2=pdata2); + tmp=Intersectcrvs(pd1,pd2); + if(length(tmp)>0, + Putpoint(nm,tmp_ptno); + , + err("No intersect point"); + ); +); + +Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]); +Arrowheaddata(point,direction,options):=( +//help:Arrowheaddata(A,B); + regional(list,Ookisa,Hiraki,Futosa,Houkou,Str,Flg,tmp,Ev,Nv,pA,pB, + pP,rF,gG,Flg,Nj,Eps,tmp1,scx,scy); + Eps=10^(-3); + pP=point; + Ookisa=0.2*YaSize; + Hiraki=YaAngle; + Futosa=0; + Str=YaStyle; + tmp=Divoptions(options); + tmp1=tmp_6; + if(length(tmp1)>0,Ookisa=Ookisa*tmp1_1); + if(length(tmp1)>1, + tmp=tmp1_2; + if(tmp<5, + Hiraki=Hiraki*tmp; + , + Hiraki=tmp; + ); + ); + Flg=0; + Hiraki=Hiraki*pi/180; + if(isstring(direction),Houkou=parse(direction),Houkou=direction); + if(MeasureDepth(Houkou)==2,Houkou=Houkou_1); + if(islist(Houkou_1), +// pP=Lcrd(pP); +// pP=Doscaling(pP); +// Houkou=Dosscaling(Houkou); + pP=Pcrd(pP); + scy=SCALEY; + SCALEY=1; + tmp=Nearestpt(pP,Houkou); + pA=tmp_1; + rF=floor(tmp_2); + if(rF==1, + if(|Ptend(Houkou)-Ptstart(Houkou)|<Eps, + rF=Numptcrv(Houkou); + ); + ); + gG=apply(0..10,pP+Ookisa*cos(Hiraki)*[cos(2*pi/10*#),sin(2*pi/10*#)]); + Flg=0; + forall(1..rF,Nj, + if(Flg==0, + pB=Ptcrv(rF+1-Nj,Houkou); + tmp=IntersectcrvsPp([pA,pB],gG); + if(length(tmp)>0, + Houkou=pP-tmp_1_1; + Flg=1; + ); + pA=pB; + ); + ); + SCALEY=scy; + if(Flg==0, + println("Arrowhead may be too large (no intersect)"); + Flg=2; + ); + if(Flg==1, + Houkou=Unscaling(Houkou); + pP=Unscaling(pP); + ); + ); + if(Flg<2, +// pP=Doscaling(pP); +// Houkou=Doscaling(Houkou); + pP=Pcrd(pP); + if(!ispoint(point), + Houkou=Pcrd(Houkou); + ); +// if(MeasureDepth(Houkou)==0,Houkou=Pcrd(Houkou)); + Ev=-1/|Houkou|*Houkou; + Ev=Lcrd(Ev); + Nv=[-Ev_2, Ev_1]; + if(indexof(Str,"c")>0, + pP=pP-0.5*Ookisa*cos(Hiraki)*Ev; + ); + if(indexof(Str,"b")>0, + pP=pP-Ookisa*cos(Hiraki)*Ev; + ); + pA=pP+Ookisa*cos(Hiraki)*Ev+Ookisa*sin(Hiraki)*Nv; + pB=pP+Ookisa*cos(Hiraki)*Ev-Ookisa*sin(Hiraki)*Nv; + list=[pA,pP,pB]; + list=apply(list,LLcrd(#)); +// Out=Unscaling(Out); + list; + ); +); + +Arrowhead(point,Houkou):=Arrowhead(point,Houkou,[]); +Arrowhead(point,Houkou,options):=( +//help:Arrowhead(B,B-A,[1.5,30]); +//help:Arrowhead(A,"gr1"); + // global ArrowheadNumber + regional(name,Ltype,Noflg,reL,opstr,opcindy,ptstr,hostr,tmp,tmp1,list); + name="arh"+text(ArrowheadNumber); + ArrowheadNumber=ArrowheadNumber+1; + ptstr=textformat(point,5); + if(isstring(Houkou), // 15.01.11 + tmp=parse(Houkou); + if(MeasureDepth(tmp)<2, + hostr=Houkou; + , + hostr=Houkou+"(1)"; + ); + , + if(ispoint(point), + hostr=textformat(LLcrd(Houkou),5); + , + hostr=textformat(Houkou,5); + ); + ); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + reL=tmp_6; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + list=Arrowheaddata(point,Houkou,options); + if(Noflg<3, +// println("generate Arrowhead "+name); + tmp1=apply(list,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// GLIST=append(GLIST,name+"=Listplot("+list+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(1)+Ltype,name); + , +// if(Noflg==1,Ltype=0); + Ltype=0; + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + if(Noflg==0, + if(length(reL)<3, // 16.04.09 from + forall(1..(2-length(reL)), + opstr=opstr+",1"; + ); + tmp=PenThick/PenThickInit; + opstr=opstr+","+text(tmp); + ); // 16.04.09 upto + Com2nd("Arrowhead("+ptstr+","+hostr+opstr+")"); + ); +); + +Arrowdata(ptlist):=Arrowdata(ptlist,[]); +Arrowdata(Arg1,Arg2):=( + regional(tmp,nm,ptlist,flg,pA,pB,options); + flg=0; + if(isstring(Arg1), + nm=Arg1; + ptlist=Arg2; + Arrowdata(nm,ptlist,[]); + flg=1; + ); + if(flg==0, + tmp=MeasureDepth(Arg1); + if(tmp==0, + pA=Arg1; + pB=Arg2; + Arrowdata(pA,pB,[]); + , + ptlist=Arg1; + options=Arg2; + nm=text(ArrowlineNumber); + ArrowlineNumber=ArrowlineNumber+1; + Arrowdata(nm,ptlist,options); + ); + ); +); +Arrowdata(Arg1,Arg2,options):=( +//help:Arrowdata([A,B],[2,10]); + regional(Retflg,nm,ptlist,name,opstr,opcindy,realL,strL,size, + flg,Ltype,Noflg,lineflg,tmp,tmp1,tmp2,pA,pB,segpos); + Retflg=0; + Noflg=0; + Ltype=0; + if(!isstring(Arg1), + pA=Arg1; + pB=Arg2; + Arrowdata(pA,pB,options,"old"); + Retflg=1; + ptlist=[pA,pB]; + ); + if(Retflg==0, + nm=Arg1; + ptlist=Arg2; + name="ar"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + realL=tmp_6; + strL=tmp_7; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + size=1; // 15.06.11 + if(length(realL)>0, + size=realL_1; + ); + tmp2=select(strL,indexof(#,"l")>0); // 16.04.09 + if(length(tmp2)>0,lineflg=1,lineflg=0); // 16.04.09 + segpos=1; + tmp1=tmp_5; + if(length(tmp1)>2, + segpos=tmp1_3; + ); + if(Noflg<3, +// println("generate Arrowdata "+name); + tmp1=apply(ptlist,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=Pcrd(ptlist_1);//16.10.20 + tmp2=Pcrd(ptlist_2);//16.10.20 + if(lineflg==0, // 16.04.09 from + tmp=tmp2-0.2*size/2*(tmp2-tmp1)/|tmp2-tmp1|; // 15.06.11 + , + tmp=tmp2; + ); // 16.04.09 upto + tmp=[LLcrd(tmp1),LLcrd(tmp)];//16.10.20 + GLIST=append(GLIST,name+"=Listplot("+textformat(tmp,5)+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + tmp=textformat(ptlist,5); + tmp=substring(tmp,1,length(tmp)-1); + tmp1=indexof(tmp,"],["); + if(tmp1>0, + pA=substring(tmp,0,tmp1); + pB=substring(tmp,tmp1+1,length(tmp)); + , + tmp1=indexof(tmp,","); + pA=substring(tmp,0,tmp1-1); + pB=substring(tmp,tmp1,length(tmp)); + ); + tmp1="Lcrd("+pA+")+" + +textformat(segpos,5)+"*(Lcrd("+pB+")-"+"Lcrd("+pA+"))"; + tmp1=parse(tmp1); + tmp2="Lcrd("+pB+")-Lcrd("+pA+")"; + tmp2=parse(tmp2); + Arrowhead(tmp1,tmp2,options); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); + ptlist; +); +Arrowdata(pA,pB,options,str):=( + regional(ptA,ptB,opstr,Astr,Bstr,name,tmp,opcindy); + Astr=textformat(pA,5); + Bstr=textformat(pB,5); + name="ar"+pA.name+pB.name; + println("generate Arrow "+name); + opstr=""; + opcindy=""; + forall(options, + if(isstring(#), + if(indexof(#,"->")>0, + opcindy=opcindy+","+#; + , + tmp="'"+#+"'"; + ); + , + tmp=text(#); + ); + opstr=opstr+","+tmp; + ); + ptA=Lcrd(pA); + ptB=Lcrd(pB); + Arrowheaddata(ptB,ptB-ptA,options); + tmp="connect("+textformat([ptA,ptB],5) + +",linecolor->"+text(KCOLOR)+opcindy+");"; + parse(tmp); // 14.11.17 + Com2nd("Arrowline("+Astr+","+Bstr+opstr+")"); // 14.10.04 +); + +Anglemark(plist):=Anglemark(plist,[]); +Anglemark(Arg1,Arg2):=( // 2015.04.28 from + regional(nm,plist,options,tmp); + if(isstring(Arg1), + nm=Arg1; + plist=Arg2; + Anglemark(nm,plist,[]); + , + plist=Arg1; + options=Arg2; + tmp=textformat(plist,5); + tmp=replace(tmp,",",""); + nm=substring(tmp,1,length(tmp)-1); + Anglemark(nm,plist,options); + ); +); // upto +Anglemark(nm,plist,options):=( +//help:Anglemark([A,B,C],["E=\theta",2]); +//help:Anglemark("1",[A,B,C],["E=1.2,\theta",2]); +//help:Anglemark(options=["E/L=(sep,)letter",size]); + regional(name,Out,pB,pA,pC,Ctr,ra,sab,sac,ratio,opstr,Bname,Bpos, + Brat,tmp,tmp1,tmp2,Num,opcindy,Ltype,eqL,realL,Rg,Th,Noflg); + name="ag"+nm; + ra=0.5; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + realL=tmp_6; + Bname=""; + Brat=1.5; + Num=20; + if(length(realL)>0, + ra=realL_1*ra; + opstr=opstr+","+text(realL_1); + ); + forall(eqL, + if(substring(#,0,1)=="L",Bname="Letter("); + if(substring(#,0,1)=="E",Bname="Expr("); + Bpos="md"+name; + Bname=Bname+Bpos+","+Dq+"c"+Dq+","+Dq;//16.10.29 + tmp=substring(#,indexof(#,"="),length(#)); + tmp1=indexof(tmp,","); + Bname=Bname+substring(tmp,tmp1,length(tmp))+Dq+")"; + if(tmp1>0, + Brat=parse(substring(tmp,0,tmp1-1)); + ); + ); + pB=Lcrd(plist_1); pA=Lcrd(plist_2); pC=Lcrd(plist_3); + Ctr=Lcrd(pA); + sab=pB-pA; + sac=pC-pA; + Rg=[arctan2(sab)+0,arctan2(sac)+0]; + if(Rg_2<Rg_1,Rg_2=Rg_2+2*pi); + Out=[]; + forall(0..Num, + Th=Rg_1+#*(Rg_2-Rg_1)/Num; + Out=append(Out,Ctr+ra*[cos(Th),sin(Th)]); + ); + if(length(Bname)>0, + Th=(Rg_1+Rg_2)/2; + tmp1=Ctr+Brat*ra*[cos(Th),sin(Th)]; + tmp="Defvar("+Dq+Bpos+"="; + tmp=tmp+textformat(tmp1,5)+Dq+");"; + parse(tmp); + parse(Bname); + ); + if(Noflg<3, + println("generate anglemark "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp=textformat(plist,5); + tmp1=substring(tmp,1,length(tmp)-1); + tmp=name+"=Anglemark("+tmp1+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +Paramark(plist):=Paramark(plist,[]); +Paramark(plist,options):=( +//help:Paramark([A,B,C],["E=\theta"]); + regional(name,Out,pB,pA,pC,ra,sab,sac,ratio,opstr,Bname,Bpos, + Brat,tmp,tmp1,tmp2,Ltype,Noflg,eqL,realL,opcindy); + tmp=textformat(plist,5); + tmp=replace(tmp,",",""); + tmp=substring(tmp,1,length(tmp)-1); + name="pm"+tmp; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + realL=tmp_6; + ra=0.5; + Bname=""; + Brat=1.2; + if(length(realL)>0, + tmp=realL_1; + ra=tmp*ra; + opstr=opstr+","+text(tmp); + ); + forall(eqL, + if(substring(#,0,1)=="L",Bname="Letter("); + if(substring(#,0,1)=="E",Bname="Expr("); + Bpos="md"+name; + Bname=Bname+Dq+Bpos+Dq+","+Dq+"c"+Dq+","+Dq; + tmp=substring(#,indexof(#,"="),length(#)); + tmp1=indexof(tmp,","); + Bname=Bname+substring(tmp,tmp1,length(tmp))+Dq+")"; + if(tmp1>0, + Brat=parse(substring(tmp,0,tmp1-1)); + ); + ); + pB=Lcrd(plist_1); pA=Lcrd(plist_2); pC=Lcrd(plist_3); + Ctr=Lcrd(pA); + Out=[]; + Out=append(Out,pA+ra*(pB-pA)/|pB-pA|); + Out=append(Out,pA+ra*(pB-pA)/|pB-pA|+ra*(pC-pA)/|pC-pA|); + Out=append(Out,pA+ra*(pC-pA)/|pC-pA|); + if(length(Bname)>0, + tmp1=pA+Brat*ra*(pB-pA)/|pB-pA|+Brat*ra*(pC-pA)/|pC-pA|; + tmp="Defvar("+Dq+Bpos+"="+textformat(tmp1,5)+Dq+");"; + parse(tmp); + parse(Bname); + ); + if(Noflg<3, + println("generate paramark "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=substring(textformat(plist,5),1,length(textformat(plist,5))-1); + tmp=name+"=Paramark("+tmp1+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +MakeBowdata(pA,pB,Hgt):=( + regional(angle,pB2,pH2,pC2,pC,tmp,Th1,Th2,ra,dMA); + angle=arctan2(pB-pA)+0; + pB2=Rotatepoint(pB,-angle,pA); + tmp=Lcrd(pA); + pH2=[(tmp_1+pB2_1)/2,tmp_2-Hgt]; + dMA=|tmp-pB2|/2; + ra=(dMA^2+Hgt^2)/(2*Hgt); + pC2=[pH2_1,pB2_2+(ra-Hgt)]; + pC=Rotatepoint(pC2,angle,pA); + Th1=arctan2(pA-pC2)+angle; + Th2=arctan2(pB2-pC2)+angle; + [pC,ra,Th1,Th2]; +); + +Bowdata(nm,plist,options):=( +//help:Bowdata([C,A],[2,1.2,"Expr=10","da"]); +//help:Bowdata([A,B],["Expr=t0n3,a"]); +//help:Bowdata([A,B],["Exprrot=t0n2r,a"]); + regional(name,Out,pB,pA,pC,ra,tmp,tmp1,tmp2,Ltype,eqL,realL, + Bname,Bpos,Th,Cut,Num,Hgt,opstr,opcindy,Ydata,pC, + Th1,Th2,Noflg,Bops,Bmov,Tmov,Nmov,rev); + name="bw"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + realL=tmp_6; + pA=Lcrd(plist_1); pB=Lcrd(plist_2); + Hgt=1/2*|pB-pA|*0.2; + Cut=0; + Num=24; + Bname=""; + Tmov=0;//16.11.01from + Nmov=0; + Bmov=""; + rev=0;//16.11.01upto + if(length(realL)>0, + Hgt=realL_1*Hgt; // 15.04.12 + if(length(realL)>1,Cut=realL_2); + ); + forall(eqL, + tmp=substring(#,0,1); + if(tmp=="L" % tmp=="l", + if(indexof(#,"rot")>0, + Bname="Letterrot("; + , + Bname="Letter("; + ); + ); + if(tmp=="E" % tmp=="e", + if(indexof(#,"rot")>0, + Bname="Exprrot("; + , + Bname="Expr("; + ); + ); + tmp=indexof(#,"="); + Bops=substring(#,tmp,length(#)); // 16.11.01 + ); + Ydata=MakeBowdata(pA,pB,Hgt); + pC=Ydata_1; + ra=Ydata_2; + Th=(Ydata_3+Ydata_4)*0.5; + BOWMIDDLE=[pC_1+ra*cos(Th),pC_2+ra*sin(Th)]; + Bpos="md"+name; // 16.10.31from(moved) + tmp="Defvar("+Dq+Bpos+"="+textformat(BOWMIDDLE,5)+Dq+");"; + parse(tmp);// 16.10.31upto(moved) + if(length(Bname)>0, //16.11.01from + tmp=indexof(Bops,","); + if(tmp>0, + tmp1=substring(Bops,0,tmp-1); + if(length(tmp1)>=4 & substring(tmp1,0,1)=="t" & indexof(tmp1,"n")>0, + Bmov=tmp1; + Bops=substring(Bops,tmp,length(Bops)); + ); + ); + if(length(Bmov)>0, + tmp=indexof(Bmov,"t"); + if(tmp>0, + tmp1=indexof(Bmov,"n"); + Tmov=parse(substring(Bmov,tmp,tmp1-1)); + tmp=indexof(Bmov,"r"); + if(tmp>0, + Nmov=parse(substring(Bmov,tmp1,tmp-1)); + rev=1; + , + Nmov=parse(substring(Bmov,tmp1,length(Bmov))); + ); + ); + ); + Bname=Bname+Bpos;//16.11.01 + if(abs(Tmov)+abs(Nmov)>0, + tmp=Pcrd(pA)-Pcrd(pB); + tmp1=1/norm(tmp)*tmp; + tmp2=[-tmp1_2,tmp1_1]; + tmp=MARKLEN*(Tmov*tmp1+Nmov*tmp2); + tmp=LLcrd(tmp); + Bname=Bname+"+"+text(tmp); + ); + Bname=Bname+","; + if(indexof(Bname,"rot")>0, + if(rev==1,tmp=pB-pA,tmp=pA-pB); + Bname=Bname+textformat(tmp,5)+","; + , + Bname=Bname+Dq+"c"+Dq+","; + ); + Bname=Bname+Dq+Bops+Dq+")"; + parse(Bname); + );//16.11.01upto + if(Cut==0, + Th1=Ydata_3; + Th2=Ydata_4; + Out=[]; + forall(0..Num, + tmp=Th1+#*(Th2-Th1)/Num; + Out=append(Out,pC+ra*[cos(tmp),sin(tmp)]); + ); + , + Th1=Ydata_3; + Th2=Th-Cut/(2*ra); + tmp1=[]; + forall(0..Num/2, + tmp=Th1+#*(Th2-Th1)/(Num/2); + tmp1=append(tmp1,pC+ra*[cos(tmp),sin(tmp)]); + ); + Th1=Th+Cut/(2*ra); + Th2=Ydata_4; + tmp2=[]; + forall(0..Num/2, + tmp=Th1+#*(Th2-Th1)/(Num/2); + tmp2=append(tmp2,pC+ra*[cos(tmp),sin(tmp)]); + ); + Out=[tmp1,tmp2]; + ); + if(Noflg<3, + println("generate bowdata "+name+" and "+Bpos);//16.10.31 + if(MeasureDepth(Out)==1,Out=[Out]); + tmp1=[]; + forall(Out,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=substring(textformat(plist,5),1,length(textformat(plist,5))-1); + tmp=name+"=Bowdata("+tmp1+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); +); + +Deqplot(nm,deq,rng,initf):=Deqplot(nm,deq,rng,Lcrd(initf)_1,initf,[]); +Deqplot(nm,deq,rng,Arg1,Arg2):=( + regional(initt,initf,options); + if(isreal(Arg1) & length(Arg1)==1, + initt=Arg1; + initf=Arg2; + options=[]; + , + initf=Lcrd(Arg1); + initt=initf_1; + options=Arg2; + ); + Deqplot(nm,deq,rng,initt,initf,options); +); +Deqplot(nm,deq,rng,initt,initf,options):=( + regional(name,Noflg,Ltype,eqL,opstr,opcindy,pdL,var2,deq2,rng2,initt2,initf2, + tmp,tmp1,tmp2,tmp3,tmp4); + tmp=tokenize(deq,"="); + tmp1=tmp_1; + tmp2=tmp_2; + tmp3=tokenize(tmp1,"`"); + if(length(tmp3)==2, + if(indexof(tmp1,"[")>0, + Deqplot(nm,deq,rng,initt,initf,options,[2,3]); + , + if(indexof(rng,"=")>0,rng2=rng,rng2=rng+"=[XMIN,XMAX]"); + tmp=tokenize(rng2,"="); + deq2="["+tmp_1+","+replace(tmp1,"`","]")+"`=[1,"+tmp2+"]"; + rng2="t="+tmp_2; + if(isreal(initf) & length(initf)==1, + initf2=[initt,initf]; + initt2=initt; + , + initf2=Lcrd(initf)); + initt2=initf2_1; + Deqplot(nm,deq2,rng2,initt2,initf2,options,[2,3]); + ); + , + name="de"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + eqL=tmp_5; + opcindy=tmp_9; + opstr=""; + forall(eqL, + if(Toupper(substring(#,0,1))=="N", + tmp=indexof(#,"="); + tmp1="N="+substring(#,tmp,length(#)); + opstr=opstr+",'"+tmp1+"'"; + ); + ); + if(Noflg<1, + if(indexof(rng,"=")>0,rng2=rng,rng2=rng+"=[XMIN,XMAX]"); + var2="d"+tmp3_1; + deq2="["+tmp3_1+","+var2+"]`=["; + tmp=replace(tmp2,tmp3_1+"`",var2); + deq2=deq2+var2+","+tmp+"]"; + Deqplot(nm,deq2,rng2,initt,initf,append(options,"nodisp"),[1,2]); + parse(tmp); + tmp=name+"=Deqplot(Assign("+Dq+deq+Dq+"),'"+rng+"',"; + tmp=tmp+initt+","+initf+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + parse("de"+nm); + ); + ); +); +Deqplot(nm,deq,rng,initt,initf,options,Sel):=( +//help:Deqplot("2","y`=y*(1-y)","x",0, 0.5,["Num=100"]); +//help:Deqplot("1","y``=-y","x",0, [1,0]); +//help:Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",[1,0.5]); + regional(Ltype,Noflg,Inflg,Outflg,strL,opstr,opcindy,Num, + outstr,name,func,xf,yf,pdL,Eps,Inf,t1,t2,tt,Vname,dt,funP,funN,flg, + kl1,kl2,kl3,kl4,x0,y0,x1,y1,tmp,tmp1,tmp2); + name="de"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + Inflg=tmp_3; + Outflg=tmp_4; + eqL=tmp_5; + strL=tmp_7; +// opstr=tmp_(length(tmp)-1); + opstr=""; + opcindy=tmp_(length(tmp)); + outstr=""; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="S", + outstr="Sci"; + ); + ); + Num=50; + forall(eqL, + tmp=indexof(#,"="); + tmp2=substring(#,0,1); + tmp2=Toupper(tmp2); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+tmp2+"="+tmp1+"'"; + if(Toupper(substring(#,0,1))=="N", + Num=parse(tmp1); + ); + ); + if(outstr=="Sci", + if(Inflg==0 & Outflg==0,Outflg=1;Inflg=1); + ); + if(Noflg<3, + if(outstr=="Sci", + if(Outflg==1, + println("Output Deqplot "+name); + SCIWRLIST=append(SCIWRLIST,name); + ); + if(Inflg==1, + println("Input Deqplot "+name); + if(length(SCIRELIST)==0, + ReadOutData(Fnameout); + ); + tmp=parse(name); + if(islist(tmp), + Extractdata(name,["nodisp"]); // 12.19 + ); + SCIRELIST=append(SCIRELIST,name); + ); + , + Eps=10^(-3); + Inf=10^3; + tmp=tokenize(deq,"="); + tmp1=tmp_1; + func=tmp_2; + tmp=indexof(tmp1,","); + xf=substring(tmp1,1,tmp-1); + yf=substring(tmp1,tmp,length(tmp1)); + tmp=indexof(yf,"]"); + yf=substring(yf,0,tmp-1); + tmp=tokenize(rng,"="); + Vname=tmp_1; + tmp=parse(tmp_2); + t1=tmp_1; + t2=tmp_2; + tmp="funP("+Vname+","+xf+","+yf+"):="+func+";"; + parse(tmp); + tmp=tokenize(func,","); + tmp1="-("+substring(tmp_1,1,length(tmp_1))+")"; + tmp2="-("+substring(tmp_2,0,length(tmp_2)-1)+")"; + tmp="funN("+Vname+","+xf+","+yf+"):=["+tmp1+","+tmp2+"];"; + parse(tmp); + dt=(t2-t1)/Num; + tt=initt; + tmp=Lcrd(initf); + x0=tmp_1; + y0=tmp_2; + pdL=[[tt,x0,y0]]; + flg=0; + forall(1..floor((t2-initt)/dt), + if(flg==0, + kl1=dt*funP(tt,x0,y0); + kl2=dt*funP(tt+dt/2,x0+kl1_1/2,y0+kl1_2/2); + kl3=dt*funP(tt+dt/2,x0+kl2_1/2,y0+kl2_2/2); + kl4=dt*funP(tt+dt,x0+kl3_1,y0+kl3_2);//16.10.14 + tmp1=[x0,y0]+(kl1+2*kl2+2*kl3+kl4)/6; + x0=tmp1_1; + y0=tmp1_2; + tt=initt+#*dt; + pdL=append(pdL,[tt,x0,y0]); + if(|tmp1|>Inf,flg=1); + ); + ); + tt=initt; + tmp=Lcrd(initf); + x0=tmp_1; + y0=tmp_2; + flg=0; + forall(1..floor((initt-t1)/dt), + if(flg==0, + kl1=dt*funN(tt,x0,y0); + kl2=dt*funN(tt+dt/2,x0+kl1_1/2,y0+kl1_2/2); + kl3=dt*funN(tt+dt/2,x0+kl2_1/2,y0+kl2_2/2); + kl4=dt*funN(tt+dt/2,x0+kl3_1/2,y0+kl3_2/2); + tmp1=[x0,y0]+(kl1+2*kl2+2*kl3+kl4)/6; + x0=tmp1_1; + y0=tmp1_2; + tt=initt-#*dt; + pdL=prepend([tt,x0,y0],pdL); + if(|tmp1|>Inf,flg=1); + ); + ); + println("Generate Deqplot "+name); + pdL=apply(pdL,#_Sel); + tmp1=apply(pdL,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + ); + if(Noflg<1, + tmp=name+"=Deqplot(Assign("+Dq+deq+Dq+"),'"+rng+"',"; + tmp=tmp+initt+","+initf+opstr+")"; + GLIST=append(GLIST,tmp); + ); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + if(outstr=="Sci", + if(Inflg==1, + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + , + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + pdL; + ); + ); +); + +Enclosing(nm,plist):=EnclosingS(nm,plist); +Enclosing(nm,plist,options):=EnclosingS(nm,plist,options); +EnclosingS(nm,plist):=EnclosingS(nm,plist,[]); +EnclosingS(nm,plist,options):=( +//help:Enclosing("1",["sc2","crAB","sc2","Invert(sc1)"],[pt,"dr"]); + regional(name,AnsL,Start,Eps,EEps,S,Flg,Fdata,Gdata,KL,pt,qt, + t1,t2,t3,ii,nn,tmp,tmp1,tmp2,Ltype,Noflg,realL,eqL,opstr,opcindy); + name="en"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + eqL=tmp_5; + realL=tmp_6; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + Eps=10^(-3); + EEps=0.1; + Start=[]; + Flg=0; + forall(realL, + if(isList(#) % ispoint(#), + Start=Lcrd(#); // 15.09.12 + , + Flg=Flg+1; + if(Flg==1,Eps=#); + if(Flg==2,EEps=#); + ); + ); +// tmp1=concat([Eps,EEps],eqL); // 15.04.06 + Fdata=plist_1; + Gdata=plist_(length(plist)); + KL=IntersectcrvsPp(Fdata,Gdata); + if(length(KL)==1, + pt=KL_1_1; + t1=KL_1_2; + ); + if(length(KL)==0, + if(Numptcrv(Fdata)>Numptcrv(Gdata), + tmp=Nearestpt(Fdata,Gdata); + pt=tmp_1; + t1=tmp_2; + , + tmp=Nearestpt(Gdata,Fdata); + pt=tmp_3; + t1=tmp_4; + ); + ); + if(length(KL)>1, + if(Start==[], + err("No Start Point"); + , + pt=KL_1_1; + t1=KL_1_2; + tmp=|pt-Start|; + forall(2..length(KL),ii, // 15.04.20 + tmp1=KL_ii_1; + tmp2=|tmp1-Start|; // 15.04.20 + if(tmp2<tmp, + pt=tmp1; + t1=KL_ii_2; + tmp=tmp2; + ); + ); + ); + ); +// pt=Pcrd(pt); // 15.09.12 + Start=pt; + AnsL=[]; + forall(1..length(plist),nn, + Fdata=plist_nn; + if(nn>1, pt=qt); + if(nn==length(plist), + qt=Start; + , + Flg=0; + Gdata=plist_(nn+1); +// tmp1=concat([Eps,EEps],eqL); // 15.04.06 + KL=IntersectcrvsPp(Gdata,Fdata); + if(length(KL)==1, + tmp=KL_1; + qt=KL_1_1; + t3=KL_1_2; + Flg=10; + ); + if(length(KL)==0,Flg=1); + if(length(KL)>1, + tmp1=KL_1_1; + tmp2=KL_2_1; + tmp=|tmp1-tmp2|; + if(tmp<Eps*10, Flg=1); + ); + if(Flg==1, + if(Numptcrv(Fdata)>Numptcrv(Gdata), + tmp=Nearestpt(Fdata,Gdata); + qt=tmp_1; + t3=tmp_4; + Flg=10; + , + tmp=Nearestpt(Gdata,Fdata); + qt=tmp_3; + t3=tmp_2; + Flg=10; + ); + ); + if(Flg<10, + t2=10^6; //%inf; + forall(1..length(KL),ii, + tmp1=KL_ii_1; + tmp=KL_ii_3; + tmp2=ParamonCurve(tmp1,tmp,Fdata); + tmp3=KL_ii_2; + if(tmp2>t1+Eps & tmp2<t2+Eps, + qt=tmp1; + t2=tmp2; + t3=tmp3; + ); + ); + ); + ); + tmp=Partcrv("",pt,qt,Fdata,["nodata"]); + t1=t3; + if(nn==1, + AnsL=tmp; + , + AnsL=concat(AnsL,tmp_(2..length(tmp))); + ); + ); + AnsL=apply(AnsL,Pcrd(#)); // 15.09.12 + AnsL_(length(AnsL))=AnsL_1;//16.10.20 + if(Noflg<3, + println("generate Enclosing "+name); + tmp=name+"="+textformat(AnsL,5); + parse(tmp); +// tmp=name+"=Enclosing(";//16.10.20from +// tmp1="list("; +// forall(plist, +// tmp1=tmp1+#+","; +// ); +// tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; + tmp=apply(AnsL,LLcrd(#)); + tmp=name+"=Listplot("+textformat(tmp,5)+")";//16.10.20upto + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + tmp=apply(AnsL,LLcrd(#));//16.10.20 + tmp; +); + +Shade(plist):=Shade(plist,[]); +Shade(plist,options):=( +//help:Shade(["gr2","sg1"],[0.5]); +//help:Shade([pointlist],[0.5]); + regional(tmp,tmp1,tmp2,opstr,opcindy,Str,G2,flg); + if(isstring(plist_1), // 16.01.24 + println("output Shade of "+plist); + , + println("output Shade of lists"); + ); + tmp=Divoptions(options); + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + flg=0; + forall(plist, + if(flg==0, + if(isstring(#),tmp=parse(#),tmp=#); // from 16.01.24 + if(!islist(tmp),flg=1); upto + ); + ); + if(flg==1, +// err("some data not defined yet"); + , + G2=Joincrvs("1",plist,["nodata"]); + G2=apply(G2,Pcrd(#)); + tmp1="fillpoly("+textformat(G2,5)+opcindy+");"; + parse(tmp1); + ); + Str="Shade("; + tmp1="list("; + forall(plist, + if(isstring(#), // from 16.01.24 + if(length(#)>1, + tmp1=tmp1+#+","; + , + tmp1=tmp1+Dq+#+Dq+","; + ); + , + tmp1=tmp1+"Listplot("+textformat(#,5)+"),"; + ); // upto 16.01.24 + ); + Str=Str+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; + Com2nd(Str); +); + + +//help:start(); + +Rotatepoint(point,Theta,ctr):=( +//help:Rotatepoint(A,2*pi/3,B); + regional(X1,X2,Y1,Y2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + tmp=Lcrd(ctr); + Cx=tmp_1; Cy=tmp_2; + X2=Cx+(X1-Cx)*cos(Theta)-(Y1-Cy)*sin(Theta); + Y2=Cy+(X1-Cx)*sin(Theta)+(Y1-Cy)*cos(Theta); + [X2,Y2]; +); + +Translatepoint(point,mov):=( +//help:Translatepoint(A,[2,3]); + regional(X1,X2,Y1,Y2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + tmp=Lcrd(mov); + Cx=tmp_1; Cy=tmp_2; + X2=X1+Cx; + Y2=Y1+Cy; + [X2,Y2]; +); + +Scalepoint(point,ratio,center):=( +//help:Scalepoint(A,[3,2],[0,0]); + regional(X1,X2,Y1,Y2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + tmp=Lcrd(center); + Cx=tmp_1; Cy=tmp_2; + X2=Cx+ratio_1*(X1-Cx); + Y2=Cy+ratio_2*(Y1-Cy); + [X2,Y2]; +); + +Reflectpoint(point,symL):=( +//help:Reflectpoint(A,B); +//help:Reflectpoint(A,[[2,3]]); +//help:Reflectpoint(A,[C,E]);\\ + regional(X1,X2,Y1,Y2,Us,Vs,Pt1,Pt2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + Pt1=Lcrd(symL_1); + if(length(symL)==1, + Pt2=Pt1; + , + Pt2=Lcrd(symL_2); + ); + Us=Pt2_1-Pt1_1; + Vs=Pt2_2-Pt1_2; + if(Pt1==Pt2, + X2=2*Pt1_1-X1; + Y2=2*Pt1_2-Y1; + , + X2=(Us^2-Vs^2)/(Us^2+Vs^2)*X1+2*Us*Vs/(Us^2+Vs^2)*Y1 + -2*Vs*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + Y2=2*Us*Vs/(Us^2+Vs^2)*X1-(Us^2-Vs^2)/(Us^2+Vs^2)*Y1 + +2*Us*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + ); + [X2,Y2]; +); + +Rotatedata(nm,plist,Theta):=Rotatedata(nm,plist,Theta,[]); +Rotatedata(nm,plist,angle,options):=( +//help:Rotatedata("1","crAB",pi/3,[[1,5],"dr,2"]); + regional(tmp,tmp1,tmp2,pdata,Theta,Pt,Cx,Cy,PdLL,PdL, + opcindy,Nj,Njj,Kj,Mj,X1,Y1,X2,Y2,Ltype,Noflg,name); + name="rt"+nm; + Pt=[0,0]; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + tmp1=tmp_6; + if(length(tmp1)>0,Pt=Lcrd(tmp1_1)); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + if(isstring(angle),Theta=parse(angle),Theta=angle); + Cx=Pt_1; Cy=Pt_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X1=tmp_1; + Y1=tmp_2; + X2=Cx+(X1-Cx)*cos(Theta)-(Y1-Cy)*sin(Theta); + Y2=Cy+(X1-Cx)*sin(Theta)+(Y1-Cy)*cos(Theta); + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate Rotatedata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// tmp1=textformat(plist,5); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=Rotatedata("+tmp1+"," + +textformat(angle,5)+","+textformat(Pt,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +translatedata(nm,plist,mov):=translatedata(nm,plist,mov,[]); +translatedata(nm,plist,mov,options):=( +//help:translatedata("1",["gr1"],[1,2]); + regional(tmp,tmp1,tmp2,pdata,Cx,Cy,PdL,Nj,Njj,Kj, + opcindy,X2,Y2,Ltype,Noflg,name); + name="tr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + tmp=Lcrd(mov); + Cx=tmp_1; Cy=tmp_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X2=tmp_1+Cx; + Y2=tmp_2+Cy; + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate translatedata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// tmp1=textformat(plist,5); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=translatedata("+tmp1+","+textformat(mov,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +Scaledata(nm,plist,ratioV):=( + regional(tmp); + tmp=Lcrd(ratioV); + Scaledata(nm,plist,tmp_1,tmp_2,[]); +); +Scaledata(nm,plist,Arg1,Arg2):=( +//help:Scaledata("1","crAB",3,2,[[0,0]]); + regional(tmp,options); + if(islist(Arg2), + tmp=Lcrd(Arg1); + options=Arg2; + Scaledata(nm,plist,tmp_1,tmp_2,options); + , + Scaledata(nm,plist,Arg1,Arg2,[]); + ); +); +Scaledata(nm,plist,rx,ry,options):=( + regional(tmp,tmp1,tmp2,pdata,Theta,Pt,Cx,Cy,PdL, + opcindy,Nj,Njj,Kj,X2,Y2,Ltype,Noflg,name); + name="sc"+nm; + Pt=[0,0]; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + tmp1=tmp_6; + if(length(tmp1)>0, + Pt=Lcrd(tmp1_1); + ); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + Cx=Pt_1; Cy=Pt_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X2=Cx+rx*(tmp_1-Cx); + Y2=Cy+ry*(tmp_2-Cy); + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate Scaledata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=Scaledata("+tmp1+"," + +textformat(rx,5)+","+textformat(ry,5)+","+textformat(Pt,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +Reflectdata(nm,plist,symL):=Reflectdata(nm,plist,symL,[]); +Reflectdata(nm,plist,symL,options):=( +//help:Reflectdata("1","crAB",[C]); + regional(tmp,tmp1,tmp2,pdata,Us,Vs,Pt1,Pt2,Cx,Cy,PdL, + opcindy,Nj,Njj,Kj,X1,Y1,X2,Y2,Ltype,Noflg,name); + name="re"+nm; + Pt=[0,0]; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + Pt1=Lcrd(symL_1); + if(length(symL)==1, + Pt2=Pt1; + , + Pt2=Lcrd(symL_2); + ); + Us=Pt2_1-Pt1_1; + Vs=Pt2_2-Pt1_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X1=tmp_1; + Y1=tmp_2; + if(Pt1==Pt2, + X2=2*Pt1_1-X1; + Y2=2*Pt1_2-Y1; + , + X2=(Us^2-Vs^2)/(Us^2+Vs^2)*X1+2*Us*Vs/(Us^2+Vs^2)*Y1 + -2*Vs*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + Y2=2*Us*Vs/(Us^2+Vs^2)*X1-(Us^2-Vs^2)/(Us^2+Vs^2)*Y1 + +2*Us*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + ); + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate Reflectdata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// tmp1=textformat(plist,5); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=Reflectdata("+tmp1+","+textformat(symL,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +Mksegments():=Mksegments([]); +Mksegments(options):=( +//help:Mksegments(); + regional(segstr,p,q,r,tmp1,tmp2,tmp3); + forall(allsegments(),seg, + str=text(inspect(seg,"definition")); + tmp1=indexof(str,"("); + tmp2=indexof(str,";"); + tmp3=indexof(str,")"); + p=substring(str,tmp1,tmp2-1); + q=substring(str,tmp2,tmp3-1); + Listplot([parse(p),parse(q)]); + ); +); + +Mkcircles():=Mkcircles([]); +Mkcircles(options):=( +//help:Mkcircles(): + regional(seg,cir,str,p,q,r,tmp1,tmp2,tmp3,tmp4); + forall(allcircles(),cir, + str=text(inspect(cir,"definition")); + tmp1=indexof(str,"("); + tmp2=indexof(str,";"); + tmp3=indexof(str,")"); + tmp4=indexof(str,";",tmp2+1); + if(tmp4==0, + p=substring(str,tmp1,tmp2-1); + q=substring(str,tmp2,tmp3-1); + Circledata([parse(p),parse(q)]); + , + p=substring(str,tmp1,tmp2-1); + q=substring(str,tmp2,tmp4-1); + r=substring(str,tmp4,tmp3-1); + Circledata([parse(p),parse(q),parse(r)]); + ); + ); +); + +Makesciarg(arglist):=( + regional(str,tmpstr); + str=""; + forall(arglist, + if(isstring(#), + tmpstr=Dq+#+Dq; + , + tmpstr=textformat(#,5); + ); + str=str+tmpstr+","; + ); + str=substring(str,0,length(str)-1); + str; +); + +Setax(arglist):=( +//help:Setax(["l","x","e","y","n","O","sw"]); +//help:Setax([7,"nw"]); + regional(tmp); + tmp=Makesciarg(arglist); + Com1st("Setax("+tmp+")"); +); + +Htickmark(arglist):=( +//help:Htickmark([1,"1",2,"sw","2"]); + regional(tmp); + tmp=""; + tmp=Makesciarg(arglist); + Com2nd("Htickmark("+tmp+")"); +); + +Vtickmark(arglist):=( +//help:Vtickmark([1,"1",2,"sw","2"]); + regional(tmp); + tmp=Makesciarg(arglist); + Com2nd("Vtickmark("+tmp+")"); +); + +Drwxy():=( +//help:Drwxy(); + Com2nd("Drwxy()"); + Addax(0); // 16.01.21 +); + +Drwpt(pstr):=Drawpoint(pstr); +Drwpt(ptlist,nn):=( // 16.03.05 from +//help:Drwpt(A); +//help:Drwpt("[1,1],0"); +//help:Drwpt(A,0); +//help:Drwpt([1,2],0); + Drawpoint(ptlist,nn); +); +Drawpoint(pstr):=( + if(isstring(pstr), + println("Drwpt : "+pstr); + Com2nd("Drwpt("+pstr+")"); + , + Drawpoint(pstr,1); + ); +); +Drawpoint(ptlistorg,nn):=( + regional(ptlist,thick,tmp,tmp1); + println("Drwpt : "+text(ptlistorg)); + if(islist(ptlistorg), + if(MeasureDepth(ptlistorg)==1, + ptlist=ptlistorg + , + ptlist=[ptlistorg] + ); + , + ptlist=[ptlistorg] + ); + thick=PenThick/PenThickInit;// 16.04.09 from + tmp1=max(TenSize/TenSizeInit,1)/8; + Setpen(tmp1); // 16.04.09 upto + forall(ptlist, + tmp=textformat(#,5)+","+text(nn); + Com2nd("Drwpt("+tmp+")"); // 16.04.09 + ); + Setpen(thick); // 16.04.09 +);// 16.03.05 upto + +Addax(param):=( +//help:Addax(0); + ADDAXES=text(param); +); + +Expr(Pt,Dr,St):=Expr([Pt,Dr,St]); +Expr(list):=Expr(list,[]); +Expr(listorg,options):=( //16.10.09 +//help:Expr([A,"e","f(x)=x^2"]); + regional(list,str,tmp,tmp1,tmp2); + list=listorg; + forall(1..round(length(list)/3), + str=list_(3*#); + if(!isstring(str),str=format(str,5)); + str="$"+str+"$"; + list_(3*#)=str; + ); + Letter(list,options); +); + +Letter(Pt,Dr,St):=Letter([Pt,Dr,St]); +Letter(list):=Letter(list,[]); +Letter(list,options):=( +//help:Letter([C,"c","Graph of f(x)"]); + regional(Nj,Pos,Dir,Str,Off,Dmv,Xmv,Ymv,Noflg,opcindy, + opL,aln,sz,clr,bld,ita,tmp,tmp1,tmp2); + tmp=Divoptions(options); + Noflg=tmp_2; + opL=select(options,indexof(#,"->")>0); //16.10.09from + tmp=select(opL,indexof(#,"color")); + size=12; + clr=[0,0,0]; + bld=false; + ita=false; + aln="left"; + forall(opL, + tmp=indexof(#,"->"); + tmp1=removespace(substring(#,0,tmp-1)); + tmp2=substring(#,tmp+1,length(#)); + if(tmp1=="size",sz=parse(tmp2)); + if(tmp1=="color",clr=parse(tmp2)); + if(tmp1=="bold",bld=parse(tmp2)); + if(tmp1=="ita",ita=parse(tmp2)); + );//16.10.09upto + Off=-4; + Dmv=8; + Nj=1; + while(Nj+2<=length(list), +// Pos=textformat(list_Nj,5); + Pos=list_Nj; + Dir=list_(Nj+1); + tmp=indexof(Dir,"s")+indexof(Dir,"n");//16.10.19from + if(tmp>0, + tmp=indexof(Dir,"w")+indexof(Dir,"e"); + if(tmp==0, + Dir="c"+Dir;//16.10.08 + ); + );//16.10.19upto + Str=list_(Nj+2); + if(!isstring(Str),Str=format(Str,5)); // 16.09.30,10.09 + tmp=replace(Str,".xy",""); + tmp=replace(tmp,".x","(1)"); + Str=replace(tmp,".y","(2)"); + if(indexof(Str,"`")>0, +// tmp=Dq+",Assign('"+Str+"','`',Prime()))"; + tmp=Dq+",Assign('"+Str+"'))"; // 15.02.22 + , + tmp=Dq+","+Dq+Str+Dq+")"; + ); + if(Noflg==0, + Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10 + ); + if(Noflg<2, + Xmv=0;//16.10.13 + Ymv=-4; + if(indexof(Dir,"n")>0, + Ymv=Dmv/2; + ); + if(indexof(Dir,"s")>0, + Ymv=-Dmv*3/2;//16.10.13 + ); + if(indexof(Dir,"e")>0, + Xmv=Dmv/2; + Off=0; + aln="left"; + ); + if(indexof(Dir,"w")>0, + Xmv=-Dmv/2; + Off=0; // 16.09.30from + aln="right"; + ); + if(indexof(Dir,"c")>0, + Xmv=0;//16.10.13 + Off=0; + if(Ymv==0,Ymv=-4);//16.10.08 + aln="mid"; // 16.09.30upto + ); + drawtext(Pcrd(Pos),Str,offset->[Off+Xmv,Off+Ymv], + size->sz,color->clr,align->aln,bold->bld,italics->ita);//16.10.09 + ); + Nj=Nj+3; + ); +); + +Letterrot(pt,dir,str):=Letterrot(pt,dir,0,0,str); +Letterrot(pt,dir,movstr,str):=( +//help:Letterrot(C,B-A,"AB"): +//help:Letterrot(C,B-A,0,5,"AB"): +//help:Letterrot(C,B-A,"t0n5","AB"): + regional(tmov,nmov,tmp,tmp1,tmp2); + tmp1=indexof(movstr,"t"); + tmp2=indexof(movstr,"n"); + if(tmp1>0, + if(tmp2>0,tmp=tmp2-1,tmp=length(movstr)); + tmov=parse(substring(movstr,tmp1,tmp)); + , + tmov=0; + ); + if(tmp2>0, + nmov=parse(substring(movstr,tmp2,length(movstr))); + , + nmov=0; + ); + Letterrot(pt,dir,tmov,nmov,str); +); +Letterrot(pt,dir,tmov,nmov,str):=( + Letter([pt,"c",str],["notex"]); + Com2nd("Letterrot("+pt+","+dir+","+tmov+","+nmov+",'"+str+"')"); +); + +Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str); +Exprrot(pt,dir,movstr,str):=( +//help:Exprrot(C,B-A,"d"): +//help:Exprrot(C,B-A,0,5,"d"): +//help:Exprrot(C,B-A,"t0n5","d"): + regional(tmov,nmov,tmp,tmp1,tmp2); + tmp1=indexof(movstr,"t"); + tmp2=indexof(movstr,"n"); + if(tmp1>0, + if(tmp2>0,tmp=tmp2-1,tmp=length(movstr)); + tmov=parse(substring(movstr,tmp1,tmp)); + , + tmov=0; + ); + if(tmp2>0, + nmov=parse(substring(movstr,tmp2,length(movstr))); + , + nmov=0; + ); + Exprrot(pt,dir,tmov,nmov,str); +); +Exprrot(pt,dir,tmov,nmov,str):=( + Expr([pt,"c",str],["notex"]); + Com2nd("Exprrot("+pt+","+dir+","+tmov+","+nmov+",'"+str+"')"); +); + +Slider(ptstr,p1,p2):=( //17.04.11 +//help:Slider("A-C-B",[-3,0],[3,0]); + regional(pA,pB,pC,seg,sname,Alpha,tmp,tmp1); + tmp=indexall(ptstr,"-"); + pA=substring(ptstr,0,tmp_1-1); + pC=substring(ptstr,tmp_1,tmp_2-1); + pB=substring(ptstr,tmp_2,length(ptstr)); + seg=pA+pB; + Alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + sname=""; + forall(1..(length(seg)), + tmp=substring(seg,#-1,#); + tmp1=indexof(Alpha,tmp); + if(tmp1>0, + sname=sname+unicode(text(tmp1+96),base->10); + , + sname=sname+tmp; + ); + ); + Putpoint(pA,p1); + Putpoint(pB,p2); + Listplot([parse(pA),parse(pB)],["notex","color->[0,0.4,0.4]","size->2"]); +// create([sname],"Segment",[parse(pA),parse(pB)]); +// tmp2=Listplot("",[p1,p2],["nodata"]); + Putonseg(pC,parse("sg"+pA+pB)); +// create([pC],"PointOn",[parse(sname),0.5]); +); + +Putpoint(name,Pt):=Putpoint(name,Pt,Pt); +Putpoint(name,Ptinit,Pt):=( +//help:Putpoint("A",[1,2],[1,A.y]); + regional(ptstr); + ptstr=apply(allpoints(),#.name); + if(!contains(ptstr,name), + createpoint(name,Pcrd([Ptinit_1,Ptinit_2])); + , + ptstr=name+".xy="+textformat(Pcrd(Pt),5); + parse(ptstr); + ); +); + +Bezierpt(t,ptlist,ctrlist):=( + regional(flg3,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9); + p0=ptlist_1; + p3=ptlist_2; + p1=ctrlist_1; + if(length(ctrlist)==1, + p2=p3; + flg3=0; + , + p2=ctrlist_2; + flg3=1; + ); + if(length(p0)<3, // 15.02.08 + p0=Lcrd(p0); + p3=Lcrd(p3); + p1=Lcrd(p1); + p2=Lcrd(p2); + ); + p4=(1-t)*p0+t*p1; + p5=(1-t)*p1+t*p2; + p6=(1-t)*p2+t*p3; + p7=(1-t)*p4+t*p5; + p8=(1-t)*p5+t*p6; + p9=(1-t)*p7+t*p8; + if(flg3==0,p7,p9); +); + +Bezier(ptctrlist):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,[]); +Bezier(ptctrlist,options):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,options); +Bezier(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); +Bezier(nm,ptlist,ctrlist,options):=BezierCurve(nm,ptlist,ctrlist,options); +BezierCurve(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); +BezierCurve(nm,ptlistorg,ctrlistorg,options):=( +//help:Bezier("1",[A,D],[B,C]); +//help:Bezier(options=["Num=10"]); + regional(name,Ltype,Noflg,opstr,opcindy,Num, + ptlist,ctrlist,tmp,tmp1,tmp2,ii,st,out,list); + name="bz"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + Num=10; + tmp1=tmp_5; + forall(tmp1, // 14.12.31 + if(substring(#,0,1)=="N", + tmp2=indexof(#,"="); + Num=parse(substring(#,tmp2,length(#))); + opstr=opstr+","+Dq+#+Dq; + ); + ); + ptlist=apply(ptlistorg,Lcrd(#)); // 16.08.16 + ctrlist=[]; // 14.12.31 + if(length(ctrlistorg)==length(ptlist)-1, + forall(ctrlistorg,tmp1, + if(MeasureDepth(tmp1)==0,tmp=[tmp1],tmp=tmp1); + tmp=apply(tmp,Lcrd(#)); // 16.08.16 + ctrlist=append(ctrlist,tmp); + ); + , + forall(1..(length(ptlist)-1),ii, + tmp=ctrlistorg_((2*ii-1)..(2*ii)); + tmp=apply(tmp,Lcrd(#)); // 16.08.16 + ctrlist=append(ctrlist,tmp); + ); + ); + if(!islist(Num), + Num=apply(ctrlist,Num); + ); + list=[]; + forall(1..(length(ptlist)-1),ii, + tmp1=ptlist_(ii..(ii+1)); + tmp2=ctrlist_ii; + if(ii==1,st=0,st=1); + forall(st..Num_ii, + tmp=Bezierpt(#/Num_ii,tmp1,tmp2); + list=append(list,tmp); + ); + ); + if(Noflg<3, + println("generate Bezier "+name); + out=apply(list,Pcrd(#)); + tmp=name+"="+textformat(out,5); + parse(tmp); + tmp1=textformat(ptlist,5); + tmp1="list("+substring(tmp1,1,length(tmp1)-1)+")"; + tmp2=textformat(ctrlist,5); + tmp2="list("+substring(tmp2,1,length(tmp2)-1)+")"; + GLIST=append(GLIST,name+"=Bezier("+tmp1+","+tmp2+opstr+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + list; +); + +Readcsvsla(fname):=Readplotdigdata(fname,[]); +Readcsvsla(fname,options):=Readplotdigdata(fname,options); +Readplotdigdata(fname):=Readplotdigdata(fname,[]); +Readplotdigdata(fname,options):=( + regional(fsc,mv,cmdall,dataL,nd,npt,ptdata,ii,tmp,tmp1,tmp2,tmp3); + tmp=Divoptions(options); + tmp1=tmp_6; + sc=1;//10; + mv=[0,0];//[5,5]; + forall(tmp1, + if(!islist(#),sc=#,mv=#); + ); + if(indexof(fname,".")>0, + tmp=load(fname); + , + tmp=load(fname+".txt"); + ); + cmdall=tokenize(tmp,"//"); + dataL=[]; + forall(2..length(cmdall),ii, + tmp1=parse("["+cmdall_ii+"]"); + dataL=append(dataL,tmp1); + ); + if(length(dataL_(length(dataL)))<2, + dataL=dataL_(1..(length(dataL)-1)); + ); + nd=length(dataL_1)/2; + npt=length(dataL); + ptdata=[]; + forall(1..nd,ii, + tmp3=[]; + forall(1..npt, + tmp1=dataL_#_(2*ii-1); + tmp2=dataL_#_(2*ii); + if(isreal(tmp1), + tmp3=append(tmp3,[tmp1,tmp2]); + ); + ); + ptdata=append(ptdata,tmp3); + ); + tmp1=[]; + forall(ptdata, + tmp=#/sc; + tmp=translatedata("1",[tmp],-mv,["nodata"]); + tmp1=append(tmp1,tmp); + ); + ptdata=tmp1; + ptdata; +); + +Putbezierdata(name,ptL):=Putbezierdata(name,ptL,[]); +Putbezierdata(name,ptL,options):=( + regional(psize,Deg,tmp,tmp1,tmp2,p1,p2,pts,ctrs); + tmp=Divoptions(options); + psize=3; + Deg=3; + tmp1=tmp_5; + forall(tmp1, + if(substring(#,0,1)=="D", + tmp=indexof(#,"="); + Deg=parse(substring(#,tmp,length(#))); + ); + if(substring(#,0,1)=="S", + tmp=indexof(#,"="); + psize=parse(substring(#,tmp,length(#))); + ); + ); + pts=[]; + ctrs=[]; + forall(1..length(ptL), + p2=ptL_#; // 16.08.16 + if(ispoint(p2), + tmp1=text(p2); + , + tmp1=name+text(#); + Putpoint(tmp1,p2,Lcrd(parse(tmp1))); // 16.08.16 + ); + inspect(parse(tmp1),"ptsize",psize); + pts=append(pts,parse(tmp1)); + inspect(parse(tmp1),"color",4); + if(#>1, + p1=Lcrd(ptL_(#-1)); // 16.08.16 + p2=Lcrd(ptL_#); // 16.08.16 + if(Deg==3, + tmp=(2*p1+p2)/3; + tmp1=name+"p"+text(#-1); + Putpoint(tmp1,tmp,Lcrd(parse(tmp1))); // 16.08.16 + inspect(parse(tmp1),"labeled",false); //15.01.22 + Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 + inspect(parse(tmp1),"ptsize",psize); + inspect(parse(tmp1),"color",3); + tmp=(p1+2*p2)/3; + tmp2=name+"q"+text(#-1); + Putpoint(tmp2,tmp,Lcrd(parse(tmp2))); // 16.08.16 + inspect(parse(tmp2),"labeled",false); //15.01.22 + Letter([parse(tmp2),"ne",tmp2],["notex"]); //15.01.22 + inspect(parse(tmp2),"ptsize",psize); + inspect(parse(tmp2),"color",3); + ctrs=append(ctrs,[parse(tmp1),parse(tmp2)]); + , + tmp=(p1+p2)/2; + tmp1=name+"p"+text(#-1); + Putpoint(tmp1,tmp,Lcrd(parse(tmp1))); // 16.08.16 + inspect(parse(tmp1),"labeled",false); //15.01.22 + Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 + inspect(parse(tmp1),"ptsize",psize); + inspect(parse(tmp1),"color",3); + ctrs=append(ctrs,[parse(tmp1)]); + ); + ); + ); + [pts,ctrs,name]; +); + +Bezierstart(n):=( // 2016.02.26 + BezierNumber=n; +); + +Mkbezierptcrv(ptdata):=Mkbezierptcrv(ptdata,[]); +Mkbezierptcrv(ptdata,options):=( + //help:Mkbezierptcrv([A,B,C,D]); + //help:Mkbezierptcrv([[A,B],[C,D]]); + //help:Mkbezierptcrv(options=["Num=10"]); + // global BezierNumber + regional(ptlist,Out,tmp,tmp1,tmp2); + if(isstring(ptdata), + ptlist=Readcsvsla(ptdata,options); + , + ptlist=ptdata; + ); + if(MeasureDepth(ptlist)==1,ptlist=[ptlist]); + Out=[]; + forall(1..length(ptlist), + tmp=floor((BezierNumber-1)/26);// 15.02.23 + if(tmp==0,tmp="",tmp=text(tmp)); + tmp2=mod(BezierNumber,26); + if(tmp2==0,tmp2=26); + tmp1=unicode(text(96+tmp2),base->10)+tmp;// 15.03.11 + tmp2=Putbezierdata(tmp1,ptlist_#,options); + Bezier(tmp2,options); + BezierNumber=BezierNumber+1; + Out=append(Out,tmp2_(1..2)); + ); + Out; +); + +Mkbeziercrv(nm,ptctrL):=Mkbeziercrv(nm,ptctrL,[]); +Mkbeziercrv(nm,ptctrL,options):=( + //help:Mkbeziercrv("1",[[A,B,C,D],[[P,Q],[R,S],T]]); + regional(ptctrLL,name,ptlist,ctrlist,tmp,tmp1,tmp2); + if(MeasureDepth(ptctrL)==2,ptctrLL=[ptctrL],ptctrLL=ptctrL); + forall(1..length(ptctrLL), + name=nm+text(#); + ptlist=ptctrLL_#_1; + ctrlist=ptctrLL_#_2; + Bezier(name,ptlist,ctrlist,options); + ); +); + +Writebezier():=Writebezier(Fhead,"all"); +Writebezier(head):=Writebezier(head,"all"); +Writebezier(head,seL):=( +//help:Writebezier(file); +//help:Writebezier(file,"acd"); + regional(bz,dt,name,tmp,tmp1,tmp2); + bz=select(GLIST,indexof(#,"=Bezier")>0); + tmp1=[]; // 16.04.22from + if(seL!="all", + forall(1..length(seL), + tmp=substring(seL,#-1,#); + tmp=select(bz,indexof(#,"bz"+tmp)>0); + tmp1=concat(tmp1,tmp); + ); + bz=tmp1;// 16.04.22upto + ); + dt=[head+"n",[[length(bz),0]]]; + forall(1..length(bz), + tmp=indexof(bz_#,"="); + name=substring(bz_#,0,tmp-1); + tmp=indexof(bz_#,","+Dq); + if(tmp>0, + tmp1=substring(bz_#,0,tmp-1)+")"; + , + tmp1=bz_#; + ); + tmp1=replace(tmp1,"Bezier(","["); + tmp1=replace(tmp1,"list(","["); + tmp1=replace(tmp1,")","]"); + tmp1=replace(tmp1,",",".xy,"); + tmp1=replace(tmp1,"]",".xy]"); + tmp1=replace(tmp1,".xy,[",",["); + tmp1=replace(tmp1,"].xy","]"); + tmp1=replace(tmp1,name,head+text(#)); + parse(tmp1); + tmp=parse(head+text(#)+"_1"); + dt=concat(dt,[head+text(#)+"k",tmp]); + tmp=parse(head+text(#)+"_2"); + dt=concat(dt,[head+text(#)+"c",tmp]); + ); + WriteOutData(head+".txt",dt); + dt; +); + +Readbezier(file):=Readbezier(file,[]); +Readbezier(file,optionorg):=( +//help:Readbezier("xsr"); +//help:Readbezier(options=["Num=10","nogeo"]); + regional(nn,options,stL,geo,nc,alpha,out,tmp,tmp1,tmp2,tmp3); + options=optionorg; + tmp=Divoptions(options); + stL=tmp_7; + geo=0; + forall(stL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="G",geo=1); + options=remove(options,[#]); + ); + ReadOutData(file); + tmp=file+"n_1_1"; + nn=parse(tmp); + out=[]; + forall(1..nn,nc, + tmp=file+text(nc); + tmp1=parse(tmp+"k"); + tmp2=parse(tmp+"c"); + if(MeasureDepth(tmp2)==1,tmp2=[tmp2]); // 16.04.22from + if(geo==1, + alpha="abcdefghijklmnopqrstuvwxyz"; + forall(1..length(tmp1), + tmp="k"+BezierNumber+"n"+text(nc)+substring(alpha,#-1,#); + Putpoint(tmp,tmp1_#,parse(tmp+".xy")); + inspect(parse(tmp),"labeled",false); + inspect(parse(tmp),"ptsize",3); + tmp1_#=parse(tmp+".xy"); + ); + forall(1..length(tmp2), + tmp="c"+BezierNumber+"n"+text(nc)+substring(alpha,#-1,#)+"1"; + Putpoint(tmp,tmp2_#_1,parse(tmp+".xy")); + inspect(parse(tmp),"labeled",false); + inspect(parse(tmp),"color",4); + inspect(parse(tmp),"ptsize",3); + tmp2_#_1=parse(tmp+".xy"); + tmp="c"+BezierNumber+"no"+text(nc)+substring(alpha,#-1,#)+"2"; + Putpoint(tmp,tmp2_#_2,parse(tmp+".xy")); + inspect(parse(tmp),"labeled",false); + inspect(parse(tmp),"color",4); + inspect(parse(tmp),"ptsize",3); + tmp2_#_2=parse(tmp+".xy"); + ); + BezierNumber=BezierNumber+1; + ); + Bezier(file+text(nc),tmp1,tmp2,options);// 16.04.22upto + out=append(out,"bz"+tmp); + ); + out; +); + +Ospline(nm,ptlist):=Ospline(nm,ptlist,[]); +Ospline(nm,ptlist,options):=( +//help:Ospline("1",ptlist,[options]); + regional(tmp,tmp1,tmp2,list,ptL,ctrL,name,closed,flg, + p0,p1,p2,p3,pQ,pR,cc,p01,p02,p11,p12,p21,p22,p31,p32); + name="o"+nm; + if(isstring(ptlist),list=parse(ptlist),list=ptlist); + if(|list_1-list_(length(list))|<10^(-6),closed=1,closed=0); +// list=apply(list,LLcrd(#)); + ctrL=[]; + forall(1..(length(list)-1), + flg=0; + p1=Lcrd(list_#); // 16.08.16 + p2=Lcrd(list_(#+1)); // 16.08.16 + if(#==1 % #==length(list)-1, + flg=1; + if(closed==0, + pQ=(p1+2*p2)/3; // 15.09.21 // 16.08.16 + pR=(2*p1+p2)/3; // 16.08.16 + ctrL=append(ctrL,[pQ,pR]); + flg=2; + , + if(#==1, + p0=Lcrd(list_(length(list)-1)); // 16.08.16 + p3=Lcrd(list_(#+2)); // 16.08.16 + , + p0=Lcrd(list_(#-1)); // 16.08.16 + p3=Lcrd(list_2); // 16.08.16 + ); + ); + ); + if(flg<=1, + if(flg==0, + p0=Lcrd(list_(#-1)); // 16.08.16 + p3=Lcrd(list_(#+2)); // 16.08.16 + ); + tmp=1+sqrt((1+Dotprod(p2-p0,p3-p1)/|p2-p0|/|p3-p1|)/2); + cc=4*|p2-p1|/3/(|p2-p0|+|p3-p1|)/tmp; + pQ=p1+cc*(p2-p0); // 15.09.21 // 16.08.16 + pR=p2+cc*(p1-p3); // 16.08.16 + ctrL=append(ctrL,[pQ,pR]); + ); + ); +// list=apply(list,LLcrd(#)); // 16.08.16 +// ctrL=apply(ctrL,LLcrd(#)); + if(closed==0, // 15.09.21 + p1=ctrL_2_1; + p2=Lcrd(list_2); // 16.08.16 + pQ=p2+(p2-p1); + ctrL_1=[pQ]; + tmp=length(ctrL); + tmp1=ctrL_(tmp-1); + p1=ctrL_(tmp-1)_2; + p2=Lcrd(list_(tmp)); // 16.08.16 + pQ=p2+(p2-p1); + ctrL_tmp=[pQ]; + ); + Bezier("o"+nm,list,ctrL,options); +); + +CRspline(nm,ptL):=CRspline(nm,ptL,[]); +CRspline(nm,ptL,options):=( + // Catmull-Rom spline +//help:CRspline("1",[A,B,C,A]); + regional(name,ptlist,ctrpts,eqL,opcindy,c,v,tmp,tmp1,tmp2,ctrlist,cflg); + name="crsp"+nm; + if(MeasureDepth(ptL)==1,tmp=[ptL],tmp=ptL); + ptlist=tmp_1; + if(length(tmp)==1, + cflg=1; + , + cflg=0; + ctrpts=tmp_2; + ); + c=1/6; + tmp=Divoptions(options); + eqL=tmp_5; + opcindy=tmp_(length(tmp)); // 15.03.05 + forall(eqL, + if(substring(#,0,1)=="R", + tmp2=indexof(#,"="); + c=parse(substring(#,tmp2,length(#))); + ); + ); + ptlist=apply(ptlist,Lcrd(#)); // 16.08.16 + ctrlist=[]; + forall(1..(length(ptlist)-1), + if(#==1, + if(cflg==0, + tmp1=ctrpts_1; + , + v=ptlist_2-ptlist_(length(ptlist)-1); + tmp1=ptlist_#+c*v; + ); + , + v=ptlist_(#+1)-ptlist_(#-1); + tmp1=ptlist_#+c*v; + ); + if(#==length(ptlist)-1, + if(cflg==0, + tmp2=ctrpts_2; + , + v=ptlist_2-ptlist_#; + tmp2=ptlist_(#+1)-c*v; + ); + , + v=ptlist_(#+2)-ptlist_#; + tmp2=ptlist_(#+1)-c*v; + ); + tmp=select(options,indexof(text(#),"->")>0); + tmp=append(tmp,"notex"); //15.03.05 + Pointdata(name+text(#),[tmp1,tmp2],tmp); + ctrlist=append(ctrlist,[tmp1,tmp2]); + ); + Bezier(nm,ptlist,ctrlist,options); +); + +Beziersmooth(nm,ptL):=Bzspline(nm,ptL,[]); +//help:Beziersmooth("1",[A,B,C,A]); +Beziersmooth(nm,ptL,options):=Bzspline(nm,ptL,options); +Bzspline(nm,ptL):=Bzspline(nm,ptL,[]); +Bzspline(nm,ptLorg,options):=( + // smooth bezier + regional(name,Eps,ptL,pt,pt1,pt2,pt3,npt,lstr, + tmp,tmp1,tmp2,cflg,ctrlist); + name="bzsp"+nm; + Eps=10^(-3); + ptL=apply(ptLorg,Lcrd(#)); // 16.08.16 + if(|ptL_1-ptL_(length(ptL))|<Eps,cflg=1,cflg=0); + forall(2..length(ptL), + pt=ptL_#; + pt1=ptL_(#-1); + tmp1="C"+text(#-1)+"q"; + Putpoint(tmp1,(pt1+4*pt)/5,Lcrd(parse(tmp1))); // 16.08.16 + ); + forall(2..(length(ptL)-1), + if(#<length(ptL) % cflg==1, + lstr="c"+text(#); + pt=ptLorg_#; // 16.08.16 + pt1=parse("C"+text(#-1)+"q"); + create([lstr],"Join",[pt1,pt]); + tmp2="C"+text(#)+"p"; + tmp=Append((2*pt.xy-pt1.xy),1); + create([tmp2],"PointOnLine",[parse(lstr),tmp]); + ); + ); + if(cflg==0, + pt=ptL_1; + pt1=ptL_2; + tmp1="C1p"; + Putpoint(tmp1,(4*pt+pt1)/5,Lcrd(parse(tmp1))); // 16.08.16 + ); + if(cflg==1, + lstr="c1"; + pt=ptLorg_1; // 16.08.16 + pt1=parse("C"+text(length(ptL)-1)+"q"); + create([lstr],"Join",[pt1,pt]); + tmp1="C1p"; + tmp=Append((2*pt.xy-pt1.xy),1); + create([tmp1],"PointOnLine",[parse(lstr),tmp]); + ); + ctrlist=[]; + forall(1..(length(ptL)-1), + if(#>1 % cflg==1, + tmp1="c"+text(#); + inspect(parse(tmp1),"alpha",0.3); + ); + tmp1="C"+text(#)+"p"; + tmp2="C"+text(#)+"q"; + inspect(parse(tmp1),"ptsize",3); + inspect(parse(tmp1),"color",3); + inspect(parse(tmp2),"ptsize",3); + inspect(parse(tmp2),"color",3); + tmp=[parse(tmp1),parse(tmp2)]; + ctrlist=append(ctrlist,tmp); + ); + Bezier(nm,ptL,ctrlist,options); + [ptL,ctrlist]; +); + +Beziersym(nm,ptL):=Bzsspline(nm,ptL,[]); +Beziersym(nm,ptL,options):=Bzsspline(nm,ptL,options); +Bzsspline(nm,ptL):=Bzsspline(nm,ptL,[]); +Bzsspline(nm,ptLorg,options):=( + // smooth bezier with symmetric control points + regional(name,Eps,ptL,pt,pt1,pt2,pt3,npt,lstr, + tmp,tmp1,tmp2,cflg,ctrlist); + name="bzssp"+nm; + Eps=10^(-3); + ptL=apply(ptLorg,Lcrd(#)); // 16.08.16 + if(|ptL_1-ptL_(length(ptL))|<Eps,cflg=1,cflg=0); + forall(2..length(ptL), + pt=ptL_#; + pt1=ptL_(#-1); + tmp1="C"+text(#-1)+"q"; + Putpoint(tmp1,(pt1+4*pt)/5,Lcrd(parse(tmp1))); + ); + forall(2..(length(ptL)-1), + if(#<length(ptL) % cflg==1, + pt=ptL_#; + pt1=parse("C"+text(#-1)+"q"); + tmp2="C"+text(#)+"p=2*pt-pt1"; + parse(tmp2); + ); + ); + if(cflg==0, + pt=ptL_1; + pt1=ptL_2; + Putpoint("C1p",(4*pt+pt1)/5,Lcrd(C1p)); // 16.08.16 + inspect(C1p,"ptsize",3); + inspect(C1p,"color",3); + ); + if(cflg==1, + pt=ptL_1; + pt1=Lcrd(parse("C"+text(length(ptL)-1)+"q")); // 16.08.16 + tmp1="Putpoint("+Dq+"C1p"+Dq+",2*pt-pt1)"; // 16.08.16 + parse(tmp1); + ); + ctrlist=[]; + forall(1..(length(ptL)-1), + tmp1="C"+text(#)+"p"; + tmp2="C"+text(#)+"q"; + inspect(parse(tmp2),"ptsize",3); + inspect(parse(tmp2),"color",3); + tmp=[parse(tmp1),parse(tmp2)]; + ctrlist=append(ctrlist,tmp); + ); + Bezier(nm,ptL,ctrlist,options); + [ptL,ctrlist]; +); + +Listbspline2bz(listorg):=( + regional(Eps,list,pcl,ptl,ctrl,k); + Eps=10^(-3); + list=apply(listorg,Lcrd(#)); // 16.08.16 + k=length(list); + if(|list_1-list_k|>Eps, + pcl=list; + pcl_1=2*list_1-list_2; + pcl_k=2*list_k-list_(k-1); + , + pcl=concat(list,[list_2]); + ); + ctrl=apply(2..(length(pcl)-1),[pcl_#]); + ptl=apply(1..(length(pcl)-1),(pcl_#+pcl_(#+1))/2); + [ptl,ctrl]; +); + +Bspline(nm,ctrL):=Bspline(nm,ctrL,[]); +Bspline(nm,ctrL,options):=( +//help:Bspline("",[A,B,C]); + regional(list,tmp); + list=Listbspline2bz(ctrL); + tmp=BezierCurve("b"+nm,list_1,list_2,options); + tmp; +); + +MeetCurve(Crv,Xorg,Yorg):=( + regional(Cv,tmp,tmp1,tmp2,X0,Y0,x1,x2,y1,y2,Ylist,Ban,Tate); + if(isstring(Crv),Cv=parse(Crv),Cv=Crv); + if(MeasureDepth(Cv)==2,Cv=Cv_1); + Cv=apply(Cv,LLcrd(#)); // 14.12.18 + while(length(Cv)==1, + Cv=Cv_1; + ); + Cv=apply(Cv,Lcrd(#)); + tmp1=min(apply(Cv,#_1)); + tmp2=max(apply(Cv,#_1)); + if(isstring(Xorg),X0=parse(Xorg),X0=Xorg); + if(isstring(Yorg),Y0=parse(Yorg),Y0=Yorg); + if(X0<tmp1, + X0=tmp1; + , + if(X0>tmp2, + X0=tmp2; + ); + ); + tmp1=select( + 1..(length(Cv)-1),Cv_#_1<=X0 & X0<=Cv_(#+1)_1); + tmp2=select( + 1..(length(Cv)-1),Cv_#_1>=X0 & X0>=Cv_(#+1)_1); + tmp2=remove(tmp2,common(tmp2,tmp1)); + Ban=concat(tmp1,tmp2); + Tate=select(Ban, + abs(Cv_#_1-Cv_(#+1)_1)<= + 10^(-2)*abs(Cv_#_2-Cv_(#+1)_2) + ); + Ban=remove(Ban,Tate); + Ylist=[]; + forall(Ban, + tmp=Cv_#; + x1=tmp_1; y1=tmp_2; + tmp=Cv_(#+1); + x2=tmp_1; y2=tmp_2; + tmp=((x2-X0)*y1+(X0-x1)*y2)/(x2-x1); + Ylist=append(Ylist,tmp); + ); + forall(Tate, + tmp=Cv_#; + x1=tmp_1; y1=tmp_2; + tmp=Cv_(#+1); + x2=tmp_1; y2=tmp_2; + tmp1=min([y1,y2]); + tmp2=max([y1,y2]); + if(Y0<tmp1, + tmp=tmp1; + , + if(Y0>tmp2, + tmp=tmp2; + , + tmp=Y0; + ); + ); + Ylist=append(Ylist,tmp); + ); + tmp=sort(Ylist,abs(#_1-Y0)); + [X0,tmp_1]; +); + +PutonLine(name,p1,p2):=PutonLine(name,p1,p2,[]); +PutonLine(name,p1org,p2org,options):=( +//help:PutonLine("C","sgAB"); +//help:PutonLine("C",pA,pB); + regional(par,p1,p2,dx,dy,tmp,tmp1,tmp2); + par=0.5; + tmp=Divoptions(options); + if(length(tmp_6)>0, + par=tmp_6_1; + ); + p1=Lcrd(p1org);//16.10.11from + p2=Lcrd(p2org); + dx=p2_1-p1_1; + dy=p2_2-p1_2; + tmp1=(1-par)*p1+par*p2; + if(abs(dx)>abs(dy), + tmp=name+".x"; + tmp2="["+tmp+",dy/dx*("+tmp+"-p1_1)+p1_2]";//16.10.11upto + Putpoint(name,tmp1,parse(tmp2)); + , + if(abs(dy)>0, + tmp=name+".y"; + tmp2="[dx/dy*("+tmp+"-p1.y)+p1_1,"+tmp+"]"; + Putpoint(name,tmp1,parse(tmp2)); + , + tmp2=p1;//16.10.11 + Putpoint(name,tmp1,tmp2); + ); + ); +); + +PutonSeg(name,sgstr):=( + regional(seg,p1,p2); + if(isstring(sgstr),seg=parse(sgstr),seg=sgstr); + PutonSeg(name,LLcrd(seg_1),LLcrd(seg_2)); +); +PutonSeg(name,p1,p2):=PutonSeg(name,p1,p2,[]); +PutonSeg(name,p1org,p2org,options):=( +//help:PutonSeg("C","sgAB"); +//help:PutonSeg("C",pA,pB); + regional(par,dx,dy,p,tmp,tmp1,tmp2); + par=0.5; + tmp=Divoptions(options); + if(length(tmp_6)>0, + par=tmp_6_1; + ); + p1=Lcrd(p1org);//16.10.11from + p2=Lcrd(p2org); + PutonLine(name,p1,p2,[par]); + dx=p2_1-p1_1; + dy=p2_2-p1_2; + p=parse(name+".xy"); + p=LLcrd(p); + if(abs(dx)>abs(dy) & (p_1-p1_1)*(p_1-p2_1)>0, + if(|p-p1|<|p-p2|, + parse(name+".xy=Pcrd(p1)"); + , + parse(name+".xy=Pcrd(p2)"); + ); + ); + if(abs(dx)<abs(dy) & (p_2-p1_2)*(p_2-p2_2)>0, + if(|p-p1|<|p-p2|, + parse(name+".xy=Pcrd(p1)"); + , + parse(name+".xy=Pcrd(p2)");//16.10.11upto + ); + ); +); + +PutonCurve(pn,crv):=PutonCurve(pn,crv,[]); +PutonCurve(pn,crv,options):=( +//help:PutonCurve("A","gr1"); + regional(Pmt,pstr,optionL,leftlim,rightlim,tmp,tmp1,Flg,Msg); + if(!islist(options),optionL=[options],optionL=options); + leftlim=XMIN; + rightlim=XMAX; + Flg=0; + Msg="y"; + forall(optionL, + if(isstring(#), // 16.02.10 from + tmp=indexof(#,"="); + tmp1=Toupper(substring(#,tmp,tmp+1)); + if(tmp1=="N", Msg="n"); // 16.02.10 upto + , + if(Flg==0, + leftlim=#; + Flg=Flg+1; + , + rightlim=#; + ); + ); + ); + Pmt=MeetCurve(crv,leftlim,0); + pstr=apply(allpoints(),textformat(#,5)); // 15.04.07 + if(!contains(pstr,pn), + createpoint(pn,Pcrd(Pmt)); + , + tmp1=parse(pn+".x"); + if(tmp1< leftlim % tmp1>rightlim, + if(tmp1< leftlim,tmp= leftlim, tmp=rightlim); + Pmt=MeetCurve(crv,textformat(tmp,5),pn+".y"); + , + Pmt=MeetCurve(crv,pn+".x",pn+".y"); + ); + ptstr=pn+".xy="+textformat(Pcrd(Pmt),5)+";"; + parse(ptstr); + ); + if(Msg=="y", + println("Put "+pn+" on Curve "+text(crv)); + ); +); + +CrossPoint(name,Crv1,Crv2,range):=( + regional(Mx1,Mx2,Mx3,tmp,Crs1,Crs2,Crs3,Crs4,df1,df2); + Mx1=range_1; Mx2=range_2; + repeat(15, + Mx3=(Mx1+Mx2)/2; + Crs1=MeetCurve(Crv1,Mx1,0); + Crs2=MeetCurve(Crv2,Mx1,0); + Crs3=MeetCurve(Crv1,Mx3,0); + Crs4=MeetCurve(Crv2,Mx3,0); + df1=Crs1_2-Crs2_2; + df2=Crs3_2-Crs4_2; + if((df1>0 & df2>0) % (df1<0 & df2<0), + Mx1=Mx3; + , + Mx2=Mx3; + ); + ); + Putpoint(name,Crs1); +); + +Setscaling(sc):=( +//help:Setscaling(3); + SCALEX=1; + SCALEY=sc; + Com0th("Setscaling("+sc+")"); + Setwindow("Msg=no"); +); + +Tabledatalight(nm,xLst,yLst,rmvL):=Tabledatalight(nm,xLst,yLst,rmvL,[]); +Tabledatalight(nm,xLst,yLst,rmvL,options):=( +//help:Tabledatalight("",xLst,yLst,rmvL,[2]); + regional(name,upleft,ul,flg,tick,n,m,xsize,ysize,rlist,clist,Tb, + tmp,tmp1,tmp2,tmp3,Eps); +// name="tb"+nm; + name="tb"; + println("Tabledatalight "+name+" generated"); + tmp=sum(yLst); + upleft=[0,tmp]; + tick=1; + tmp=Divoptions(options); + flg=0; + forall(tmp_6, + if(flg==0, + tick=#; + flg=flg+1; + , + upleft=tmp_6_1; + ); + ); + ul=upleft/10; + m=length(xLst); + n=length(yLst); + xsize=sum(xLst); + ysize=sum(yLst); + clist=[ul]; + rlist=[ul]; + forall(1..m, + tmp1=clist_(#)_1+xLst_#/10; + clist=append(clist,[tmp1,clist_1_2]); + ); + forall(1..n, + tmp1=rlist_(#)_2-yLst_#/10; + rlist=append(rlist,[0,tmp1]); + ); + Tb=[clist,rlist]; + tmp=name+"="+Tb; + parse(tmp); + forall(0..m, + tmp1="c"+text(#)+"r0"; + tmp2="c"+text(#)+"r"+text(n); + Tlistplot("c"+text(#)+"r0r"+text(n),[tmp1,tmp2],options); + if(mod(#,tick)==0 % #==m, + tmp=clist_(#+1); + drawtext(clist_(#+1)-[0.04,-0.1],"c"+text(#)); + ); + ); + forall(0..n, + tmp1="c0r"+text(#); + tmp2="c"+text(m)+"r"+text(#); + Tlistplot("r"+text(#)+"c0c"+text(m),[tmp1,tmp2],options); + if(mod(#,tick)==0 % #==n, + tmp=rlist_(#+1); + drawtext(rlist_(#+1)-[0.4,0.1],"r"+text(#)); + ); + ); + Tsegrmv(rmvL,options); + Addax(0); + Eps=10^(-3); + tmp1=clist_(length(clist)); + tmp2=rlist_1; + tmp3=rlist_(length(rlist)); + Setwindow([0-Eps,tmp1_1+Eps],[tmp3_2-Eps,tmp2_2+Eps]); + Tb; +); + +Tabledata(nm,n,m,xsize,ysize,rmvL):= + Tabledata(nm,n,m,xsize,ysize,rmvL,[]); +Tabledata(nm,n,m,xsize,ysize,rmvL,options):=( + regional(Tb,name,tmp,xLst,yLst); + name="tb"+nm; + xLst=apply(1..n,xsize/n); + yLst=apply(1..m,ysize/m); + Tabledata(nm,xLst,yLst,rmvL,options) +); +Tabledata(nm,xLst,yLst,rmvL):=Tabledata(nm,xLst,yLst,rmvL,[]); +Tabledata(nm,xLst,yLst,rmvL,options):=( +//help:Tabledata("",xLst,yLst,rmvL,[2]); + regional(name,upleft,ul,flg,tick,n,m,xsize,ysize,rlist,clist,Tb, + tmp,tmp1,tmp2,tmp3,Eps); +// name="tb"+nm; + name="tb"; + println("Tabledata "+name+" generated"); + tmp=sum(yLst); + upleft=[0,tmp]; + tick=1; + tmp=Divoptions(options); + flg=0; + forall(tmp_6, + if(flg==0, + tick=#; + flg=flg+1; + , + upleft=tmp_6_1; + ); + ); + ul=upleft/10; + m=length(xLst); + n=length(yLst); + xsize=sum(xLst); + ysize=sum(yLst); + clist=[ul]; + rlist=[ul]; + forall(1..m, + tmp1=clist_(#)_1+xLst_#/10; + clist=append(clist,[tmp1,clist_1_2]); + ); + forall(1..n, + tmp1=rlist_(#)_2-yLst_#/10; + rlist=append(rlist,[0,tmp1]); + ); + Tb=[clist,rlist]; + tmp=name+"="+Tb; + parse(tmp); + forall(0..m, + tmp="C"+text(#); + tmp1="c"+text(#)+"r0"; + if(#==0, + Putpoint(tmp,Tgrid(tmp1)); + , + Putpoint(tmp,Tgrid(tmp1),[parse(tmp+".x"),C0.y]); + clist_(#+1)=parse(tmp+".xy"); + ); + inspect(parse(tmp),"ptsize",3); + inspect(parse(tmp),"labeled",false); + if(mod(#,tick)==0 % #==m, + tmp=clist_(#+1); + drawtext(clist_(#+1)-[0.04,-0.1],"c"+text(#)); + ); + ); + forall(0..n, + tmp="R"+text(#); + tmp1="c0r"+text(#); + if(#==0, + Putpoint(tmp,Tgrid(tmp1)); + , + Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); + rlist_(#+1)=parse(tmp+".xy"); + ); + Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); + inspect(parse(tmp),"ptsize",3); + inspect(parse(tmp),"labeled",false); + if(mod(#,tick)==0 % #==n, + tmp=rlist_(#+1); + drawtext(rlist_(#+1)-[0.4,0.1],"r"+text(#)); + ); + ); + Tb=[clist,rlist]; + tmp=name+"="+Tb; + parse(tmp); + forall(0..m, + tmp1="c"+text(#)+"r0"; + tmp2="c"+text(#)+"r"+text(n); + Tlistplot("c"+text(#)+"r0r"+text(n),[tmp1,tmp2],options); + if(#<m, + tmp1=parse("C"+text(#)); + tmp2=parse("C"+text(#+1)); + tmp=(tmp1.xy+tmp2.xy)/2; + drawtext(tmp+[-0.2,0.5],text((tmp2.x-tmp1.x)*10)); + ); + ); + forall(0..n, + tmp1="c0r"+text(#); + tmp2="c"+text(m)+"r"+text(#); + Tlistplot("r"+text(#)+"c0c"+text(m),[tmp1,tmp2],options); + if(#<n, + tmp1=parse("R"+text(#)); + tmp2=parse("R"+text(#+1)); + tmp=(tmp1.xy+tmp2.xy)/2; + drawtext(tmp-[1.2,0.1],text(abs(tmp1.y-tmp2.y)*10)); + ); + ); + Tsegrmv(rmvL,options); + Addax(0); + Eps=10^(-3); + tmp1=clist_(length(clist)); + tmp2=rlist_1; + tmp3=rlist_(length(rlist)); // 15.06.11 + Setwindow([0-Eps,tmp1_1+Eps],[tmp3_2-Eps,tmp2_2+Eps]); + Tb; +); + +Tseginfo(seg):=( + regional(cr,tp,tpc,n1,n2,n3,tmp,tmp1,tmp2); + if(substring(seg,0,2)=="sg", + cr=substring(seg,2,length(seg)); + , + cr=seg; + ); + tp=substring(cr,0,1); + if(tp=="c", + tpc="r"; + , + tpc="c"; + ); + tmp1=indexof(cr,tpc); + tmp=substring(cr,tmp1,length(cr)); + tmp2=tmp1+indexof(tmp,tpc); + n1=substring(cr,1,tmp1-1); + n2=substring(cr,tmp1,tmp2-1); + n3=substring(cr,tmp2,length(cr)); + [tp+n1,tpc,parse(n2),parse(n3)]; +); + +Tsegrmv(rmvL):=Tsegrmv(rmvL,[]); +Tsegrmv(rmvL,options):=( + regional(cr,gcL,flg,gc,hd,tail,tpc,m1,m2,n1,n2,tmp,tmp1,tmp2); + forall(rmvL,cr, + tmp1=Tseginfo(cr); + hd=tmp1_1; + tpc=tmp1_2; + m1=tmp1_3; + m2=tmp1_4; + gcL=select(GCLIST,Tseginfo(#_1)_1==tmp1_1); + flg=0; + forall(gcL, + if(flg==0, + tmp=Tseginfo(#_1); + n1=tmp_3; + n2=tmp_4; + if(m1>=n1 & m2<=n2, + gc=#; + flg=1; + ); + ); + ); + if(flg==1, + Changestyle([gc_1],["nodisp"]); + tail=""; + if(indexof(hd,"r")>0, + tail=hd; hd=""; + ); + if(n1<m1, + tmp1=tpc+text(n1); + tmp2=tpc+text(m1); + tmp=hd+tail+tmp1+tmp2; + Tlistplot(tmp,[hd+tmp1+tail,hd+tmp2+tail],options); + ); + if(m2<n2, + tmp1=tpc+text(m2); + tmp2=tpc+text(n2); + tmp=hd+tail+tmp1+tmp2; + Tlistplot(tmp,[hd+tmp1+tail,hd+tmp2+tail],options); + ); + ); + ); +); + +Tgrid(ptstr):=( +//help:Tgrid("c2r5"); + regional(tmp,tmp1,tmp2); + tmp=parse(ptstr); + if(islist(tmp), + tmp; + , + tmp=indexof(ptstr,"r"); + tmp1=substring(ptstr,1,tmp-1); + tmp1=parse(tmp1); + tmp2=substring(ptstr,tmp,length(ptstr)); + tmp2=parse(tmp2); + [tb_1_(tmp1+1)_1,tb_2_(tmp2+1)_2]; + ); +); + +Tlistplot(ptL):=Tlistplot(ptL,[]); +Tlistplot(Ag1,Ag2):=( + regional(nm,ptL,options); + if(isstring(Ag1), + nm=Ag1; + ptL=Ag2; + options=[]; + , + ptL=Ag1; + options=Ag2; + nm=ptL_1+ptL_2; + ); + Tlistplot(nm,ptL,options); +); +Tlistplot(nm,ptL,options):=( +//help:Tlistplot(["c0r0","c0r4"]); +//help:Tlistplot("1",["c0r0","c0r4"]); + regional(tmp); + tmp=apply(ptL,Tgrid(#)); // 15.06.03 + Listplot(nm,tmp,append(options,"Msg=no")); +); + +ChangeTablestyle(nameL,style):=( +////help:ChangeTablestyle(["r0c0c3"],["da"]); + regional(nmL,tmp,tmp1,tmp2); + if(islist(nameL),nmL=nameL,nmL=[nameL]); + nmL=apply(nmL,"sg"+#); + nmL=select(nmL,islist(parse(#))); + Changestyle(nmL,style); +); + +Findcell(pos1,pos2):=Findcell("",pos1,pos2); +Findcell(Tbdata,pos1,pos2):=( +//help:Findcell("c0r0","c2r1"); + regional(tmp1,tmp2,posnw,posse,ctr,dx,dy); + if(isstring(pos1), + posnw=Tgrid(pos1); // 15.05.20 + posse=Tgrid(pos2); + //posnw=parse(pos1); + //posse=parse(pos2); + , + if(islist(pos1), + posnw=pos1; + posse=pos2; + , + tmp1="c"+text(pos1-1)+"r"+text(pos2-1); + tmp2="c"+text(pos1)+"r"+text(pos2); + posnw=Tgrid(tmp1); + posse=Tgrid(tmp2); +// posnw=parse(tmp1); +// posse=parse(tmp2); + ); + ); + ctr=(posnw+posse)/2; + dx=abs(posse_1-ctr_1); + dy=abs(posnw_2-ctr_2); + [ctr,dx,dy]; +); + +Putcell(pos1,pos2,dir,lttr):=Putcell("",pos1,pos2,dir,lttr); +Putcell(Tbdata,pos1,pos2,dir,lttr):=( +//help:Putcell("c0r0","c2r1","lt","abc"); +//help:Putcell(2,3,"c","xyz"); + regional(tmp,tmp1,tmp2,posnw,posse, + posdir,posstr,ctr,dx,dy); + tmp=Findcell(Tbdata,pos1,pos2); + ctr=tmp_1; dx=tmp_2; dy=tmp_3; + posdir=ctr; + posstr=dir; + if(indexof(dir,"b")>0, + posdir_2=posdir_2-dy; + posstr=replace(posstr,"b","n"); + ); + if(indexof(dir,"t")>0, + posdir_2=posdir_2+dy; + posstr=replace(posstr,"t","s"); + ); + if(indexof(dir,"l")>0, + posdir_1=posdir_1-dx; + posstr=replace(posstr,"l","e"); + ); + if(indexof(dir,"r")>0, + posdir_1=posdir_1+dx; + posstr=replace(posstr,"r","w"); + ); + Letter(posdir,posstr,text(lttr)); +); + +Putcellexpr(pos1,pos2,dir,ex):=Putcellexpr("",pos1,pos2,dir,ex); +Putcellexpr(Tbdata,pos1,pos2,dir,ex):=( +//help:Putcellexpr("c0r0","c2r1","lt","abc"); +//help:Putcellexpr(2,3,"c","\sin x"); + Putcell(Tbdata,pos1,pos2,dir,"$"+text(ex)+"$"); +); + +Putrow(nrow,dir,lttrL):=Putrow("",nrow,dir,lttrL); +Putrow(Tbdata,nrow,dir,lttrL):=( +//help:Putrow(1,"c",["x","y","z"]); + regional(tmp,tmp1,mcol); + mcol=length(lttrL); + forall(1..mcol, + Putcell(Tbdata,#,nrow,dir,lttrL_#); + ); +); + +Putrowexpr(nrow,dir,exL):=Putrowexpr("",nrow,dir,exL); +Putrowexpr(Tbdata,nrow,dir,exL):=( +//help:Putrowexpr(2,"r",["x","y","z"]); + regional(lttrL); + lttrL=apply(exL,"$"+#+"$"); + Putrow(Tbdata,nrow,dir,lttrL); +); + +PutcoL(mcol,dir,lttrL):=PutcoL("",mcol,dir,lttrL); +PutcoL(Tbdata,mcol,dir,lttrL):=( +//help:PutcoL(1,"c",["x","y","z"]); + regional(tmp,tmp1,nrow); + nrow=length(lttrL); + forall(1..nrow, + Putcell(Tbdata,mcol,#,dir,lttrL_#); + ); +); +PutcoLexpr(mcol,dir,exL):=PutcoLexpr("",mcol,dir,exL); +PutcoLexpr(Tbdata,mcol,dir,exL):=( +//help:PutcoLexpr(2,"r",["x","y","z"]); + regional(lttrL); + lttrL=apply(exL,"$"+#+"$"); + PutcoL(Tbdata,mcol,dir,lttrL); +); + +Setwindow():=Setwindow("Msg=yes"); +Setwindow(str):=( + regional(tmp,tmp1,tmp2,msg); + msg="y"; + tmp=indexof(str,"="); // 16.02.10 + tmp1=Toupper(substring(str,tmp,tmp+1)); + if(tmp1=="N",msg="n"); + if((ispoint(SW) & ispoint(NE)), + tmp1=Lcrd(SW); + tmp2=Lcrd(NE); + XMIN=tmp1_1; XMAX=tmp2_1; + YMIN=tmp1_2; YMAX=tmp2_2; + , +// XMIN=-5; XMAX=5; +// YMIN=Lcrdy(-5); YMAX=Lcrdy(5); + createpoint("SW",Pcrd([XMIN,YMIN])); + createpoint("NE", Pcrd([XMAX,YMAX])); + ); + if(msg=="y", + println("Setwindow(["+XMIN+","+XMAX+"],["+YMIN+","+YMAX+"])"); + ); + layer(KETPICLAYER); + autoclearlayer(KETPICLAYER,true); + drawpoly([Pcrd([XMIN,YMIN]), Pcrd([XMAX,YMIN]), + Pcrd([XMAX,YMAX]),Pcrd([XMIN,YMAX])],color->[1,1,1]); +); +Setwindow(xrange,yrange):=( +//help:Setwindow([2,3],[-1,1]); + XMIN=xrange_1; + XMAX=xrange_2; + YMIN=yrange_1; + YMAX=yrange_2; +// Setwindow(); +); + +Sciform(list):=( + regional(plotlist,comp,pos,out,out2,nn,strL,flg, + tmp,tmp1,tmp2,tmp3,Nj); + plotlist=Flatten([list]); + out=replace(plotlist_1,".xy",""); + out=replace(out,".x","(1)"); + out=replace(out,".y","(2)"); + if(length(plotlist)==1, + comp=[]; + forall(1..length(out), + comp=append(comp,substring(out,#-1,#)); + ); + out=""; + pos=0; + forall(comp, + if(#!="'", + out=out+#; + , + if(pos==0, + tmp=indexof(out,"Assign("); + if(substring(out,length(out)-7,length(out))=="Assign(", + out=out+"'"; + pos=1; + , + out=out+"Assign('"; + pos=2; + ); + , + if(pos==2, + out=out+"')"; + , + out=out+"'"; + ); + pos=0; + ); + ); + ); + , + forall(2..length(plotlist), + comp=plotlist_#; + if(isstring(comp), + pos=indexof(comp,"Assign("); + if(pos>0, + comp=substring(comp,6,length(comp)); + ); + out=out+"Assign("; + comp=replace(comp,".xy",""); + comp=replace(comp,".x","(1)"); + comp=replace(comp,".y","(2)"); + out=out+"'"+comp+"'"; + out=out+"),"; + ); + if(islist(comp), + forall(comp, + out=out+"'"+#+"',"; + ); + ); + ); + if(length(plotlist)>1, + out=substring(out,0,length(out)-1); + out=out+");"; + ); + ); + pos=[]; + forall(1..length(out), + tmp=indexof(substring(out,#-1,length(out)),"Assign"); + if(tmp>0, + tmp1=#-1+tmp; + if(length(pos)==0, + pos=[tmp1]; + , + if(pos_(length(pos))<tmp1, + pos=append(pos,tmp1); + ); + ); + ); + ); + if(length(pos)>0, + strL=[]; + Nj=0; + forall(pos, + tmp=substring(out,Nj,#-1); + strL=append(strL,tmp); + Nj=#-1; + ); + strL=append(strL,substring(out,Nj,length(out))); + out=""; + forall(strL, + if(indexof(#,"Assign")==0, + out=out+#; + , + tmp=indexof(#,"('"); + tmp1=indexof(#,"')"); + tmp2=substring(#,tmp+1,tmp1-2); + tmp3=substring(#,tmp1-2,length(#)); + if(indexof(tmp2,"=")==0, + out=out+#; + , + tmp=substring(tmp2,0,indexof(tmp2,"=")); + out=out+"'"+tmp+"'+"+"Assign('"; + tmp=substring(tmp2,indexof(tmp2,"="),length(tmp2)); + out=out+tmp+tmp3; + ); + ); + ); + ); + out2=""; // patched 16.01.21 from + nn=length(out); + flg=0; + forall(1..nn, + if(flg==0, + tmp=indexof(out,"='+Assign('"); + if(tmp==0, + out2=out2+out; + flg=1; + , + out2=out2+substring(out,0,tmp); + out=substring(out,tmp+10,length(out)); + tmp=indexof(out,"'"); // 16.04.19 from + tmp1=substring(out,0,tmp-1); + tmp2="1234567890"; + tmp=apply(1..length(tmp1), + indexof(tmp2,substring(tmp1,#-1,#))); + tmp=min(tmp); + if(tmp==0, // 16.04.19 upto + out2=out2+"'+Assign('"; + , + tmp=indexof(out,"'"); + out=substring(out,0,tmp)+substring(out,tmp+1,length(out)); // 16.04.18 upto + ); + ); + ); + ); + out2=replace(out2,"Dist=","D="); + out2=replace(out2,"Dis=","D="); + out2; +); + + +Rform(list):=( + regional(plotlist,comp,pos,out,strL,tmp,tmp1,tmp2,tmp3,Nj); + out=list; + out=replace(out,"[[[","list([["); + out=replace(out,"[","c("); + out=replace(out,"]",")"); + out=replace(out,".xy",""); + out=replace(out,".x","[1]"); + out=replace(out,".y","[2]"); + out; +); + +Defvar(varstr):=( + regional(name,value,tmp,tmp1); + parse(varstr); + tmp=indexof(varstr,"="); + name=substring(varstr,0,tmp-1); + value=substring(varstr,tmp,length(varstr)); + value=parse(value); + tmp1=select(1..length(VLIST),VLIST_#_1==name+"="); + if(length(tmp1)>0, + tmp=tmp1_1; + VLIST_tmp=[name+"=",value]; + , + VLIST=prepend([name+"=",value],VLIST); + ); +); + +Defvar(name,value):=( +//help:Defvar("a",0.3); + regional(tmp,tmp1); + if(islist(value), + tmp1="["; + forall(value, + tmp1=tmp1+format(#,5)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]"; + , + tmp1=format(value,5); + ); + tmp=name+"="+tmp1; // 15.02.06 + parse(tmp); + VLIST=select(VLIST,#_1!=name+"="); // 15.02.08 + VLIST=prepend([name+"=",value],VLIST); +); + +Iftosci(strorg):=( // 16.06.10 + regional(str,ifL,ppL,cpL,kk,sL, + tmp,tmp1,tmp2,tmp3,tmp4); + str=replace(strorg,LFmark,""); + ifL=Indexall(str,"if("); + ppL=Bracket(str,"()"); + cpL=Indexall(str,","); + tmp1=Bracket(str,"[]"); + forall(1..(length(tmp1)/2),kk, + cpL=select(cpL,#<tmp1_(2*kk-1)_1%#_1>tmp1_(2*kk)_1); + ); + forall(1..length(ifL),kk, + tmp=select(ppL,#_1>ifL_kk); + tmp1=tmp_1; + tmp2=select(tmp,#_2==-tmp1_2); + tmp2=tmp2_1; + tmp3=select(cpL,#>tmp1_1 & #<tmp2_1); + ifL_kk=[tmp1_1,tmp2_1,tmp1_2,tmp3]; + ); + forall(1..length(cpL),kk, + tmp=select(1..length(ifL),contains(ifL_#_4,cpL_kk)); + tmp1=tmp_(length(tmp)); + cpL_kk=[cpL_kk,tmp1]; + ); + sL=apply(1..length(str),substring(str,#-1,#)); + forall(1..length(ifL),kk, + tmp1=ifL_kk_1; + tmp2=ifL_kk_2; + tmp=select(cpL,#_2==kk); + tmp3=apply(tmp,#_1); + sL_tmp1=" "; + sL_tmp2=";end;"; + sL_(tmp3_1)=" then,"; + if(length(tmp3)>1, + sL_(tmp3_2)=";else,"; + ); + ); + tmp=sum(sL); +); + +Fortosci(strorg):=( + regional(str,jj,var,tmp,tmp1,tmp2,tmp3,tmp4, + Out,repL,Pflg,Iflg,Cflg); + str=strorg; + repL=[]; + tmp1=Indexall(str,"forall"); + tmp2=Indexall(str,","); + forall(1..length(tmp1),jj, + tmp=select(tmp2,#>tmp1_jj); + var=substring(str,tmp_1,tmp_2-1); + tmp3=substring(str,tmp1_jj-1,tmp_2-1); + tmp=indexof(tmp3,"("); + tmp4=substring(tmp3,tmp,length(tmp3)); + tmp=indexof(tmp4,","); + tmp4=substring(tmp4,0,tmp-1); + tmp4="for "+var+"="+tmp4; + tmp4=replace(tmp4,"..",":"); + repL=concat(repL,[tmp3,tmp4]); + ); + forall(1..length(repL)/2, + str=replace(str,repL_(2*#-1),repL_(2*#)); + ); + tmp=Bracket(str); + tmp=select(tmp,#_2==0); + tmp=tmp_1_1; + tmp1=substring(str,tmp-1,length(str)); + tmp1=replace(tmp1,")",";end"); + str=substring(str,0,tmp-1)+tmp1; + str=replace(str,";;",";"); + str; +); + +Deffun(name,bodylist):=( +//help:Deffun("f(x)",["regional(y)","y=x^2*(x-3)","y"]); // 16.02.18 + regional(funstr,tmp,tmp1,str,Pos); + funstr=name+":=("; + forall(bodylist, + funstr=funstr+#+";"; + ); + funstr=funstr+");"; + parse(funstr); + tmp=bodylist_(length(bodylist)); + str="function "+tmp+"="+name+","; + forall(1..(length(bodylist)-1), + tmp1=bodylist_#; + tmp1=replace(tmp1,LFmark,"");// 16.05.26 + tmp1=replace(tmp1," ","");// 16.05.26 + Pos=indexof(tmp1,"regional")+indexof(tmp1,"local"); + if(Pos==0, + tmp=replace(tmp1,".xy",""); + tmp=replace(tmp,".x","(1)"); + tmp=replace(tmp,".y","(2)"); + if(indexof(tmp,"if(")>0, + tmp=iftosci(tmp); + ); + if(indexof(tmp,"forall(")>0, // 16.05.26from + tmp=Fortosci(tmp); + ); // 16.05.26upto + str=str+tmp+","; + ); + ); + str=str+"endfunction;"; + FUNLIST=append(FUNLIST,str); +); + +Windispg():=( + regional(Nj,Nk,Dt,Vj,tmp,tmp1,tmp2,tmp3,opcindy); + gsave(); + layer(KETPIClayer); + forall(GCLIST,Nj, + if(isstring(Nj_1),Dt=parse(Nj_1),Dt=Nj_1); // 11.17 + if(islist(Dt) & length(Dt)>0, // 12.19,12.22 + tmp=MeasureDepth(Dt); + if(tmp==1,Dt=[Dt]); + opcindy=Nj_3; + if(Nj_2<0,tmp1=0,tmp1=Nj_2); + if(tmp1<10, + forall(Dt,Nk, +// tmp2=apply(Nk,if(ispoint(#),Lcrd(#),#)); +// tmp2=apply(tmp2,Pcrd(#)); + tmp2=Nk; // 14.12.04 + if(length(Nk)>1, + forall(2..length(Nk), + tmp3=textformat(Nk_[#-1,#],5); + tmp3=substring(tmp3,1,length(tmp3)-1); + if(tmp1==1,opcindy=opcindy+",dashpattern->[2,2]"); + tmp="draw("+tmp3+ + ",dashtype->"+text(tmp1)+",linecolor->"+KCOLOR+opcindy+")"; + parse(tmp); + ); + , + if(length(Nk)==1, + tmp="draw("+text(tmp2_1)+opcindy+")"; // 14.12.31 + parse(tmp); + ); + ); + ); + ); + ); + ); +// if(ADDAXES=="1", // 16.10.08from +// draw([XMIN,0],[XMAX,0],color->[0,0.2,0]); +// draw([0,YMIIN],[0,YMAX],color->[0,0.2,0]); +// Letter([[XMAX,0],"e","x",[0,YMAX],"n","y"]); +// Letter([[0,0],"sw","O"]); +// ); // 16.10.08upto + grestore(); + layer(0); +); +</script> + <script type="text/javascript"> +var cdy = CindyJS({ + scripts: "cs*", + defaultAppearance: { + dimDependent: 0.7, + fontFamily: "sans-serif", + lineSize: 1, + pointSize: 5.0, + textsize: 12.0 + }, + angleUnit: "°", + geometry: [ + {name: "SW", type: "Free", pos: [-2.5744680851063833, -4.0, 0.8525536333742482], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "NE", type: "Free", pos: [4.0, 2.4285714285714284, 0.44032989855593035], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "A", type: "Free", pos: [0.0, -4.0, -0.8], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "B", type: "Free", pos: [-0.02366863905325444, -4.0, 0.9484028584281579], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "a", type: "Segment", color: [0.0, 0.0, 1.0], args: ["A", "B"], labeled: true}, + {name: "C", type: "PointOnSegment", pos: [0.011092747971205843, -4.0, -1.619421523013707], color: [1.0, 0.0, 0.0], args: ["a"], labeled: true}, + {name: "E", type: "Free", pos: [0.0, -4.0, 0.6666666666666666], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "F", type: "Free", pos: [4.0, -2.1818181818181817, 0.36363636363636365], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "b", type: "Segment", color: [0.0, 0.0, 1.0], args: ["E", "F"], labeled: true}, + {name: "G", type: "PointOnSegment", pos: [3.5770716007636896, -4.0, 0.6666666666666666], color: [1.0, 0.0, 0.0], args: ["b"], labeled: true}, + {name: "H", type: "Free", pos: [0.0, -4.0, 0.5714285714285714], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "K", type: "Free", pos: [4.0, -2.5454545454545454, 0.36363636363636365], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "c", type: "Segment", color: [0.0, 0.0, 1.0], args: ["H", "K"], labeled: true}, + {name: "L", type: "PointOnSegment", pos: [0.5714285657142855, -4.0, 0.5714285714285713], color: [1.0, 0.0, 0.0], args: ["c"], labeled: true}, + {name: "M", type: "Free", pos: [-2.0, -4.0, -1.0], color: [1.0, 0.0, 0.0], size: 2.0}, + ], + ports: [{ + id: "CSCanvas", + width: 1024, + height: 545, + transform: [{visibleRect: [-9.745440419289913, 6.700770173058494, 15.809824598259054, -6.900420681008095]}], + axes: true, + grid: 1.0, + snap: true, + background: "rgb(168,176,192)" + }], + csconsole: false, + cinderella: {build: 1901, version: [2, 9, 1901]} +}); + </script> +</head> +<body> + <div id="CSCanvas"></div> +</body> +</html> diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindyon.html b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindyon.html new file mode 100644 index 00000000000..cf5b564e040 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindyon.html @@ -0,0 +1,6640 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + + <title>s1602diffeq2.cdy</title> + <style type="text/css"> + * { + margin: 0px; + padding: 0px; + } + + #CSConsole { + background-color: #FAFAFA; + border-top: 1px solid #333333; + bottom: 0px; + height: 200px; + overflow-y: scroll; + position: fixed; + width: 100%; + } + </style> + <link rel="stylesheet" href="https://cindyjs.org/dist/v0.8/CindyJS.css"> + <script type="text/javascript" src="https://cindyjs.org/dist/v0.8/Cindy.js"></script> + <script type="text/javascript" src="https://cindyjs.org/dist/v0.8/KetCindyPlugin.js"></script> +<script id="csdraw" type="text/x-cindyscript"> +Ketinit(); + +//Deqplot("1","y`=y","x",0,1); +Deqplot("2","y``=-L.x*y`-G.x*y","t=[0,XMAX]",0,[C.y,0],["Num=200"]); +//Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",0,A,["Num=200"]); + +Expr([M,"e","\displaystyle\frac{d^2 x}{dt^2}+"+L.x+"\frac{dx}{dt}+"+G.x+"x=0"]); + +Windispg(); + +//Help("De"); + +; +</script> +<script id="cskeytyped" type="text/x-cindyscript"> +if(key()=="?" % keydownlist()==[32], + if(!isreal(NumTyped),NumTyped=0); + if(NumTyped==0, + DispStr= + "Figure(1) Parent(2) Parapara(3) Movie(4) Surf(5)"; + ); + if(NumTyped==1, + DispStr= + "Shift+ Title(T) Para(P) Slide(S) Digest(D)"; + ); + if(NumTyped==2, + DispStr="Shift+ Meshlab(M)"; + ); + if(NumTyped==3, + DispStr= + "Ch : disp(0) chg(9) N(+,-) add(<) rmv(>)"; + ); + drawtext(mouse().xy,DispStr,size->24); + NumTyped=mod(NumTyped+1,4); +, + NumTyped=0; +); +if(key()=="1",//Mkfigure + Viewtex(); + kc(); +); +if(key()=="2",//Mkparent + Viewparent(); +); +if(key()=="3",//Flipbook(Parapara) + Flipbook(); +); +if(key()=="4",//Texmovie + Texmovie(); + kc(); +); +if(key()=="5",//Surface + Cheader(); + Cmain(); + kcC(); + if(ChNum>0, + Ch=[ChNum]; + , + Ch=[1]; + ); + ChNum=0; +); +if(key()=="T",//Title + Maketitle(); +); +if(key()=="P",//ParaF + Parafolder(); +); +if(key()=="S",//Slide + Mkslides(); +); +if(key()=="D",//Digest(Summary) + Mkslidesummary(); +); +if(key()=="M",//Meshlab + Mkviewobj(OCNAME,OBJCMD,OCOPTION); +); + +if(key()=="0", + Dispchoice(); +); +if(key()=="9", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=append(Ch,ChNum); + ChNum=Ch_(length(Ch)-1); + Ch=remove(Ch,[ChNum]); + Ch=sort(Ch); + ); + ); + Dispchoice(); +); +if(key()=="+", + ChNum=ChNum+1; + Dispchoice(); +); +if(key()=="-", + ChNum=ChNum-1; + Dispchoice(); +); +if(key()=="<", + if(length(select(Ch,#==ChNum))==0, + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ChNum=ChNum+1; + ); + Dispchoice(); +); +if(key()=="^", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=Ch_(1..(length(Ch)-1)); + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ); + ); + ChNum=ChNum+1; + Dispchoice(); +); +if(key()=="~", + if(length(Ch)==0, + Ch=[ChNum]; + , + if(!contains(Ch,ChNum), + Ch=Ch_(1..(length(Ch)-1)); + Ch=append(Ch,ChNum); + Ch=sort(Ch); + ); + ); + ChNum=max(ChNum-1,1); + Dispchoice(); +); +if(key()==">", + if(length(Ch)>0, + ChNum=Ch_(length(Ch)); + Ch=Remove(Ch,[ChNum]); + ); + Dispchoice(); +); +; +</script> +<script id="csinit" type="text/x-cindyscript"> +// 17.08.26 Slider +// 16.11.27 +Ketinit():=Ketinit(1); +Ketinit(sy):=Ketinit(sy,[-5,5],[-5,5]); +Ketinit(sy,rangex,rangey):=( + regional(pt,tmp,tmp1,tmp2); + PenThickInit=8; + ULEN="1cm"; + KETPICLAYER=20; + MilliIn=1/2.54*1000; + PenThick=round(MilliIn*0.02); + PenThickInit=PenThick; + TenSizeInit=0.02; + TenSize=TenSizeInit; + YaSize=1; YaAngle=18; YaPosition=1; + YaThick=1; YaStyle='tf'; + KETPICCOUNT=1; + KCOLOR=[0,0,0]; + GLIST=[]; + GCLIST=[]; +// GDATALIST=[]; + GOUTLIST=[]; + POUTLIST=[]; + VLIST=[]; + FUNLIST=[]; + LETTERlist=[]; + COM0thlist=[]; + COM1stlist=[]; + COM2ndlist=[]; + SCIWRLIST=[]; + SCIRELIST=[]; + ADDAXES="1"; + LFmark=unicode("000a"); + Dq=unicode("0022"); + WaitUnit=10; + CONTINUED=0; + OutComList=[]; + OutFileLIst=[]; // 15.10.22 + FigPdfList=[]; // 16.04.08 + ADDPACK=[]; // 16.05.16 + ErrFlag=0; + setdirectory(Dirwork); + if(isstring(Fhead), // 15.04.06 + Fnametex=Fhead+".tex"; + Fnamesci=Fhead+".sce"; + Fnamescibody=Fhead+"body.sce"; + Fnameout=Fhead+".txt"; + ); + if(!isstring(Mackc),// 16.06.07 + Mackc="sh"; + ); + ArrowlineNumber=1; // 15.01.05 + ArrowheadNumber=1; + BezierNumber=1; //15.01.03 + SCALEX=1; + SCALEY=sy; +// Setscaling(sy); + XMIN=rangex_1/SCALEX; + XMAX=rangex_2/SCALEX; + YMIN=rangey_1/SCALEY; + YMAX=rangey_2/SCALEY; + Setwindow("Msg=n"); // 16.05.31 +); + +DqDq(str):=unicode("0022")+str+unicode("0022"); + +Tab2list(dtstr):=Tab2list(dtstr,[]); +Tab2list(dtstr,options):=( +//help:Tab2list(datastr); +//help:Tab2list(options=[0]); + regional(dtall,dt,rep,out,crm,lfm,htm,first,tmp,tmp1,tmp2); + crm=unicode("000d"); + lfm=unicode("000a"); + htm=unicode("0009"); + rep=0; + if(length(options)>0,rep=options_1); + first=lfm; // 16.09.05from + if(indexof(dtstr,crm)>0, + first=crm; + if(indexof(dtstr,crm+lfm)>0, + first=first+lfm; + ); // 16.09.05upto + ); + tmp1=Indexall(dtstr,first); + tmp1=prepend(0,tmp1); + tmp1=append(tmp1,length(dtstr)); + dtall=[]; + forall(1..(length(tmp1)-1), + tmp=substring(dtstr,tmp1_#,tmp1_(#+1)-1); + if(length(tmp)>0, + dtall=append(dtall,tmp); + ); + ); + out=[]; + forall(dtall,dt, + tmp1=tokenize(dt,unicode("0009")); + tmp2=[]; + forall(tmp1, + if(isstring(#),tmp=parse(#),tmp=#); + if(!isreal(tmp), + if(length(#)>0,tmp=#,tmp=rep); + ); + tmp2=append(tmp2,tmp); + ); + out=append(out,tmp2); + ); + out; +); + +Columnlist(dt,list):=( // 16.09.04 +//help:Columnlist(dt,1..3); + apply(dt,#_list); +); + +Dispmat(dt):=( // 16.09.16 +//help:Dispmat(dt); + regional(htm,crm,lfm,row,tmp,tmp1,tmp2); + htm=unicode("0009"); + crm=unicode("000d"); + lfm=unicode("000a"); + tmp2=""; + forall(dt,row, + tmp1=""; + forall(row, + if(isstring(#), + tmp1=tmp1+#+htm; + , + tmp1=tmp1+text(#)+htm; + ); + ); + tmp1=substring(tmp1,0,length(tmp1)-1); + tmp1=tmp1+lfm; + tmp2=tmp2+tmp1; + ); + print(tmp2); + println(); +); + +norm(v1):=( // 16.09.01 +//help:norm([2,1,3]); + regional(out,tmp,tmp1,tmp2); + out=0; + forall(1..length(v1), + out=out+(v1_#)^2; + ); + out=sqrt(out); + out; +); +norm(v1,v2):=( + norm(v2-v1); +); + +// 16.03.28 +Removespace(str):=( +//help:Removespace(" a b c "); + regional(tmp,flg,out); + tmp=length(str)+1; + flg=0; + forall(1..length(str), + if(flg==0, + if((str_#)!=" ", + tmp=#; + flg=1; + ); + ); + ); + out=substring(str,tmp-1,length(str)); + flg=0; + tmp=0; + forall(reverse(1..length(out)), + if(flg==0, + if((out_#)!=" ", + tmp=#; + flg=1; + ); + ); + ); + out=substring(out,0,tmp); +); + +Indexall(str,key):=( + regional(rest,out,flg,tmp,tmp1,); + out=[]; + rest=str; + flg=0; + forall(1..length(str), + if(flg==0, + tmp=indexof(rest,key); + if(tmp>0, + tmp1=tmp+length(str)-length(rest); + out=append(out,tmp1); + rest=substring(rest,tmp,length(rest)); + , + flg=1; + ); + ); + ); + out; +); + +Changestyle(nameL,style):=( +//help:Changestyle(["sgAB"],["da"]); + regional(nmL,name,Ltype,Ltypeorg,Noflg,opcindy,tmp); + tmp=Divoptions(style); + Ltypeorg=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + if(islist(nameL),nmL=nameL,nmL=[nameL]); + forall(nmL,name, + Ltype=Ltypeorg; + GCLIST=select(GCLIST,#_1!=name); + COM2ndlist=select(COM2ndlist,indexof(#,"("+name)==0); // 15.05.23 + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); +); + +Op(n,object):=( // 16.05.25 +//help:Op(4,[1,2,3,4]); +//help:Op(3,"abcd"); + regional(out); + if(islist(object), + out=object_n; + , + if(isstring(object), + out=substring(object,n-1,n); + ); + ); + out; +); + +Toupper(str):=( + regional(alphabet,out,tmp,tmp1); + alphabet="abcdefghijklmnopqrstuvwxyz"; + out=""; + forall(1..length(str), + tmp=substring(str,#-1,#); + tmp1=indexof(alphabet,tmp); + if(tmp1>0, + out=out+unicode(text(tmp1+64),base->10); + , + out=out+tmp; + ); + ); + out; +); + +Textformat(value,dig):=( +//help:Textformat(2/3,4); +//help:Textformat([gr1,gr2],5); + regional(vv,tmp,tmp1); + if(islist(value), + tmp1="["; + forall(value, + tmp1=tmp1+Textformat(#,dig)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]"; + , + if(ispoint(value) % isstring(value), +// vv=Lcrd(value); +// tmp1=Textformat(vv,dig); +// tmp1=text(value); // 15.04.07 + if(isstring(value),tmp1=Dq+value+Dq,tmp1=text(value)); // 15.10.02 + , + tmp1=format(value,dig); + ); + ); + tmp1; +); + +Sprintf(value,dig):=( +//help:Sprintf(5.1,4); + regional(vv,tmp,tmp1); + if(!islist(value), + vv=Textformat(value,dig); + if(indexof(vv,".")==0,vv=vv+"."); + vv=vv+"0000000000000000"; + tmp=indexof(vv,".")+dig; + vv=substring(vv,0,tmp); + , + vv=apply(value,Sprintf(#,dig)); + ); + vv; +); + +Assign(funstr,vrL):=( + regional(nn,out,tmp,tmp1); + nn=length(vrL)/2; + out=funstr; + forall(1..nn, + out=Assign(out,vrL_(2*#-1),vrL_(2*#)); + ); + out; +); + +Assign(funstr,varname,rep):=( +//help:Assign("x^2+a*x","a",1.3); +//help:Assign("a*x^2+b*x",["a",1,"b",2]); + regional(repstr,ii,jj,tmp,tmp1,tmp2,Notvar,Flg); + if(isstring(rep),repstr=rep,repstr="("+Textformat(rep,5)+")"); // 15.02.09, 07.06 + tmp=[46]; // 12.20 + tmp=concat(tmp,48..57); + tmp=concat(tmp,65..90); + tmp=concat(tmp,97..122); + Notvar=apply(tmp,unicode(text(#),base->10)); + tmp2=""; + forall(1..100, + ii=indexof(funstr,varname); + if(ii>0, + Flg=0; + if(ii>1, + tmp=substring(funstr,ii-2,ii-1); + if(contains(Notvar,tmp), + tmp2=tmp2+substring(funstr,0,ii); + funstr=substring(funstr,ii,length(funstr)); + Flg=1; + ); + ); + if(Flg==0, + jj=ii-1+length(varname); + if(jj<length(funstr), + tmp=substring(funstr,jj,jj+1)); + if(contains(Notvar,tmp), + tmp2=tmp2+substring(funstr,0,jj); + funstr=substring(funstr,jj,length(funstr)); + Flg=1; + ); + ); + if(Flg==0, + tmp2=tmp2+substring(funstr,0,ii-1)+repstr; + funstr=substring(funstr,jj,length(funstr)); + ); + ); + ); + funstr=tmp2+funstr; + funstr; +); + +MeasureDepth(list):=( + regional(tmp,Depth,Flg); + Flg=0; + Depth=0; + if(ispoint(list), // 15.01.22 + Depth=0; + Flg=1; + , + tmp=list_1; + ); + repeat(4, + if(Flg==0, + if(islist(tmp), + tmp=tmp_1; + Depth=Depth+1; + , + if(ispoint(tmp),Depth=Depth+1); + Flg=1; + ); + ); + ); + Depth; +); + +Flattenlist(pltlist):=( +//help:Flattenlist([[2,3],[[1,2],[5,6]]]); + regional(Out,nn,Dt,ii,tmp,flg); + Out=[]; + if(MeasureDepth(pltlist)==1, + Out=[pltlist]; + , + forall(1..length(pltlist),nn, + Dt=pltlist_nn; + if(MeasureDepth(Dt)<2, + Out=append(Out,Dt); + , + forall(1..length(Dt),ii, + tmp=Flattenlist(Dt_ii); + Out=concat(Out,tmp); + ); + ); + ); + ); + Out; +); + +Divoptions(options):=( +//help:Divoptions(options); + regional(Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy,flg,tmp,tmp1); + Ltype="dr"; // 2015.01.13 + Noflg=0; + Inflg=0; + Outflg=0; + eqL=[]; + realL=[]; + strL=[]; + opstr=""; + opcindy=""; + forall(options, + flg=0; + if(flg==0, + if(isreal(#) % ispoint(#) % islist(#), + realL=append(realL,#); + opstr=opstr+","+text(#); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"=")>0, + eqL=append(eqL,#); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"no")+indexof(#,"No")>0, + if(indexof(#,"tex")>0,Noflg=1); + if(indexof(#,"disp")>0,Noflg=2); + if(indexof(#,"data")>0,Noflg=3); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"->")>0, + opcindy=opcindy+","+#; + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"out")+indexof(#,"Out")>0, + if(indexof(#,"-")==0, + Outflg=1; + , + Outflg=2; + ); + flg=1; + ); + ); + if(flg==0, + if(indexof(#,"in")+indexof(#,"In")>0, + if(indexof(#,"-")==0, + Inflg=1; + , + Inflg=2; + ); + flg=1; + ); + ); + if(flg==0, + tmp=substring(#,0,2); + tmp1=indexof(tmp,"dr")+indexof(tmp,"Dr"); + tmp1=tmp1+indexof(tmp,"da")+indexof(tmp,"Da"); + tmp1=tmp1+indexof(tmp,"id")+indexof(tmp,"Id"); + tmp1=tmp1+indexof(tmp,"do")+indexof(tmp,"Do"); + tmp1=tmp1+indexof(tmp,"dp")+indexof(tmp,"Dp"); + if(tmp1>0, + Ltype=#; + flg=1; + ); + if(flg==0, + strL=append(strL,#); + opstr=opstr+","+Dq+#+Dq; + ); + ); + ); + if(indexof(opcindy,"color->")==0,// 16.10.07from + opcindy=opcindy+",color->[0,0,0]"; + ); + [Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy]; +); + +Dotprod(vec1,vec2):=( +//help:Dotprod(vec1,vec2); + regional(v1,v2,tmp); + if(ispoint(vec1),v1=vec1.xy,v1=vec1); + if(ispoint(vec2),v2=vec2.xy,v2=vec2); + v1*v2; +); + +Crossprod(a,b):=( +//help:Crossprod(vec1,vec2); + regional(tmp1,tmp2,tmp3,Out); + if(length(a)==3, + tmp1=a_2*b_3-a_3*b_2; + tmp2=a_3*b_1-a_1*b_3; + tmp3=a_1*b_2-a_2*b_1; + Out=[tmp1,tmp2,tmp3]; + , + Out=a_1*b_2-a_2*b_1; + ); + Out; +); + +Ptstart(Fig):=( +//help:Ptstart("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); // 16.01.21 + tmp_1; +); + +Ptend(Fig):=( +//help:Ptend("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); + tmp_(length(tmp)); // 15.04.12 +); + +Numptcrv(Fig):=( +//help:Numptcrv("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); // 15.12.23 + length(tmp); +); + +Ptcrv(Num,Fig):=( +//help:Ptcrv(10,"gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); + tmp_Num; +); + +Invert(Fig):=( +//help:Invert("gr1"); + regional(tmp); + if(isstring(Fig),tmp=parse(Fig),tmp=Fig); // 16.01.27 + reverse(tmp); +); +Invert(nm,Fig):=Invert(nm,Fig,["nodisp"]); // from 16.01.27 +Invert(nm,Fig,options):=( +//help:Invert("1","gr1"); + regional(name,tmp); + name="-inv"+nm; + tmp=Invert(Fig); + Listplot(name,tmp,options); +);// upto 16.01.27 + +Paramoncrv(pP,Gdata):=( + regional(Tmp,PtL); +// Eps=10^(-8); + if(isstring(Gdata),PtL=parse(Gdata),PtL=Gdata); + Tmp=Nearestpt(pP,PtL); + Tmp_2; +); + +ParamonCurve(pP,nN,plist):=( +//help:ParamonCurve(A,10,"gr1"); + regional(PtL,Out,Pa,Pb,vV,vW,sS); + if(isstring(plist),PtL=parse(plist),PtL=plist); + PtL=apply(PtL,LLcrd(#));//16.10.16 + if(nN==length(PtL), + Out=nN; + , + Pa=PtL_nN; + Pb=PtL_(nN+1); + vV=Pb-Pa; + vW=pP-Pa; + sS=vV*vW/|vV|^2; + sS=min([max([sS,0]),1]); + Out=nN+sS; + ); + Out; +); + +Pointoncrv(tT,PtL):=PointonCurve(tT,PtL); +PointonCurve(tT,Gdata):=( +//help:PointonCurve(20.5,"gr1"); + regional(Out,Eps,nN,sS,Pa,Pb,PtL); + if(isstring(Gdata),PtL=parse(Gdata),PtL=Gdata); + if(length(PtL)==1,PtL=PtL_1); + Eps=10^(-4); + nN=floor(tT+Eps); + sS=max([tT-nN,0]); + if(nN==length(PtL), + Out=PtL_nN; + , + Pa=PtL_nN; + Pb=PtL_(nN+1); + Out=(1-sS)*Pa+sS*Pb; + ); + Out; +); + +Koutenseg(pA,pB,pC,pD):=Koutenseg(pA,pB,pC,pD,[]); +Koutenseg(pA,pB,pC,pD,options):=( + regional(Eps0,Eps,Eps2,pV,Sv2,Out,pP,pQ,Flg,p1,p2,q1,q2, + em1,eM1,em2,eM2,rT,Tmp1,Tmp2); + Eps0=10^(-4); + pV=pB-pA; + Sv2=|pV|; + pP=pC-pA; pQ=pD-pA; + Eps=10^(-3); + Eps2=0.2; + Tmp1=0; + forall(options, + if(Tmp1==0, + Eps=#; + Tmp1=1; + , + Eps2=#; + ); + ); + Flg=0; + if(Sv2<10^(-3), + Out=["inf","inf"]; + Flg=1; + ); + if(Flg==0, + Eps=min([Eps2,Eps/Sv2]); + p1=pP*pV/Sv2^2; + p2=[pP_2,-pP_1]*pV/Sv2^2; + q1=pQ*pV/Sv2^2; + q2=[pQ_2,-pQ_1]*pV/Sv2^2; + em1=-Eps; eM1=1+Eps; + em2=-Eps; eM2=Eps; + if(max([p1,q1])<em1 % min([p1,q1])>eM1, + Out=["inf","inf"]; + Flg=1; + ); + if(max([p2,q2])<em2 % min([p2,q2])>eM2, + Out=["inf","inf"]; + Flg=1; + ); + ); + if(Flg==0 & p2*q2<0, + rT=p1-(q1-p1)/(q2-p2)*p2; + if(rT>em1 & rT<eM1, + if(rT>-Eps0 & rT<1+Eps0, + Tmp1=pA+rT*pV; + Tmp2=min([max([rT,0]),1]); + Out=[Tmp1,Tmp2,0]; + , + Tmp1=pA+rT*pV; + Tmp2=min([max([rT,0]),1]); + Out=[Tmp1,Tmp2,1]; + ); + Flg=1; + ); + if(Flg==0 & (p1<em1 % p1>eM1 % p2<em2 % p2>eM2), + if(q1<em1 % q1>eM1 % q2<em2 % q2>eM2, + Out=["inf","inf"]; + Flg=1; + ); + if(Flg==0, + rT=min([max([p1,0]),1]); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + Flg=1; + ); + ); + ); + if(Flg==0 & (p1 > -Eps0 & p1 < 1 + Eps0 & p2 > -Eps0 & p2 < Eps0), + rT= p1; + Tmp1=pA+rT*pV; + Out= [Tmp1, rT, 0]; + Flg=1; + ); + if(Flg==0 & (q1 > -Eps0 & q1 < 1 + Eps0 & q2 > -Eps0 & q2 < Eps0), + rT= q1; + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,0]; + Flg=1; + ); + if(Flg==0 & (p1<em1 % p1>eM1 % p2<em2 % p2>eM2), + if(q1<em1 % q1>eM1 % q2<em2 % q2>eM2, + Out=["inf","inf"]; + Flg=1; + ); + if(Flg==0, + rT=min([max([q1,0]),1]); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + Flg=1; + ); + ); + if(Flg==0 & (q1<em1 % q1>eM1% q2<em2 % q2>eM2), + rT=min([max([p1,0]),1]); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + Flg=1; + ); + if(Flg==0, + if(abs(p2)<abs(q2), + rT=min([max([p1,0]),1]); + , + rT=min([max([q1,0]),1]); + ); + Tmp1=pA+rT*pV; + Out=[Tmp1,rT,1]; + ); + Out; +); + +IntersectcrvsPp(Gr1,Gr2):=IntersectcrvsPp(Gr1,Gr2,[]); +IntersectcrvsPp(Gr1,Gr2,options):=( +//help:IntersectcrvsPp("gr1","pa1"); + regional(Out,Eps,Eps2,Eps0,Flg,Data1,Data2, + Tmp1,Tmp2,Tmp3,Tmp,KL1,KL2,pA,pB,Ni,Nj, + pP,pQ,rT,Flg,eqL,realL,opstr,Dif); + Eps=10^(-4); + Eps2=0.1; + Dif=0.05; // 2015.05.31 + Flg=0; + Tmp1=Divoptions(options); // + eqL=Tmp1_5; + realL=Tmp1_6; + opstr=Tmp1_(length(Tmp1)); + forall(eqL, + if(substring(#,0,1)=="D", + Tmp1=indexof(#,"="); + Dif=parse(substring(#,Tmp1,length(#))); + ); + ); + Tmp1=length(realL); + if(Tmp1>0, + Eps=realL_1; + if(Tmp1>1, + Eps2=realL_2; + ); + ); + Flg=0; + if(isstring(Gr1),Data1=parse(Gr1),Data1=Gr1); + if(isstring(Gr2),Data2=parse(Gr2),Data2=Gr2); + if(MeasureDepth(Data1)==2,Data1=Data1_1); + if(MeasureDepth(Data2)==2,Data2=Data2_1); + Data1=apply(Data1,LLcrd(#)); + Data2=apply(Data2,LLcrd(#)); + if(length(Data1)==length(Data2), + Tmp1=Reverse(Data2); + Eps0=10^(-6); + Tmp2=0; + forall(1..length(Data1), + Tmp2=Tmp2+abs(Data1_#-Data2_#); + ); + Tmp3=0; + forall(1..length(Data1), + Tmp3=Tmp3+abs(Data1_#-Tmp1_#); + ); + if(Tmp2<Eps0 % Tmp3<Eps0, + Out=[]; + Flg=1; + ); + ); + if(Flg==0, + KL1=[]; + KL2=[]; + forall(1..(length(Data1)-1),Ni, + pA=Data1_Ni; + pB=Data1_(Ni+1); + forall(1..(length(Data2)-1), + pP=Data2_#; pQ=Data2_(#+1); + Tmp=Koutenseg(pA,pB,pP,pQ,[Eps,Eps2]); + if(Tmp!=["inf","inf"], + if(Tmp_3==0, + Tmp1=[Tmp_1,Tmp_2,Ni,#]; + KL1=concat(KL1,[Tmp1]); + , + Tmp2=[Tmp_1,Tmp_2,Ni,#]; + KL2=concat(KL2,[Tmp2]); + ); + ); + ); + ); + Out=[]; + if(length(KL1)>0, + Tmp=KL1_1; + pP=Tmp_1; + rT=Tmp_2; + Ni=Tmp_3; + Nj=Tmp_4; + Tmp=[pP,Ni+rT,Nj]; + Out=[Tmp]; + ); + forall(2..length(KL1),Ni, + Tmp=KL1_Ni; + pP=Tmp_1; + Tmp2=0; + Flg=0; + forall(1..length(Out),Nj, + if(Flg==0, + Tmp=Out_Nj; + if(|pP-Tmp_1|<Eps, + Tmp2=1; + Flg=1; + ); + ); + ); + if(Tmp2==0, + Tmp=KL1_Ni; + pP=Tmp_1; + rT=Tmp_2; + Tmp1=Tmp_3; + Tmp2=Tmp_4; + Tmp=[pP,Tmp1+rT,Tmp2]; + Out=concat(Out,[Tmp]); + ); + ); + forall(1..length(KL2),Ni, + Tmp=KL2_Ni; // 15.11.21 Usui + pP=Tmp_1; + Tmp2=0; + Flg=0; + forall(1..length(Out),Nj, + if(Flg==0, + Tmp=Out_Nj; + if(|pP-Tmp_1|<Eps, + Tmp2=1; + Flg=1; + ); + ); + ); + if(Tmp2==0, + Tmp=KL2_Ni; + rT=Tmp_2; + rT=min([max([rT,0]),1]); // 15.11.21 Usui + Tmp=[pP,Tmp_3+rT,Tmp_4]; + Out=concat(Out,[Tmp]); + ); + ); + ); + Tmp1=Out; // 15.04.06 from + Out=[]; + forall(Tmp1,Tmp2, + Tmp3=select(1..(length(Out)),|Out_#_1-Tmp2_1|<Dif);//16.11.27 + if(length(Tmp3)==0, + Out=append(Out,Tmp2); + , + forall(Tmp3,//16.11.27 + Out_#=(Out_#+Tmp2)/2; + ); + ); + ); // 15.04.06 upto + Out; +); + +Intersectcrvs(Gr1,Gr2):=Intersectcrvs(Gr1,Gr2,[]); +//help:Intersectcrvs("gr1","pa1"); +Intersectcrvs(Gr1,Gr2,options):=( + regional(tmp,tmp1,tmp2); + tmp1=IntersectcrvsPp(Gr1,Gr2,options); + apply(tmp1,#_1); +); + +NearestptcrvPhy(point,PL):=( + regional(tmp,pP,plist); + pP=Pcrd(point); + if(isstring(PL),plist=parse(PL),plist=PL); + if(MeasureDepth(plist)==2,plist=plist_1); + plist=apply(plist,#); // 14.12.18 + tmp=Nearestpt(pP,plist); + tmp=tmp_1; + [tmp_1/SCALEX,tmp_2/SCALEY]; +); + +Nearestptcrv(point,plist):=( +//help:Nearestptcrv(A,"gr1"); + regional(tmp); + tmp=Nearestpt(point,plist); + tmp_1; +); + +Nearestpt(point,PL2):=( + regional(PL1,PL,Ans,Flg,Eps,pA,Pm,Im,Sm,Nn,Ni, + a1,b1,a2,b2,v1,v2,x1,x2,Tmp,rT,pP,sS,Lm,Pm,Sm,Flg); +//help:Nearestpt("gr1","gr2"); + if(isstring(point),PL1=parse(point),PL1=point); + if(MeasureDepth(PL1)==2,PL1=PL1_1); + if(!islist(PL1_1), + PL1=[PL1]; + Flg=0; + , + Flg=1; + ); + if(isstring(PL2),PL=parse(PL2),PL=PL2); + if(MeasureDepth(PL)==2,PL=PL_1); + Eps=10^(-6); + Ans=[PL1_1,1,PL_1,1,|PL1_1-PL_1|]; + forall(1..length(PL1),Nn, // 16.05.04 + pA=PL1_Nn; + Pm=PL_1; + Im=1; + Sm=|Pm-pA|; + forall(1..(length(PL)-1),Ni, + a1=PL_Ni_1; a2=PL_Ni_2; + b1=PL_(Ni+1)_1; b2=PL_(Ni+1)_2; + v1=b1-a1; v2=b2-a2; + x1=pA_1; x2=pA_2; + Tmp=v2^2+v1^2; + if(abs(Tmp)>Eps, + rT=(-a2*v2-v1*a1+v1*x1+x2*v2)/Tmp; + if(rT<-Eps, + pP=[a1,a2]; + , + if(rT>1+Eps, + pP=[b1,b2]; + , + pP=[a1+rT*v1,a2+rT*v2]; + ); + ); + sS=|pP-pA|; + if(sS<Sm-Eps, + Tmp=ParamonCurve(pP,Ni,PL); + Pm=pP; Lm=Tmp; Sm=sS; + ); + ); + if(Sm<Ans_5, // 16.05.03from + Ans=[pA,Nn,Pm,Lm,Sm]; + ); + ); // 16.05.03upto + ); + if(Flg==0, + Ans=Ans_(3..5); + ); + Ans; +); + +Derivative(fun,var,value):=( +//help:Derivative("x^3","x",2); + regional(str,tmp); + str="d("; + str=str+replace(fun,var,"#")+","; + str=str+value+")"; + tmp=Pcrd([1,parse(str)]); // 14.11.08 + tmp_2; +); + +Integrate(pltdata,range):=Integrate(pltdata,range,[]); +Intergrate(Arg1,Arg2,Arg3):=( + regional(pltdata,range,options,fnstr,vartr); + if(islist(Arg2), + pltdata=Arg1; + range=Arg2; + options=Arg3; + Integrate(pltdata,range,options); + , + fnstr=Arg1; + vastr=Arg2; + range=Arg3; + Integrate(fnstr,vastr,range,[]); + ); +); + +Integrate(pltdata,range,options):=( +//help:Integrate("gr1",[1,3]); +//help:Integrate("gr1",[1,3],["Rule=t"]); + regional(tmp,tmp1,eqL,Rule,pdata,Sm,ptP,ptQ,list,va1,va2); + tmp=Divoptions(options); + eqL=tmp_5; + Rule="o"; + forall(eqL, + if(Toupper(substring(#,0,1))=="R", + tmp=indexof(#,"="); + Rule=substring(#,tmp,tmp+1); + ); + ); + if(Rule=="o", + Sm= IntegrateO(pltdata,range); + , + if(isstring(pltdata),pdata=parse(pltdata),pdata=pltdata); + if(MeasureDepth(pdata)==2,pdata=pdata_1); + va1=MeetCurve(pdata,range_1,0); + va2=MeetCurve(pdata,range_2,0); + list=select(pdata,(#_1>range_1 & #_1<range_2)); + list=apply(list,LLcrd(#)); // 15.09.14 + list=concat([va1],list); + list=concat(list,[va2]); + Sm=0; + forall(1..(length(list)-1), + ptP=list_#; // 15.09.14 + ptQ=list_(#+1); + Sm=Sm+(ptP_2+ptQ_2)*(ptQ_1-ptP_1)/2; + ); + Sm; + ); +); + +Integrate(fnstr,vastr,range,options):=( +//help:Integrate("sin(x)","x",[0,pi],["Num=100","Rule=s"]); + regional(tmp,tmp1,Sm,Lx,Rx,va1,va2,Num,Waysx,ex,dx,xn,yn,x0,x1,x2,y0,y1,y2); + Num=100; + Way="t"; + forall(options, + if(indexof(#,"=")>0, + if(indexof(#,"N=")>0, + Num=parse(substring(#,indexof(#,"="),length(#))); + ); + if(indexof(#,"Num=")>0, + Num=parse(substring(#,indexof(#,"="),length(#))); + ); + if(Toupper(substring(#,0,1))=="R", + tmp=indexof(#,"="); + Way=substring(#,tmp,tmp+1); + ); + ); + ); + Sm=0; + if(Way=="t", + forall(1..Num, + Lx=range_1+(range_2-range_1)*(#-1)/Num; + Rx=range_1+(range_2-range_1)*#/Num; + va1=parse(replace(fnstr,vastr,textformat(Lx,5))); + va2=parse(replace(fnstr,vastr,textformat(Rx,5))); + Sm=Sm+(va1+va2)*(Rx-Lx)/2; + ); + , + sx=range_1; + ex=range_2; + dx=(ex-sx)/Num; + xn=apply(0..Num,sx+#*dx); + yn=apply(xn,parse(replace(fnstr,vastr,textformat(#,5)))); + dx=dx/2; + repeat(Num,s, + x0=xn_s; + x1=(xn_s+xn_(s+1))/2; + x2=xn_(s+1); + y0=yn_s; + y1=parse(replace(fnstr,vastr,textformat(x1,5))); + y2=yn_(s+1); + Sm=Sm+dx*(y0+4*y1+y2)/3; + ); + ); + Sm; +); + +IntegrateO(p0org,p1org,p2org,p3org):=( + regional(p0,p1,p2,p3,pQ,pR,cc,p01,p02, + p11,p12,p21,p22,p31,p32, tmp); + if(ispoint(p0org),p0=p0org.xy,p0=p0org); // 16.03.10 + if(ispoint(p1org),p1=p1org.xy,p1=p1org); // 16.03.16 + if(ispoint(p2org),p2=p2org.xy,p2=p2org); + if(ispoint(p3org),p3=p3org.xy,p3=p3org); + tmp=1+sqrt((1+Dotprod(p2-p0,p3-p1)/|p2-p0|/|p3-p1|)/2); + cc=4*|p2-p1|/3/(|p2-p0|+|p3-p1|)/tmp; + pQ=p1+cc*(p2-p0); + pR=p2+cc*(p1-p3); + p01=p1_1; p02=p1_2; + p31=p2_1; p32=p2_2; + p11=pQ_1; p12=pQ_2; + p21=pR_1; p22=pR_2; + tmp=-6*p12*p01+3*p12*p21+3*p12*p31+6*p02*p11- + 10*p02*p01+3*p02*p21+p02*p31-3*p22*p11- + 3*p22*p01+6*p22*p31-3*p32*p11-p32*p01- + 6*p32*p21+10*p32*p31; + tmp=tmp/20; +); +IntegrateO(pltdata,rangeorg):=( +//help:IntegrateO("gr1",[0,2]); + regional(tmp,tmp1,tmp2,pdata,va1,va2,list,Bzk,Bzc,range,pmflg, + Sm,p0,p1,p2,p3,pQ,pR,cc,p01,p02,p11,p12,p21,p22,p31,p32); + if(isstring(pltdata),pdata=parse(pltdata),pdata=pltdata); + if(MeasureDepth(pdata)==2,pdata=pdata_1); + range=rangeorg; + pmflg=1; + if(range_2<range_1, + range=reverse(range); + pmflg=-1; + ); + va1=MeetCurve(pdata,range_1,0); + va2=MeetCurve(pdata,range_2,0); + list=select(pdata,(#_1>range_1 & #_1<range_2)); + if((length(list)>0) & (list_1_1>list_(length(list))_1), + list=reverse(list); +// pmflg=pmflg*(-1); + ); + list=apply(list,LLcrd(#)); + list=concat([va1],list); + list=concat(list,[va2]); + Sm=0; + forall(1..(length(list)-1), + p1=list_#; + p2=list_(#+1); + if(#==1 % #==length(list)-1, + tmp1=(p1_2+p2_2)*(p2_1-p1_1)/2; + Sm=Sm+tmp1; + , + p0=list_(#-1); + p3=list_(#+2); + tmp=1+sqrt((1+Dotprod(p2-p0,p3-p1)/|p2-p0|/|p3-p1|)/2); + cc=4*|p2-p1|/3/(|p2-p0|+|p3-p1|)/tmp; + pQ=p1+cc*(p2-p0); + pR=p2+cc*(p1-p3); + p01=p1_1; p02=p1_2; + p31=p2_1; p32=p2_2; + p11=pQ_1; p12=pQ_2; + p21=pR_1; p22=pR_2; + tmp1=-6*p12*p01+3*p12*p21+3*p12*p31+6*p02*p11- + 10*p02*p01+3*p02*p21+p02*p31-3*p22*p11- + 3*p22*p01+6*p22*p31-3*p32*p11-p32*p01- + 6*p32*p21+10*p32*p31; + tmp1=tmp1/20; + Sm=Sm+tmp1; + ); + ); + if(pmflg==-1, + Sm=-Sm; + ); + Sm; +); + +Findarea(pdstr):=( +//help:Findarea("sgABCA"); + regional(pd,p1,p2,s,tmp); + if(isstring(pdstr),pd=parse(pdstr),pd=pdstr); + s=0; + forall(1..(length(pd)-1), + p1=Lcrd(pd_#); + p2=Lcrd(pd_(#+1)); + tmp=(p1_2+p2_2)*(p2_1-p1_1)/2; + s=s+tmp; + ); + if(s<0,s=-s); + s; +); + +Findarea(pdstr):=( // 15.11.27 +//help:Findarea("cr1"); + regional(pd,p0,p1,p2,p3,s,tmp); + if(isstring(pdstr),pd=parse(pdstr),pd=pdstr); + s=0; + forall(1..(length(pd)-1), + p1=pd_#; + p2=pd_(#+1); + if(#==1,p0=pd_(length(pd)-1),p0=pd_(#-1)); + if(#==length(pd)-1,p3=pd_2,p3=pd_(#+2)); + tmp=IntegrateO(p0,p1,p2,p3); + s=s+tmp; + ); + if(s<0,s=-s); + s; +); + +Findlength(pdstr):=( +//help:Findlength("gr1"); + regional(pd,p1,p2,s,tmp); + if(isstring(pdstr),pd=parse(pdstr),pd=pdstr); + s=0; + forall(1..(length(pd)-1), + p1=Lcrd(pd_#); + p2=Lcrd(pd_(#+1)); + tmp=|p2-p1|; + s=s+tmp; + ); + s; +); + +Inversefun(fnstr,rngstr,value):=( + regional(tmp,varstr,range,x1,x2,x3,va1,va2); + tmp=indexof(rngstr,"="); + varstr=substring(rngstr,0,tmp-1); + range=parse(substring(rngstr,tmp,length(rngstr))); + x1=range_1; x2=range_2; + repeat(15, + x3=(x1+x2)/2; + va1=parse(replace(fnstr,varstr,textformat(x1,5))); + va2=parse(replace(fnstr,varstr,textformat(x3,5))); + if((va1>value & va2>value) % (va1<value & va2<value), + x1=x3; + , + x2=x3; + ); + ); + va1=parse(replace(fnstr,varstr,textformat(x1,5)))-value; + va2=parse(replace(fnstr,varstr,textformat(x2,5)))-value; + if(x1==range_1 % x2==range_2, + println("not found in ("+textformat(range_1,5) + +","+textformat(range_2,5)+")"); + ); + if(abs(va1)<=abs(va2),x1,x2); +); + +Lcrd(pt):=( + regional(tmp); + if(ispoint(pt), + tmp=[pt.x/SCALEX,pt.y/SCALEY]; + , + tmp=pt; + ); + tmp; +); + +Pcrd(pt):=( + regional(tmp); + if(ispoint(pt), + tmp=re(pt.xy); // 15.07.24 + , + tmp=[pt_1*SCALEX,pt_2*SCALEY]; + ); + tmp; +); + +LLcrd(pt):=( + regional(tmp); + if(ispoint(pt), + tmp=pt.xy + , + tmp=pt; + ); + tmp=[tmp_1/SCALEX,tmp_2/SCALEY]; + tmp; +); + +Doscaling(pltdata):=( + regional(Level,Out,gL,gr,tmp); + if(ispoint(pltdata) % isreal(pltdata_1), + gL=[[pltdata]]; + Level=0; + , + if(ispoint(pltdata_1) % isreal(pltdata_1_1), + gL=[pltdata]; + Level=1; + , + gL=pltdata; + Level=2; + ); + ); + Out=[]; + forall(gL,gr, + tmp=apply(gr,Lcrd(#)); + tmp=apply(tmp,LLcrd(#)); + Out=concat(Out,[tmp]); + ); + if(Level==0, + Out=Out_1_1; + ); + if(Level==1, + Out=Out_1; + ); + Out; +); + +Unscaling(pltdata):=( + regional(Level,Out,gL,gr,tmp); + if(ispoint(pltdata) % isreal(pltdata_1), + gL=[[pltdata]]; + Level=0; + , + if(ispoint(pltdata_1) % isreal(pltdata_1_1), + gL=[pltdata]; + Level=1; + , + gL=pltdata; + Level=2; + ); + ); + Out=[]; + forall(gL,gr, + tmp=apply(gr,Lcrd(#)); + tmp=apply(tmp,LLcrd(#)); + Out=concat(Out,[tmp]); + ); + if(Level==0, + Out=Out_1_1; + ); + if(Level==1, + Out=Out_1; + ); + Out; +); + +Definecolor(name,data):=( +//help:Definecolor("mycolor",[1,1,1,0]); + regional(type,tmp); + if(length(data)>3,type="cmyk",type="rgb"); + tmp=text(data); + tmp=substring(tmp,1,length(tmp)-1); + tmp="\definecolor{"+name+"}{"+type+"}{"+tmp+"}"; + Texcom(tmp); +); + +Setcolor(Par):=( +//help:Setcolor([1,0,0,1]); +//help:Setcolor([1,1,0]); + if(islist(Par), + if(length(Par)==3, + Setcolorrgb(Par); // 2015.04.28 +// KCOLOR=Par; + ); + if(length(Par)==4, + Setcolor(Par,[]); + ); + , + Setcolor(Par,[]); + ); +); + +Setcolor(colorname,options):=( +//help:Setcolor("greenyellow",0.3); + regional(tmp); + if(isstring(colorname), + tmp="Setcolor("+Dq+colorname+Dq; + if(length(options)>0, + tmp=tmp+","+text(options_1); + ); + Com2nd(tmp+")"); + ); + if(islist(colorname), + tmp=text(colorname); + tmp=substring(tmp,1,length(tmp)-1); + tmp="Texcom("+Dq+"\color[cmyk]{"+tmp+"}"+Dq+")"; + Com2nd(tmp); + ); +); + +Setcolorrgb(colorlist):=( +// help:Setcolorrgb([0.5,0.3,0.4]); + regional(tmp); + tmp=text(colorlist); + tmp=substring(tmp,1,length(tmp)-1); + tmp="Texcom("+Dq+"\color[rgb]{"+tmp+"}"+Dq+")"; + Com2nd(tmp); +); + +ColorRgb2Cmyk(clr):=( +// help:ColorRgb([0.2,0.5,0.1]); + regional(clrnew,tmp,black); + tmp=apply(clr,1-#); + black=min(tmp); + tmp=apply(clr,(1-#-black)/(1-black)); + clrnew=append(tmp,black); + clrnew; +); + +ColorCmyk2Rgb(clr):=( +// help:ColorRgb([0.2,0.5,0.1,0.2]); + regional(clrnew,tmp,black); + black=clr_4; + tmp=apply(clr,1-min(1,#*(1-black)+black)); + clrnew=tmp_(1..3); + clrnew; +); + +Colorrgbhsv(rgb):=( + regional(varR,varG,varB,varMin,varMax,delMax,hh,ss,vv,delR,delG,delB); + varR = rgb_1; + varG = rgb_2; + varB = rgb_3; + varMin = min( [varR, varG, varB] ); + varMax = max( [varR, varG, varB] ); + delMax = varMax - varMin ; + vv = varMax; + if ( delMax == 0 , + hh = 0 ; + ss = 0 ; + , + ss = delMax / varMax; + delR = ( ( ( varMax - varR ) / 6 ) + ( delMax / 2 ) ) / delMax; + delG = ( ( ( varMax - varG ) / 6 ) + ( delMax / 2 ) ) / delMax; + delB = ( ( ( varMax - varB ) / 6 ) + ( delMax / 2 ) ) / delMax; + if( varR == varMax , + hh = delB - delG; + , + if ( varG == varMax, + hh = ( 1 / 3 ) + delR - delB; + , + if ( varB == varMax , + hh = ( 2 / 3 ) + delG - delR; + ); + ); + ); + if ( hh < 0 ,hh = hh+1); + if ( hh > 1 ,hh = hh-1); + ); + [hh*360,ss,vv]; +); + +Colorhsvrgb(sL):=( + regional(tmp,tmp1,tmp2,tmp3,hi,ff,dL); + tmp=[sL_1/60,sL_2,sL_3]; + hi=mod(floor(tmp_1),6); + ff=tmp_1-floor(tmp_1); + tmp2=tmp_3*[1-tmp_2,1-tmp_2*ff,1-tmp_2*(1-ff)]; + tmp2=append(tmp2,tmp_3); + if(hi==0,dL=tmp2_[4,3,1]); + if(hi==1,dL=tmp2_[2,4,1]); + if(hi==2,dL=tmp2_[1,4,3]); + if(hi==3,dL=tmp2_[1,2,4]); + if(hi==4,dL=tmp2_[3,1,4]); + if(hi==5,dL=tmp2_[4,1,2]); + dL; +); + +Colorrgbhsl(rgb):=( + regional(rr,gg,bb,mn,mx,delta,deltaR,deltaG,deltaB,hh,ss,ll); + rr = rgb_1 ; + gg = rgb_2 ; + bb = rgb_3 ; + mn = min([rr, gg, bb]); + mx = max([rr, gg, bb]); + delta = mx - mn; + ll = (mx + mn) / 2; + if (delta == 0, + hh=0; + ss=0; + , + if (ll < 0.5, + ss = delta/ (mx + mn); + , + ss = delta / (2 - mx - mn); + ); + deltaR = (((mx - rr) / 6) + (delta / 2)) / delta; + deltaG = (((mx - gg) / 6) + (delta / 2)) / delta; + deltaB = (((mx - bb) / 6) + (delta / 2)) / delta; + if (rr == mx, + hh = deltaB - deltaG; + , + if (gg == mx, + hh = (1 / 3) + deltaR - deltaB; + , + if (bb == mx, + hh = (2 / 3) + deltaG - deltaR; + ); + ); + ); + if ( hh < 0, hh = hh+1); + if ( hh > 1, hh = hh-1); + ); + [hh*360,ss,ll]; +); + +Colorhslrgb(hsl):=( + regional(hh,ss,ll,rr,gg,bb,var1,var2); + hh=hsl_1/360; + ss=hsl_2; + ll=hsl_3; + if ( ss == 0.0, + rr = ll ; + gg = ll ; + bb = ll ; + , + if ( ll < 0.5 , + var2 = ll * ( 1.0 + ss ); + , + var2 = ( ll + ss ) - ( ss * ll ); + ); + var1 = 2.0 * ll - var2; + rr = hue2rgb( var1, var2, hh + ( 1.0 / 3.0 ) ); + gg = hue2rgb( var1, var2, hh ); + bb = hue2rgb( var1, var2, hh - ( 1.0 / 3.0 ) ); + ); + [rr,gg,bb]; +); + +hue2rgb(vv1,vv2,vh):=( + regional(out); + if ( vh < 0.0 ,vh =vh+1); + if ( vh > 1.0 ,vh =vh-1); + if ( 6.0*vh < 1.0 , + out = vv1 + ( vv2 - vv1 ) * 6.0 * vh ; + , + if( 2.0*vh < 1.0 , + out = vv2; + , + if ( 3.0*vh < 2.0 , + out = vv1 + ( vv2 - vv1 ) * ( ( 2.0 / 3.0 ) - vh ) * 6.0 ; + , + out= vv1 ; + ); + ); + ); + out; +); + +Colorrgbhwb(sL):=( + regional(dl1,dl2,dl3); + dl1 = Colorrgbhsl(sL)_1;//Colorcode("rgb","hsl",sL)_1; + dl2 = min(sL); + dl3 = 1 - max(sL); + dL= [dl1, dl2 , dl3 ]; +); + +Colorhwbrgb(sLorg):=( + regional(sL,tmp,tmp1,tmp2,tmp3,ratio,ff,ii,vv,nn,dL,flg); + sL=sLorg; + sL=[sL_1/360,sL_2,sL_3]; + ratio = sL_2 + sL_3; + // sL_2 + sL_3 cant be > 1 + if (ratio > 1., + sL_2 =sL_2 / ratio; + sL_3 = sL_3 / ratio; + ); + ii = floor(6 * sL_1); + vv = 1 - sL_3; + ff = 6 * sL_1 - ii; + if(mod(ii,2)==1,ff = 1 - ff); + nn = sL_2 + ff * (vv - sL_2); // linear interpolation + tmp=[[vv,nn,sL_2],[nn,vv,sL_2],[sL_2,vv,nn], + [sL_2,nn,vv],[nn,sL_2,vv],[vv,sL_2,nn],[vv,nn,sL_2]]; + flg=0; + forall(0..6, + if(flg==0 & ii == # , + dL=tmp_(#+1); + flg=1; + ); + ); + dL; +); + +Colorhslhsv(sL):=( + regional(dl1,dl2,dl3,dL); + dl1=sL_1; + if(sL_3 == 0, + // no need to do calc on black + // also avoids divide by 0 error + dL= [0, 0, 0]; + , + sL_3 = sL_3 * 2; + if(sL_3 <= 1,sL_2 = sL_2 * sL_3,sL_2 = sL_2 * (2 - sL_3)); + dl3 = (sL_3 + sL_2) / 2; + dl2 = (2 * sL_2) / (sL_3 + sL_2); + dL = [dl1, dl2, dl3]; + ); + dL; +); + +Colorcode(src,dest,sL):=( +//help:Colorcode("rgb","cmyk",[1,0.5,0]); + regional(tmp,tmp1,tmp2,tmp3,mn,mx,delta,black,dL,flg); + regional(dl1,dl2,dl3); + if(src=="rgb" & dest=="hsv", dL=Colorrgbhsv(sL)); + if(src=="hsv" & dest=="rgb", dL=Colorhsvrgb(sL)); + if(src=="rgb" & dest=="hsl", dL=Colorrgbhsl(sL)); + if(src=="hsl" & dest=="rgb", dL=Colorhslrgb(sL)); + if(src=="rgb" & dest=="hwb", dL=Colorrgbhwb(sL)); + if(src=="hwb" & dest=="rgb", dL=Colorhwbrgb(sL)); + if(src=="hsl" & dest=="hsv", dL=Colorhslhsv(sL)); + if(src=="hsv" & dest=="hsl", + dl1 = sL_1; + dl3 = (2 - sL_2) * sL_3; + dl2 = sL_2 * sL_3; + if(dl3 <= 1,dl2 = dl2/dl3,dl2=dl2/(2 - dl3)); + dl3 =d l3/ 2; + dL = [dl1, dl2 , dl3 ]; + ); + + if(src=="rgb" & dest=="cmyk", + tmp=apply(sL,1-#); + black=min(tmp); + tmp=apply(sL,(1-#-black)/(1-black)); + dL=append(tmp,black); + ); + if(src=="cmyk" & dest=="rgb", + black=sL_4; + tmp=apply(sL,1-min(1,#*(1-black)+black)); + dL=tmp_(1..3); + ); + if(src=="hsv" & dest=="cmyk", + tmp=Colorcode("hsv","rgb",sL); + dL=Colorcode("rgb","cmyk",tmp); + ); + if(src=="cmyk" & dest=="hsv", + tmp=Colorcode("cmyk","rgb",sL); + dL=Colorcode("rgb","hsv",tmp); + ); + + if(src=="hsv" & dest=="hwb", + tmp = Colorcode("hsv","rgb",sL); + dL = Colorcode("rgb","hwb",tmp); + ); + if(src=="hwb" & dest=="hsv", + tmp = Colorcode("hwb","rgb",sL); + dL = Colorcode("rgb","hsv",tmp); + ); + if(src=="hsl" & dest=="hwb", + tmp = Colorcode("hsl","rgb",sL); + dL = Colorcode("rgb","hwb",tmp); + ); + if(src=="hwb" & dest=="hsl", + tmp = Colorcode("hwb","rgb",sL); + dL = Colorcode("rgb","hsl",tmp); + ); + if(src=="hsl" & dest=="cmyk", + tmp = Colorcode("hsl","rgb",sL); + dL = Colorcode("rgb","cmyk",tmp); + ); + if(src=="hwb" & dest=="cmyk", + tmp = Colorcode("hwb","rgb",sL); + dL = Colorcode("rgb","cmyk",tmp); + ); + if(src=="cmyk" & dest=="hsl", + tmp = Colorcode("cmyk","rgb",sL); + dL = Colorcode("rgb","hsl",tmp); + ); + if(src=="cmyk" & dest=="hwb", + tmp = Colorcode("cmyk","rgb",sL); + dL = Colorcode("rgb","hwb",tmp); + ); + if(src=="hsb" & dest=="rgb",dL=Colorcode("hsv","rgb",sL)); + if(src=="rgb" & dest=="hsb",dL=Colorcode("rgb","hsv",sL)); + + if(src=="hsb" & dest=="hsl",dL=Colorcode("hsv","hsl",sL)); + if(src=="hsl" & dest=="hsb",dL=Colorcode("hsl","hsv",sL)); + + if(src=="hsb" & dest=="hwb",dL=Colorcode("hsv","hwb",sL)); + if(src=="hwb" & dest=="hsb",dL=Colorcode("hwb","hsv",sL)); + + if(src=="hsb" & dest=="cmyk",dL=Colorcode("hsv","cmyk",sL)); + if(src=="cmyk" & dest=="hsb",dL=Colorcode("cmyk","hsv",sL)); + + dL; +); + +Addcolor(cmdorg,list):=( +//help:Addcolor("Plotdata('1','x^2','x',[])",[1,1,0]); + regional(rgb,cmyk,cmd,tmp,tmp1,tmp2,tmp3,tmp4); + cmd=replace(cmdorg,"'",Dq); + if(length(list)==3, + rgb=list; + cmyk=Colorcode("rgb","cmyk",list); + , + cmyk=list; + rgb=Colorcode("cmyk","rgb",list); + ); + tmp1="color->"+text(rgb); + tmp2="Setcolor("+text(cmyk)+");"; + tmp3=substring(cmd,0,length(cmd)-2); + tmp=substring(tmp3,length(tmp3)-1,length(tmp3)); + if(tmp!="[", + tmp3=tmp3+","; + ); + tmp3=tmp3+Dq+tmp1+Dq+"])"; + parse(tmp2); + parse(tmp3); + Setcolor("black"); +); + +Colorinfile(filename,clrf,clrt):=( + regional(tmp,tmp1,tmp2,head,cstrL,chstrL,head,body); + if(length(clrf_1)==3, + head="[rgb]{"; + , + head="[cmyk]{"; + ); + tmp=apply(clrf,text(#)); + cstrL=apply(tmp,head+substring(#,1,length(#)-1)+"}"); + if(length(clrt_1)==3, + head="[rgb]{"; + , + head="[cmyk]{"; + ); + tmp=apply(clrt,text(#)); + chstrL=apply(tmp,head+substring(#,1,length(#)-1)+"}"); + tmp1=load(filename); + tmp=tokenize(tmp1,"{\unitlength"); + head=tokenize(tmp_1,"%%%"); + head=head_(2..length(head)); + head=apply(head,"%%%"+#); + tmp2=tmp_2; + forall(1..5, + tmp2=replace(tmp2,cstrL_#,chstrL_#); + ); + body=tokenize(tmp2,"%"); + body_1="{\unitlength"+body_1; + body=apply(body,#+"%"); + body=body_(1..(length(body)-1)); + tmp=replace(filename,".tex","new.tex"); + SCEOUT=openfile(tmp); + forall(head, + println(SCEOUT,#); + ); + forall(1..length(body), + tmp=body_#; + if(#<length(body), + println(SCEOUT,tmp); + , + print(SCEOUT,tmp) + ); + ); + closefile(SCEOUT); +); + +GetLinestyle(str,name):=( + regional(noflg,tmp,tmp1,tmp2,Dop,Ltype,subflg); + Ltype=-1; + Dop=""; + tmp1=indexof(str,","); + if(tmp1>0, + Dop=","+substring(str,tmp1,length(str)); + ); + noflg=parse(substring(str,0,1)); + if(substring(name,0,3)=="sub",subflg=1,subflg=0); // 16.02.29 + tmp1=substring(str,1,3); + if(tmp1=="dr" % tmp1=="Dr", + Ltype=0; + if(noflg==0 & subflg==0, // 16.02.29 + Drwline(name+Dop); + ); + ); + if(tmp1=="da" % tmp1=="Da", + Ltype=1; + if(noflg==0 & subflg==0, // 16.02.29 + Dashline(name+Dop); + ); + ); + if(tmp1=="id" % tmp1=="Id", + Ltype=2; // 15.11.09 + if(noflg==0 & subflg==0, // 16.02.29 + Invdashline(name+Dop); + ); + ); + if(tmp1=="do" % tmp1=="Do", + Ltype=3; + if(noflg==0 & subflg==0, // 16.02.29 + Dottedline(name+Dop); + ); + ); + if(tmp1=="dp" % tmp1=="Dp", + Ltype=0; + tmp1=parse(name); + tmp2=""; + forall(tmp1, + tmp2=tmp2+textformat(#_1,5)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); + if(noflg==0, + Drwpt(tmp2+Dop); + ); + ); + if(tmp1=="no" % tmp1=="No", + Ltype=10; + ); + Ltype; +); + +Chunderscore(str):=( + regional(flg,tmp,tmp1,tmp2,tmp3); + if(indexof(str,"]")>0, + tmp1=replace(str,"]",",]"); + , + tmp1=str+","; + ); + flg=0; + tmp2=[]; + tmp3=0; + forall(1..length(tmp1), + if(flg==0, + tmp=substring(tmp1,tmp3,length(tmp1)); + tmp=indexof(tmp,"_"); + if(tmp==0, + flg=1; + , + tmp3=tmp3+tmp; + tmp=substring(tmp1,tmp3,length(tmp1)); + tmp=indexof(tmp,",")-1; + tmp=substring(tmp1,tmp3,tmp3+tmp); + tmp2=append(tmp2,tmp); + ); + ); + ); + forall(tmp2, + tmp1=replace(tmp1,"_"+#,"("+#+")"); + ); + if(indexof(str,"]")>0, + tmp1=replace(tmp1,",]",")"); + tmp1=replace(tmp1,"[","list("); + , + tmp1=substring(tmp1,0,length(tmp1)-1); + ); + tmp1; +); + +//AddGraph(pltdata):=AddGraph("-"+pltdata,pltdata,[]); +AddGraph(nm,pltdata):=AddGraph(nm,pltdata,[]); +// if(isstring(Arg2), +// AddGraph(Arg1,Arg2,[]); +// , +// if(MeasureDepth(Arg2)>0, +// Addgraph(Arg1,Arg2,[]); +// , +// Addgraph("-"+Arg1,Arg1,Arg2); +// ); +// ); +//); +AddGraph(nm,pltdata,options):=( +//help:AddGraph("1","imp1"); // 16.04.04 +//help:Addgraph("1",["[pt1]","gr1"],["nodisp"]); + regional(name,Ltype,Noflg,opcindy,pdata,fname,flg, + tmp,tmp1,tmp2,tmp3); + if(substring(nm,0,1)=="-", + name=substring(nm,1,length(nm)); + , + name="ad"+nm; + ); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_9; + if(isstring(pltdata), + pdata=parse(pltdata) + , + if(!islist(pltdata),pdata=[pltdata],pdata=pltdata); + pdata=apply(pdata,parse(#)); + ); // 15.01.22 + pdata=Flattenlist(pdata); + tmp1=[]; + forall(pdata,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + pdata=tmp1; + if(Noflg<3, + println("generate addgraph "+name); + tmp=name+"="+textformat(pdata,5); + parse(tmp); + if(isstring(pltdata), // 16.04.04 from + if(indexof(pltdata,"]")>0, + tmp1="list(Listplot("+substring(pltdata,1,length(pltdata)); + tmp1=replace(tmp1,"]",",]"); + , + tmp1="Listplot("+substring(pltdata,0,length(pltdata))+",]"; + ); + flg=0; + tmp2=[]; + tmp3=0; + forall(1..length(tmp1), + if(flg==0, + tmp=indexof(substring(tmp1,tmp3,length(tmp1)),"_"); + if(tmp==0, + flg=1; + , + tmp3=tmp3+tmp; + tmp=indexof(substring(tmp1,tmp3,length(tmp1)),",")-1; + tmp=substring(tmp1,tmp3,tmp3+tmp); + tmp2=append(tmp2,tmp); + ); + ); + ); + forall(tmp2, + tmp1=replace(tmp1,"_"+#,"("+#+")"); + ); + tmp1=replace(tmp1,",]",")"); + tmp1=replace(tmp1,",","),Listplot("); + if(indexof(pltdata,"[")>0, + tmp1=tmp1+")"; + ); + GLIST=append(GLIST,name+"="+tmp1); + , + if(MeasureDepth(pdata)==1, + tmp1=name+"=Listplot("+textformat(pdata,5)+")"; + , + tmp1="list("; + forall(1..length(pdata), + tmp=name+"p"+textformat(#,5)+"="; + if(length(pdata_#)>1, // 15.01.22 + tmp=tmp+"Listplot("+textformat(pdata_#,5)+")"; + , + tmp=tmp+"Pointdata("+textformat(pdata_#_1,5)+")"; + ); + GLIST=append(GLIST,tmp); + tmp1=tmp1+name+"p"+textformat(#,5)+","; + ); + tmp1=name+"="+substring(tmp1,0,length(tmp1)-1)+")"; + ); + GLIST=append(GLIST,tmp1); + ); + ); // 16.04.04 upto + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); +); + +Joincrvs(nm,plotstrL):=Joincrvs(nm,plotstrL,[]); +Joincrvs(nm,plotstrL,options):=( +//help:Joincrvs("1",["sgAB","sgDCB"]); + regional(plotlist,PtL,Eps,QdL,Flg,Ni,Qd,pP,pS,pQ,pR,rMN, + opcindy,tmp,tmp1,tmp2,str,name,Ltype,Noflg); + name="join"+nm; + plotlist=[]; + forall(plotstrL,str, + if(isstring(str), + tmp=parse(str); + tmp=apply(tmp,LLcrd(#)); + , + tmp=str; + ); + plotlist=append(plotlist,tmp); + ); + Eps=10^(-4); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + tmp1=tmp_6; + if(length(tmp1)>0,Eps=tmp1_1); + QdL=[]; + forall(plotlist,Qd, + if(ispoint(Qd_1) % !islist(Qd_1_1), + QdL=concat(QdL,[Qd]); + , + forall(Qd, + QdL=concat(QdL,[#]); + ); + ); + ); + Flg=0; + if(length(QdL)==0, + PtL=[]; + Flg=1; + ); + if(Flg==0, + PtL=QdL_1; + forall(2..length(QdL),Ni, + Qd=QdL_Ni; + if(Numptcrv(Qd)>1, + pP=Ptend(PtL); + pS=Ptstart(PtL); + pQ=Ptstart(Qd); + pR=Ptend(Qd); + rMN=min([|pP-pQ|,|pP-pR|,|pS-pQ|,|pS-pR|]); + if(rMN==|pP-pR|, + Qd=reverse(Qd); + , + if(rMN==|pS-pQ|, + PtL=reverse(PtL); + , + if(rMN==|pS-pR|, + PtL=reverse(PtL); + Qd=reverse(Qd); + ); + ); + ); + ); + if(rMN>Eps, + PtL=concat(PtL,Qd); + , + PtL=concat(PtL,Qd_(2..length(Qd))); + ); + ); + ); + if(Noflg<3, + println("generate joincurve "+name); + tmp1=apply(PtL,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=""; + forall(plotstrL, + tmp1=tmp1+#+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1); + GLIST=append(GLIST,name+"=Joincrvs("+tmp1+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PtL; +); + +Partcrv(nm,pA,pB,PkLstr):=Partcrv(nm,pA,pB,PkLstr,[]); +Partcrv(nm,pA,pB,PkLstr,options):=( +//help:Partcrv("1",A,B,"sgABC"); +//help:Partcrv("1",1.3,2.5,"sgABC"); + regional(PkL,Ans,Eps,Npt,Out1,Out2,tmp,tmp1,Flg,nS,nE,PPL,pP, + opcindy,Ta,Tb,name,Ltype,Noflg,DepthFlg); + name="part"+nm; + if(isstring(PkLstr),PkL=parse(PkLstr),PkL=PkLstr); + DepthFlg=0; + if(MeasureDepth(PkL)==2, + PkL=PkL_1; + DepthFlg=1; + ); + PkL=apply(PkL,LLcrd(#)); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + Eps=10^(-3); + Flg=0; + if(isreal(pA), + if(pA>pB+Eps, + Npt=Numptcrv(PkL); + Out1=Partcrv("",pA,Npt,PkLstr,["nodata"]); + Out2=Partcrv("",1,pB,PkLstr,["nodata"]); + tmp=Ptstart(PkL)-Ptend(PkL); + if(|tmp|<Eps, + Ans=Joincrvs("",[Out1,Out2],["nodata"]); + , + Ans=[apply(Out1,Pcrd(#)),apply(Out2,Pcrd(#))]; + ); + Flg=1; + ); + if(Flg==0, + nS=ceil(pA); + nE=floor(pB); + PPL=[]; + if(pA<nS-Eps, + pP=(nS-pA)*PkL_(nS-1)+(1-nS+pA)*PkL_nS; + PPL=[pP]; + ); + PPL=concat(PPL,PkL_(nS..nE)); + if(pB>nE+Eps, + pP=(1-pB+nE)*PkL_nE+(pB-nE)*PkL_(nE+1); + PPL=concat(PPL,[pP]); + ); + Ans=PPL; + Flg=1; + ); + ); + if(Flg==0, + tmp=Nearestpt(LLcrd(Pcrd(pA)),PkL); + Ta=tmp_2; + tmp=Nearestpt(LLcrd(Pcrd(pB)),PkL); // 15.09.12 + Tb=tmp_2; + Ans=Partcrv("",Ta,Tb,PkL,["nodata"] ); + Ans=apply(Ans,Pcrd(#)); + ); + if(Noflg<3, + println("generate partcrv "+name); + tmp1=apply(Ans,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// GLIST=append(GLIST, // 16.04.03 + if(DepthFlg==0, + tmp=PkLstr; + , + tmp=PkLstr+"(1)"; + ); + tmp1=name+"=Partcrv("+textformat(Lcrd(pA),5) + +","+textformat(Lcrd(pB),5)+","+tmp+")"; // 16.04.03 + GLIST=append(GLIST,tmp1); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Ans; +); + +Opcrvs(num,Fig):=Opcrvs(num,Fig,["nodisp"]); +Opcrvs(num,Fig,options):=( + //help:Subgraph(2,"grfs"); + regional(name,tmp,tmp1); + name="-"+Fig+text(num); + tmp=Fig+"_"+text(num); + tmp1=parse(tmp); + Listplot(name,tmp1,options); +); + + +Pointdata(nm,list):=Pointdata(nm,list,[]); +Pointdata(nm,list,options):=( +//help:Pointdata("1",[2,4],["Size=5"]); +//help:Pointdata("2",[[2,3],[4,1]]); + regional(name,nameL,ptlist,opstr,opcindy, + eqL,size,thick,tmp,tmp1,tmp2,tmp3,Ltype,Noflg); + name="pt"+nm; + nameL=name+"L"; + println("generate pointdata "+name); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + opstr=tmp_(length(tmp)-1); + size=""; + eqL=tmp_5; + if(length(eqL)>0, + forall(eqL, + tmp=substring(#,0,1); + if(tmp=="s" % tmp=="S", + tmp=indexof(#,"="); + size=substring(#,tmp,length(#)); + ); + ); + ); + tmp=MeasureDepth(list); + if(tmp>0, // 2015.02.21 + if(tmp==1,ptlist=list,ptlist=list_1); + tmp=apply(ptlist,[textformat(Pcrd(#),5)]); + tmp1=text(tmp); + tmp2=substring(tmp1,1,length(tmp1)-1); + tmp3=tmp1; + , + ptlist=list; + tmp1=textformat(Pcrd(ptlist),5); + tmp2=tmp1; + tmp3="["+tmp1+"]"; + ); + tmp=name+"="+tmp1; + parse(tmp); + tmp=nameL+"="+tmp3; + parse(tmp); + if(Noflg<3, + GLIST=append(GLIST,name+"=Pointdata("+tmp2+")"); + ); + if(Noflg<2, + tmp=[nameL,0,opcindy]; + GCLIST=append(GCLIST,tmp); + if(Noflg==0, + if(length(size)>0, + Com2nd("Setpt("+size+")"); + ); + thick=PenThick/PenThickInit; // 16.04.09 from + if(length(size)>0,tmp1=parse(size),tmp1=1); + tmp1=max(tmp1,1)/8; + Setpen(tmp1); // 16.04.09 upto + Com2nd("Drwpt(list("+name+")"+opstr+")"); + Setpen(thick); // 16.04.09 + if(length(size)>0, + Com2nd("Setpt("+textformat(TenSize/TenSizeInit,1)+")"); + ); + ); + ); + ptlist; +); + +Listplot(nm,list,options):=( +//help:Listplot([A,B]); +// help:Listplot(["A","B"]); +//help:Listplot("1",[[2,1],[3,3]]); +//help:Listplot(options2=["Msg=yes"]); + regional(name,tmp,tmp1,ptlist,Ltype,opcindy,Noflg,eqL,Msg); + if(substring(nm,0,1)=="-", // 16.01.27 from + name=substring(nm,1,length(nm)); + , + name="sg"+nm; + ); // upto + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + eqL=tmp_5; + opcindy=tmp_(length(tmp)); + Msg=1; // 15.09.17 + forall(eqL, + tmp=substring(#,0,1); + if(Toupper(tmp)=="M", + tmp=indexof(#,"="); + tmp1=substring(#,tmp,tmp+1); // 16.06.28 + if(Toupper(tmp1)=="N", // 16.06.28 + Msg=0; + ); + ); + ); + if(Noflg<3, + if(Msg==1, + println("generate Listplot "+name); + ); + if(isstring(list_1),tmp=apply(list,parse(#)),tmp=list); // 15.03.24 + ptlist=apply(tmp,Pcrd(#)); + tmp=name+"="+textformat(ptlist,5); + parse(tmp); + GLIST=append(GLIST,name+"=Listplot("+textformat(list,5)+")"); // 15.12.23 + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + tmp1=apply(list,Lcrd(#)); + tmp1; +); +Listplot(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Listplot(name,list,[]); + , + list=Arg1; + options=Arg2; + name=""; + forall(list, // 16.10.07from + name=name+#.name; + );// 16.10.07upto + Listplot(name,list,options); + ); +); +Listplot(list):=Listplot(list,[]); + +Lineplot(nm,list,options):=( +//help:Lineplot([A,B]); +//help:Lineplot("1",[[2,1],[3,3]]); + regional(name,Out,tmp,tmp1,opstr,opcindy,Mag,Semi, + Vec,pA,pB,Ltype,Noflg); + name="ln"+nm; + Mag=100; + Semi=""; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + opstr=tmp_(length(tmp)-1); + tmp1=tmp_6; + if(length(tmp1)>0,Mag=tmp1_1); + tmp1=tmp_7; + if(length(tmp1)>0,Semi=tmp1_1); + pA=Lcrd(list_1); pB=Lcrd(list_2); + Vec= Mag/dist(pA,pB)*(pB-pA); + if(length(Semi)==0, + Out=[pA-Vec,pA+Vec]; + , + if(Semi=="+", + Out=[pA,pA+Vec]; + , + Out=[pA-Vec,pA]; + ); + ); + if(Noflg<3, + println("generate Lineplot "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST,name+"=Lineplot("+textformat(list,5)+opstr+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); +Lineplot(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Lineplot(name,list,[]); + , + list=Arg1; + options=Arg2; + name=""; + forall(list, // 16.10.07from + name=name+#.name; + );// 16.10.07upto + Lineplot(name,list,options); + ); +); +Lineplot(list):=Lineplot(list,[]); + +Plotdata(name1,func,variable):=Plotdata(name1,func,variable,[]); +Plotdata(name1,func,variable,options):=( +//help:Plotdata("1","sin(x)","x",["Num=100"]); +//help:Plotdata("2","x^2","x=[-1,1]"); +//help:Plotdata("3","Fout(x)","x",["out"]); + regional(Fn,Va,tmp,tmp1,tmp2,eqL,name,Vname,x1,x2,dx, + PdL,QdL,Num,Ec,Dc,Fun,Exfun,x,Ke,Eps,Pa, + Ltype,Noflg,Inflg,Outflg,opstr,opcindy); + name="gr"+name1; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + Inflg=tmp_3; + Outflg=tmp_4; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + Num=50; + Ec=[]; + Exfun=""; + Dc=1000; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+#+"'"; + if(substring(#,0,1)=="N", + Num=parse(tmp1); + ); + if(substring(#,0,1)=="E", + if(substring(tmp1,0,1)=="[", + Ec=parse(tmp1); + , + Exfun=tmp1; + ); + ); + if(substring(#,0,1)=="D", + Dc=parse(tmp1); + ); + ); + if(Inflg==0 & Outflg==0, + Eps=10^(-3); + tmp=replace(func,LFmark,""); + tmp=tokenize(variable,"="); + Vname=tmp_1; + if(length(tmp)>1, + tmp=tmp_2; + tmp=parse(tmp); + x1=tmp_1; + x2=tmp_2; + , + x1=XMIN; + x2=XMAX; + ); + // dx=(x2-x2)/Num; + Ec=append(sort(Ec),10000); + Fun=Assign(func,Vname, "xx"); + Exfun=Assign(Exfun,Vname, "xx"); + PdL=[]; + Ke=1; + forall(0..Num, + xx=x1+#*(x2-x1)/Num; // differs from Scilab ( / Num-1) + if(length(Exfun)>0, + tmp=parse(Exfun); + if(abs(tmp)<Eps, + if(length(Pdt)>0, + PdL=concat(PdL,["inf"]); + ); + ); + , + Pa=[]; + if(xx-Ec_Ke<-Eps, + Pa=[xx,parse(Fun)]; + ); + if(abs(xx-Ec_Ke)<=Eps, + if(length(PdL)>0, + if(PdL_(length(PdL))_1!="inf", + Pa=["inf"]; + ); + ); + ); + if(xx-Ec_Ke>Eps, + Pa=[xx,parse(Fun)]; + Ke=Ke+1; + ); + if(length(Pa)>0, + if(Pa_1=="inf", + PdL=concat(PdL,[Pa]); + , + if(length(PdL)==0, + PdL=[Pa]; + , + tmp=PdL_(length(PdL)); + if(tmp_1=="inf", + PdL=concat(PdL,[Pa]); + , + if(dist(tmp,Pa)<Dc, + PdL=concat(PdL,[Pa]); + , + PdL=concat(PdL,[["inf"],Pa]); + ); + ); + ); + ); + ); + ); + ); + tmp1=[]; + tmp2=select(1..length(PdL),PdL_#==["inf"]); + tmp=1; + forall(tmp2, + if(#>tmp, + tmp1=concat(tmp1,[PdL_(tmp..(#-1))]) + ); + tmp=#+1; + ); + if(tmp<length(PdL), + tmp1=concat(tmp1,[PdL_(tmp..length(PdL))]); + ); + PdL=tmp1; + if(length(PdL)==1, + PdL=PdL_1; + ); + if(Noflg<3, + println("generate Plotdata "+name); + if(MeasureDepth(PdL)==1, + tmp1=apply(PdL,Pcrd(#)); + , + tmp1=[]; + forall(PdL,tmp2, + tmp1=append(tmp1,apply(tmp2,Pcrd(#))); + ); + ); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=replace(func,LFmark,""); + tmp2=replace(variable,LFmark,""); + tmp=name+"=Plotdata('"+tmp1+"','"+tmp2+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; + , + // Inflg or Outflg >0 15.05.15 + if(Noflg<3, + if(Outflg==1, + println("Output Plotdata "+name); + tmp=name+"=Plotdata('"+func+"','"+variable+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + SCIWRLIST=append(SCIWRLIST,name); + if(Inflg==0,Inflg=1); // 15.05.17 + ); + if(Inflg==1, + println("Input Plotdata "+name); + if(length(SCIRELIST)==0, + ReadOutData(Fnameout); + ); + tmp=parse(name); + if(islist(tmp), + Extractdata(name,["nodisp"]); // 12.19 + ); + tmp="// "+name+"=Plotdata('"+func+"','"+variable+"'"+opstr+")"; + Com1st(tmp); + SCIRELIST=append(SCIRELIST,name); + ); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + if(Inflg==1, + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); + ); +); + +Paramplot(name1,funstr,variable):=Paramplot(name1,funstr,variable,[]); +Paramplot(name1,funstr,variable,options):=( +//help:Paramplot("1","[2*cos(t),sin(t)]","t=[0,2*pi]"); + regional(name,Out,tmp,tmp1,tmp2,vname,func,str,Rng,Num, + Ec,Exfun,Dc,eqL,Fntmp,Vatmp,t1,t2,dt,tt,pa,ke, + Ltype,Noflg,Inflg,Outflg,opstr,opcindy); + name="gp"+name1; + Eps=10^(-4); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + Inflg=tmp_3; + Outflg=tmp_4; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + Num=50; + Ec=[]; + Exfun=""; + Dc=1000; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+#+"'"; + if(substring(#,0,1)=="N", + Num=parse(tmp1); + ); + if(substring(#,0,1)=="E", + if(substring(tmp1,0,1)=="[", + Ec=parse(tmp1); + , + Exfun=tmp1; + ); + ); + if(substring(#,0,1)=="D", + Dc=parse(tmp1); + ); + ); + if(Inflg==0 & Outflg==0, + tmp=indexof(variable,"="); + vname=substring(variable,0,tmp-1); + str=substring(variable,tmp,length(variable)); + Rng=parse(str); + t1=Rng_1; t2=Rng_2; + dt=(t2-t1)/Num;// differs from Scilab ( / Num-1) + func=Assign(funstr,vname,"tt"); + Out=[]; + Ec=append(sort(Ec),10000); + ke=1; + forall(0..Num, + pt=[]; + tt=Rng_1+#*dt; + if(tt-Ec_ke<-Eps, + pa=parse(func); + ); + if(abs(tt-Ec_ke)<=Eps, + if(length(Out)>0, + if(Out_(length(Out))_1!="inf", + pa=["inf"]; + ); + ); + ); + if(tt-Ec_ke>Eps, + pa=parse(func); + ke=ke+1; + ); + if(length(pa)>0, + if(pa_1=="inf", + Out=append(Out,pa); + , + if(length(Out)==0, + Out=[pa]; + , + tmp=Out_(length(Out)); + if(tmp_1=="inf", + Out=append(Out,pa); + , + if(|tmp-pa|<Dc, + Out=append(Out,pa); + , + Out=concat(Out,[["inf"],pa]); + ); + ); + ); + ); + ); + ); + tmp1=[]; + tmp2=select(1..length(Out),Out_#==["inf"]); + tmp=1; + forall(tmp2, + if(#>tmp, + tmp1=concat(tmp1,[Out_(tmp..(#-1))]) + ); + tmp=#+1; + ); + if(tmp<length(Out), + tmp1=concat(tmp1,[Out_(tmp..length(Out))]); + ); + Out=tmp1; + if(length(Out)==1, + Out=Out_1; + ); + if(Noflg<3, + println("generate Paramplot "+name); + if(MeasureDepth(Out)==1, + tmp1=apply(Out,Pcrd(#)); + , + tmp1=[]; + forall(Out,tmp2, + tmp1=append(tmp1,apply(tmp2,Pcrd(#))); + ); + ); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=replace(funstr,LFmark,""); // 15.11.13 + tmp2=replace(variable,LFmark,""); + tmp=name+"=Paramplot('"+tmp1+"','"+tmp2+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; + , + // Inflg or Outflg >0 15.05.15 + if(Noflg<3, + if(Outflg==1, + println("Output Paramplot "+name); + tmp=name+"=Paramplot('"+funstr+"','"+variable+"'"+opstr+")"; + GLIST=append(GLIST,tmp); + SCIWRLIST=append(SCIWRLIST,name); + if(Inflg==0,Inflg=1); // 15.05.17 + ); + if(Inflg==1, + println("Input Paramplotdata "+name); + if(length(SCIRELIST)==0, + ReadOutData(Fnameout); + ); + tmp=parse(name); + if(islist(tmp), + Extractdata(name,["nodisp"]); // 12.19 + ); + tmp="// "+name+"=Paramplot('"+func+"','"+variable+"'"+opstr+")"; + Com1st(tmp); + SCIRELIST=append(SCIRELIST,name); + ); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + if(Inflg==1, + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); + ); +); + +Circledata(cenrad):=Circledata(cenrad,[]); +Circledata(para1,para2):=( +//help:Circledata([A,B],["Rng=[0,pi/2]"]); +//help:Circledata([A,B,C]); + regional(name,cenrad,options,str,n); + if(isstring(para1), + name=para1; + cenrad=para2; + options=[]; + , + cenrad=para1; + options=para2; + name="";// 16.10.07from + forall(cenrad, + name=name+#.name; + );// 16.10.07upto + ); + Circledata(name,cenrad,options); +); +Circledata(nm,cenrad,options):=( + regional(name,Out,Ctr,Ptcir,ra,Num,Rg,opstr,opcindy, + tmp,tmp1,tmp1,Th,Ltype,Noflg,eqL,pA,pB,pC,d1,d2,Eps); + name="cr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + Num=50; + Rg=[0,2*pi]; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+#+"'"; + if(substring(#,0,1)=="N", + Num=parse(tmp1); + ); + if(substring(#,0,1)=="R", + Rg=parse(tmp1); + ); + ); + if(length(cenrad)==2, + Ctr=Lcrd(cenrad_1); + Ptcir=Lcrd(cenrad_2); + ra=dist(Ctr,Ptcir); + , + Eps=10^(-1); + pA=Lcrd(cenrad_1); + pB=Lcrd(cenrad_2); + pC=Lcrd(cenrad_3); + tmp=pB-pA; + tmp1=(tmp_2,-tmp_1); + tmp=pC-pB; + tmp2=(tmp_2,-tmp_1); + d1=det([tmp1,tmp2]); + d2=det([pC-pA,tmp2]); + if(abs(d1)<Eps & abs(d2)>10*Eps, + println("points are in a line"); + ra=0; + , + Ctr=1/2*(pA+pB)+1/2*d2/d1*tmp1; + ra=|pA-Ctr|; + tmp=name+"center="+Ctr; + parse(tmp); + Defvar(name+"center",Ctr); + ); + ); + if(ra>0, + Out=[]; + forall(0..Num, + Th=Rg_1+#*(Rg_2-Rg_1)/Num; + Out=append(Out,Ctr+ra*[cos(Th),sin(Th)]); + ); + , + Out=Lineplot("1",[pA,pB],["nodata"]); + ); + if(Noflg<3, + println("generate Circledata "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + if(length(cenrad)==2, + tmp=name+"=Circledata("+cenrad+opstr+")"; + , + if(ra>0, + tmp=name+"=Circledata(["+Ctr+","+cenrad_1+"]"+opstr+")"; + , + tmp=name+"=Lineplot("+cenrad_1+","+cenrad_2+")"; + ); + ); + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +Framedata():=( + regional(pA,pB); + pA=LLcrd((SW+NE)/2); // 15.09.17 + pB=LLcrd(NE); + Framedata("win",[pA,pB]); +); +Framedata(list):=Framedata(list,[]); +Framedata(Arg1,Arg2):=( + regional(name,list,options,str); + if(isstring(Arg1), + name=Arg1; + list=Arg2; + Framedata(name,list,[]); + , + list=Arg1; + options=Arg2; + name="";// 16.10.07from + forall(list, + name=name+#.name; + );// 16.10.07upto + Framedata(name,list,options); + ); +); + +Framedata(nm,list,options):=( +//help:Framedata(); +//help:Framedata([A,B]); +//help:Framedata("1",[A,B]); +//help:Framedata("1",[C,dx,dy]); + regional(name,Out,tmp,tmp1,pB,x1,x2,y1,y2,dx,dy, + opcindy,Ltype,Noflg,cent,dx,dy); + name="fr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + if(length(list)==2, // 15.05.12 + pA=Lcrd(list_1); pB=Lcrd(list_2); + dx=abs(pB_1-pA_1); dy=abs(pB_2-pA_2); + , + pA=Lcrd(list_1); + dx=list_2; dy=list_3; + ); + x1=pA_1-dx; x2=pA_1+dx; + y1=pA_2-dy; y2=pA_2+dy; + Out=[[x1,y1],[x2,y1],[x2,y2],[x1,y2],[x1,y1]]; + if(Noflg<3, + println("generate Framedata "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST,name+"=Framedata("+pA+","+dx+","+dy+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); +Framedata(nm,cent,dx,dy):=Framedata(nm,cent,dx,dy,[]); +Framedata(nm,cent,dx,dy,options):=( + regional(name,Out,tmp,tmp1,x1,y1,x2,y2,Ltype,opcindy,Noflg); + name="fr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + x1=cent.x-dx; x2=cent.x+dx; + y1=cent.y-dy; y2=cent.y+dy; + Out=[[x1,y1],[x2,y1],[x2,y2],[x1,y2],[x1,y1]]; + if(Noflg<3, + println("generate Framedata "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST,name+"=Framedata("+cent.xy+","+dx+","+dy+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +Framedata2(nm,list):=Framedata2(nm,list,[]); +Framedata2(nm,list,options):=( +//help:Framedata2("1",[A,B]); + regional(tmp,tmp1,pC,pB); + pC=(Lcrd(list_1)+Lcrd(list_2))/2; + pB=Lcrd(list_2); + Framedata(nm,[pC,pB],options); +); + +Ovaldata(nm,Pdata):=Ovaldata(nm,Pdata,[]); +Ovaldata(nm,Pdata,options):=( +//help:Ovaldata("1",[A,B]); +//help:Ovaldata(optios=[size]); + regional(name,Graph,Ctr,Dx,Dy,Rc,Out,Point,Graph, + opstr,opcindy,tmp,tmp1,tmp2,tmp3,Ltype,Noflg); + name="ov"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + opstr=tmp_(length(tmp)-1); + Rc=0.2; + tmp1=tmp_6; + if(length(tmp1)>0,Rc=tmp1_1*Rc); +// if(length(tmp1)>0,Rc=tmp1_1); //15.11.15 + Ctr=Lcrd(Pdata_1); + if(ispoint(Pdata_2) % islist(Pdata_2), + tmp1=Lcrd(Pdata_2); + Dx=abs(tmp1_1-Ctr_1); + Dy=abs(tmp1_2-Ctr_2); + , + Dx=Pdata_2; + Dy=Pdata_3; + ); + Point=Ctr+[Dx-Rc,Dy-Rc]; + tmp1=Circledata("1",[Point,Point+[Rc,0]], + ["Rng=[0,pi/2]","Num=10","nodata"]); + tmp2=Listplot("1",[Ctr+[Dx-Rc,Dy],Ctr+[0,Dy]], + ["nodata"]); + tmp3=Listplot("2",[Ctr+[Dx,0],Ctr+[Dx,Dy-Rc]], + ["nodata"]); + Graph=Joincrvs("1",[tmp3,tmp1,tmp2],["nodata"]); + tmp1=Reflectdata("1",[Graph],[Ctr,Ctr+[0,1]],["nodata"]); + Graph=Joincrvs("1",[Graph,tmp1],["nodata"]); + tmp2=Reflectdata("2",[Graph],[Ctr,Ctr+[1,0]], + ["nodata"]); + Graph=Joincrvs("2",[Graph,tmp2],["nodata"]); + if(Noflg<3, + println("generate Ovaldata "+name); + tmp1=apply(Graph,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + GLIST=append(GLIST, + name+"=Ovaldata("+Ctr+","+Dx+","+Dy+opstr+")");//16.01.30 + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + tmp1=apply(Graph,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp=textformat(Ctr,5)+","+textformat(Dx,5)+","+textformat(Dy,5); + GLIST=append(GLIST, + name+"=Ovaldata("+tmp+opstr+")"); + ); + Graph; +); + +Segmark(nm,ptlist):=Segmark(nm,ptlist,[]); +Segmark(nm,ptlist,options):=Drawsegmark(nm,ptlist,options); +Drawsegmark(nm,ptlist):=Drawsegmark(nm,ptlist,[]); +Drawsegmark(nm,ptlist,options):=( +//help:Segmark("1",[A,B]); +//help:Segmark(options=["Type=1","Width=1","Size=1"]); + regional(name,pA,pB,wid,mid,size,tp,dir,nor,eqL, + tmp,tmp1,tmp2); + name="mrk"+nm; + pA=ptlist_1; + pB=ptlist_2; + size=0.15; + wid=0.05; + tp=1; + tmp1=Divoptions(options); + eqL=tmp1_5; + forall(eqL, + tmp=indexof(#,"="); + tmp1=substring(#,tmp,length(#)); + tmp1=parse(tmp1); + tmp=substring(#,0,1); + if(tmp=="S" % tmp=="s", + size=size*tmp1; + ); + if(tmp=="W" % tmp=="w", + wid=wid*tmp1; + ); + if(tmp=="T" % tmp=="t", + tp=tmp1; + ); + ); + mid=(pA+pB)/2; + dir=(pB-pA)/|pB-pA|; + nor=[-dir_2,dir_1]; +// nor=nor/|nor|; + if(tp==1, + tmp1=mid+size*nor; + tmp2=mid-size*nor; + Listplot(name,[tmp1,tmp2]); + ); + if(tp==2, + tmp1=mid+wid*dir+size*nor; + tmp2=mid+wid*dir-size*nor; + Listplot(name+"r",[tmp1,tmp2]); + tmp1=mid-wid*dir+size*nor; + tmp2=mid-wid*dir-size*nor; + Listplot(name+"l",[tmp1,tmp2]); + ); + if(tp==3, + tmp1=mid; + tmp2=mid+size*dir; + Circledata(name,[tmp1,tmp2]); + ); + if(tp==4, + tmp=mid+size*2/sqrt(3)*nor; + tmp1=mid+size*dir-size/sqrt(3)*nor; + tmp2=mid-size*dir-size/sqrt(3)*nor; + Listplot(name,[tmp,tmp1,tmp2,tmp]); + ); +); + +Parabolaplot(nm,ptlist):=Parabolaplot(nm,ptlist,"[-5,5]",[]); +Parabolaplot(nm,ptlist,Arg):=( + regional(rng,options); + if(isstring(Arg), + rng=Arg; + options=[]; + , + rng="[-5,5]"; + options=Arg; + ); + Parabolaplot(nm,ptlist,rng,options); +); +Parabolaplot(nm,ptlist,rng,options):=( +//help:Parabolaplot("1",[A,B,C]): +//help:Parabolaplot("1",[A,B,C],"[-5,5]"); + regional(pA,pB,pC,angle,tmp,tmp1,tmp2); + tmp1=Lcrd(ptlist_1); + tmp2=Lcrd(ptlist_3); + pB=Lcrd(ptlist_2); + tmp=(tmp2-pB)/|tmp2-pB|; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + pA=Rotatepoint(tmp1,-angle,pB); + pC=Rotatepoint(tmp2,-angle,pB); + tmp1=1/(2*(pA_2-pB_2)); + tmp2=1/2*(pA_2+pB_2); + tmp="("+format(tmp1,5)+")*(x-("+format(pA_1,5)+"))^2"; + tmp=tmp+"+("+format(tmp2,5)+")"; + tmp1=parse(rng); + tmp1=[pA_1-(tmp1_2-tmp1_1)/2,pA_1+(tmp1_2-tmp1_1)/2]; + tmp2="x="+textformat(tmp1,5); + Plotdata(nm+"para",tmp,tmp2,append(options,"nodisp")); + Rotatedata(nm+"para","gr"+nm+"para",angle,append(options,pB)); +); + +Ellipseplot(nm,ptlist):=Ellipseplot(nm,ptlist,"[0,2*pi]",[]); +Ellipseplot(nm,ptlist,Arg):=( + regional(rng,options); + if(isstring(Arg), + rng=Arg; + options=[]; + , + rng="[0,2*pi]"; + options=Arg; + ); + Ellipseplot(nm,ptlist,rng,options); +); +Ellipseplot(nm,ptlist,rng,options):=( +//help:Ellipseplot("1",[A,B,3]); +//help:Ellipseplot("1",[A,B,C],"[0,pi]",[options]); + regional(pA,pB,d,angle,f,a,b,pM,tmp,tmp1,tmp2); + pA=Lcrd(ptlist_1); + tmp1=Lcrd(ptlist_2); + if(ispoint(ptlist_3), + tmp2=Lcrd(ptlist_3); + d=|tmp2-pA|+|tmp2-tmp1|; + , + d=ptlist_3; + ); + tmp=(tmp1-pA)/|tmp1-pA|; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + pB=Rotatepoint(tmp1,-angle,pA); + f=|pB_1-pA_1|/2; + a=d/2; + b=sqrt(d^2/4-f^2); + pM=(pA+pB)/2; + tmp="["+format(pM_1,5)+","+format(pM_2,5)+"]"; + tmp=tmp+"+["+format(a,5)+"*cos(t),"+format(b,5)+"*sin(t)]"; + Paramplot(nm+"elp",tmp,"t="+rng,append(options,"nodisp")); + Rotatedata(nm+"elp","gp"+nm+"elp",angle,append(options,pA)); +); + +Hyperbolaplot(nm,ptlist):=Hyperbolaplot(nm,ptlist,"[-5/2,5/2]",[]); +Hyperbolaplot(nm,ptlist,Arg):=( + regional(rng,options); + if(isstring(Arg), + rng=Arg; + options=[]; + , + rng="[-5/2,5/2]"; + options=Arg; + ); + Hyperbolaplot(nm,ptlist,rng,options); +); +Hyperbolaplot(nm,ptlist,rng,optionsorg):=( +//help:Hyperbolaplot("1",[A,B,C],["Num=200"]): +//help:Hyperbolaplot("1",[A,B,C],"[-5,5]",["Asy=do"]); + regional(pA,pB,d,angle,f,a,b,pM,eqL,options,opasy,tmp,tmp1,tmp2); + tmp=Divoptions(optionsorg); + eqL=tmp_5; + options=optionsorg; + opasy=[]; + forall(eqL, + if(Toupper(substring(#,0,1))=="A", + tmp=indexof(#,"="); + opasy=[substring(#,tmp,length(#))]; + options=remove(options,[#]); + ); + ); + pA=Lcrd(ptlist_1); + tmp1=Lcrd(ptlist_2); + if(ispoint(ptlist_3), + tmp2=Lcrd(ptlist_3); + d=abs(|tmp2-pA|-|tmp2-tmp1|); + , + d=ptlist_3; + ); + tmp=(tmp1-pA)/|tmp1-pA|; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + pB=Rotatepoint(tmp1,-angle,pA); + f=|pB_1-pA_1|/2; + a=d/2; + b=sqrt(f^2-d^2/4); + pM=(pA+pB)/2; + tmp="["+format(pM_1,5)+"+"+format(a,5)+"*(exp(t)+exp(-t))/2,"; + tmp=tmp+format(pM_2,5)+"+"+format(b,5)+"*(exp(t)-exp(-t))/2]"; + Paramplot(nm+"hyp1",tmp,"t="+rng,append(options,"nodisp")); + tmp="["+format(pM_1,5)+"-"+format(a,5)+"*(exp(t)+exp(-t))/2,"; + tmp=tmp+format(pM_2,5)+"+"+format(b,5)+"*(exp(t)-exp(-t))/2]"; + Paramplot(nm+"hyp2",tmp,"t="+rng,append(options,"nodisp")); + tmp=["gp"+nm+"hyp1","gp"+nm+"hyp2"]; + Rotatedata(nm+"hyp",tmp,angle,append(options,pA)); + if(length(opasy)>0, + Lineplot(nm+"asy1",[pM+[a,b],pM+[-a,-b]],["nodisp"]); + Lineplot(nm+"asy2",[pM+[-a,b],pM+[a,-b]],["nodisp"]); + tmp=["ln"+nm+"asy1","ln"+nm+"asy2"]; + Rotatedata(nm+"asy",tmp,angle,append(opasy,pA)); + ); +); + +Polygonplot(nm,ptlist,number):=Polygonplot(nm,ptlist,number,[]); +Polygonplot(nm,ptlist,number,options):=( +//help:Polygonplot("1",[A,B],12); + regional(rr,pA,pB,ptL,angle,tmp,tmp1,tmp2); + pA=Lcrd(ptlist_1); + pB=Lcrd(ptlist_2); + rr=|pB-pA|; + tmp=(pB-pA)/rr; + if(tmp_2>=0, + angle=arccos(tmp_1); + , + if(tmp_1>=0, + angle=arcsin(tmp_2); + , + angle=-arccos(tmp_1); + ); + ); + ptL=[]; + forall(0..number, + tmp=angle+#*2*pi/number; + tmp1=pA+rr*[cos(tmp),sin(tmp)]; + if(#>0 & #<number, + Putpoint((ptlist_2).name+text(#),tmp1);//16.10.07 + //Pointdata(nm,ptL); + ); + tmp2=tmp1; + ptL=append(ptL,tmp1); + ); + Listplot(nm+"ply",ptL,options); +); + +Putintersect(nm,pdata1,pdata2):=( +//help:Putintersect("Q","gr1","gr2"); + regional(pd1,pd2,tmp); + if(isstring(pdata1),pd1=parse(pdata1),pd1=pdata1); + if(isstring(pdata2),pd2=parse(pdata2),pd2=pdata2); + tmp=Intersectcrvs(pd1,pd2); + if(length(tmp)==1, + Putpoint(nm,tmp_1); + , + if(length(tmp)==0, + err("No intersect point"); + , + err("Multiple intersect points"); + println(tmp); + err("Choose point number"); + ); + ); +); +Putintersect(nm,pdata1,pdata2,ptno):=( + regional(pd1,pd2,tmp); + if(isstring(pdata1),pd1=parse(pdata1),pd1=pdata1); + if(isstring(pdata2),pd2=parse(pdata2),pd2=pdata2); + tmp=Intersectcrvs(pd1,pd2); + if(length(tmp)>0, + Putpoint(nm,tmp_ptno); + , + err("No intersect point"); + ); +); + +Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]); +Arrowheaddata(point,direction,options):=( +//help:Arrowheaddata(A,B); + regional(list,Ookisa,Hiraki,Futosa,Houkou,Str,Flg,tmp,Ev,Nv,pA,pB, + pP,rF,gG,Flg,Nj,Eps,tmp1,scx,scy); + Eps=10^(-3); + pP=point; + Ookisa=0.2*YaSize; + Hiraki=YaAngle; + Futosa=0; + Str=YaStyle; + tmp=Divoptions(options); + tmp1=tmp_6; + if(length(tmp1)>0,Ookisa=Ookisa*tmp1_1); + if(length(tmp1)>1, + tmp=tmp1_2; + if(tmp<5, + Hiraki=Hiraki*tmp; + , + Hiraki=tmp; + ); + ); + Flg=0; + Hiraki=Hiraki*pi/180; + if(isstring(direction),Houkou=parse(direction),Houkou=direction); + if(MeasureDepth(Houkou)==2,Houkou=Houkou_1); + if(islist(Houkou_1), +// pP=Lcrd(pP); +// pP=Doscaling(pP); +// Houkou=Dosscaling(Houkou); + pP=Pcrd(pP); + scy=SCALEY; + SCALEY=1; + tmp=Nearestpt(pP,Houkou); + pA=tmp_1; + rF=floor(tmp_2); + if(rF==1, + if(|Ptend(Houkou)-Ptstart(Houkou)|<Eps, + rF=Numptcrv(Houkou); + ); + ); + gG=apply(0..10,pP+Ookisa*cos(Hiraki)*[cos(2*pi/10*#),sin(2*pi/10*#)]); + Flg=0; + forall(1..rF,Nj, + if(Flg==0, + pB=Ptcrv(rF+1-Nj,Houkou); + tmp=IntersectcrvsPp([pA,pB],gG); + if(length(tmp)>0, + Houkou=pP-tmp_1_1; + Flg=1; + ); + pA=pB; + ); + ); + SCALEY=scy; + if(Flg==0, + println("Arrowhead may be too large (no intersect)"); + Flg=2; + ); + if(Flg==1, + Houkou=Unscaling(Houkou); + pP=Unscaling(pP); + ); + ); + if(Flg<2, +// pP=Doscaling(pP); +// Houkou=Doscaling(Houkou); + pP=Pcrd(pP); + if(!ispoint(point), + Houkou=Pcrd(Houkou); + ); +// if(MeasureDepth(Houkou)==0,Houkou=Pcrd(Houkou)); + Ev=-1/|Houkou|*Houkou; + Ev=Lcrd(Ev); + Nv=[-Ev_2, Ev_1]; + if(indexof(Str,"c")>0, + pP=pP-0.5*Ookisa*cos(Hiraki)*Ev; + ); + if(indexof(Str,"b")>0, + pP=pP-Ookisa*cos(Hiraki)*Ev; + ); + pA=pP+Ookisa*cos(Hiraki)*Ev+Ookisa*sin(Hiraki)*Nv; + pB=pP+Ookisa*cos(Hiraki)*Ev-Ookisa*sin(Hiraki)*Nv; + list=[pA,pP,pB]; + list=apply(list,LLcrd(#)); +// Out=Unscaling(Out); + list; + ); +); + +Arrowhead(point,Houkou):=Arrowhead(point,Houkou,[]); +Arrowhead(point,Houkou,options):=( +//help:Arrowhead(B,B-A,[1.5,30]); +//help:Arrowhead(A,"gr1"); + // global ArrowheadNumber + regional(name,Ltype,Noflg,reL,opstr,opcindy,ptstr,hostr,tmp,tmp1,list); + name="arh"+text(ArrowheadNumber); + ArrowheadNumber=ArrowheadNumber+1; + ptstr=textformat(point,5); + if(isstring(Houkou), // 15.01.11 + tmp=parse(Houkou); + if(MeasureDepth(tmp)<2, + hostr=Houkou; + , + hostr=Houkou+"(1)"; + ); + , + if(ispoint(point), + hostr=textformat(LLcrd(Houkou),5); + , + hostr=textformat(Houkou,5); + ); + ); + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + reL=tmp_6; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + list=Arrowheaddata(point,Houkou,options); + if(Noflg<3, +// println("generate Arrowhead "+name); + tmp1=apply(list,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// GLIST=append(GLIST,name+"=Listplot("+list+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(1)+Ltype,name); + , +// if(Noflg==1,Ltype=0); + Ltype=0; + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + if(Noflg==0, + if(length(reL)<3, // 16.04.09 from + forall(1..(2-length(reL)), + opstr=opstr+",1"; + ); + tmp=PenThick/PenThickInit; + opstr=opstr+","+text(tmp); + ); // 16.04.09 upto + Com2nd("Arrowhead("+ptstr+","+hostr+opstr+")"); + ); +); + +Arrowdata(ptlist):=Arrowdata(ptlist,[]); +Arrowdata(Arg1,Arg2):=( + regional(tmp,nm,ptlist,flg,pA,pB,options); + flg=0; + if(isstring(Arg1), + nm=Arg1; + ptlist=Arg2; + Arrowdata(nm,ptlist,[]); + flg=1; + ); + if(flg==0, + tmp=MeasureDepth(Arg1); + if(tmp==0, + pA=Arg1; + pB=Arg2; + Arrowdata(pA,pB,[]); + , + ptlist=Arg1; + options=Arg2; + nm=text(ArrowlineNumber); + ArrowlineNumber=ArrowlineNumber+1; + Arrowdata(nm,ptlist,options); + ); + ); +); +Arrowdata(Arg1,Arg2,options):=( +//help:Arrowdata([A,B],[2,10]); + regional(Retflg,nm,ptlist,name,opstr,opcindy,realL,strL,size, + flg,Ltype,Noflg,lineflg,tmp,tmp1,tmp2,pA,pB,segpos); + Retflg=0; + Noflg=0; + Ltype=0; + if(!isstring(Arg1), + pA=Arg1; + pB=Arg2; + Arrowdata(pA,pB,options,"old"); + Retflg=1; + ptlist=[pA,pB]; + ); + if(Retflg==0, + nm=Arg1; + ptlist=Arg2; + name="ar"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + realL=tmp_6; + strL=tmp_7; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + size=1; // 15.06.11 + if(length(realL)>0, + size=realL_1; + ); + tmp2=select(strL,indexof(#,"l")>0); // 16.04.09 + if(length(tmp2)>0,lineflg=1,lineflg=0); // 16.04.09 + segpos=1; + tmp1=tmp_5; + if(length(tmp1)>2, + segpos=tmp1_3; + ); + if(Noflg<3, +// println("generate Arrowdata "+name); + tmp1=apply(ptlist,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=Pcrd(ptlist_1);//16.10.20 + tmp2=Pcrd(ptlist_2);//16.10.20 + if(lineflg==0, // 16.04.09 from + tmp=tmp2-0.2*size/2*(tmp2-tmp1)/|tmp2-tmp1|; // 15.06.11 + , + tmp=tmp2; + ); // 16.04.09 upto + tmp=[LLcrd(tmp1),LLcrd(tmp)];//16.10.20 + GLIST=append(GLIST,name+"=Listplot("+textformat(tmp,5)+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + tmp=textformat(ptlist,5); + tmp=substring(tmp,1,length(tmp)-1); + tmp1=indexof(tmp,"],["); + if(tmp1>0, + pA=substring(tmp,0,tmp1); + pB=substring(tmp,tmp1+1,length(tmp)); + , + tmp1=indexof(tmp,","); + pA=substring(tmp,0,tmp1-1); + pB=substring(tmp,tmp1,length(tmp)); + ); + tmp1="Lcrd("+pA+")+" + +textformat(segpos,5)+"*(Lcrd("+pB+")-"+"Lcrd("+pA+"))"; + tmp1=parse(tmp1); + tmp2="Lcrd("+pB+")-Lcrd("+pA+")"; + tmp2=parse(tmp2); + Arrowhead(tmp1,tmp2,options); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + ); + ptlist; +); +Arrowdata(pA,pB,options,str):=( + regional(ptA,ptB,opstr,Astr,Bstr,name,tmp,opcindy); + Astr=textformat(pA,5); + Bstr=textformat(pB,5); + name="ar"+pA.name+pB.name; + println("generate Arrow "+name); + opstr=""; + opcindy=""; + forall(options, + if(isstring(#), + if(indexof(#,"->")>0, + opcindy=opcindy+","+#; + , + tmp="'"+#+"'"; + ); + , + tmp=text(#); + ); + opstr=opstr+","+tmp; + ); + ptA=Lcrd(pA); + ptB=Lcrd(pB); + Arrowheaddata(ptB,ptB-ptA,options); + tmp="connect("+textformat([ptA,ptB],5) + +",linecolor->"+text(KCOLOR)+opcindy+");"; + parse(tmp); // 14.11.17 + Com2nd("Arrowline("+Astr+","+Bstr+opstr+")"); // 14.10.04 +); + +Anglemark(plist):=Anglemark(plist,[]); +Anglemark(Arg1,Arg2):=( // 2015.04.28 from + regional(nm,plist,options,tmp); + if(isstring(Arg1), + nm=Arg1; + plist=Arg2; + Anglemark(nm,plist,[]); + , + plist=Arg1; + options=Arg2; + tmp=textformat(plist,5); + tmp=replace(tmp,",",""); + nm=substring(tmp,1,length(tmp)-1); + Anglemark(nm,plist,options); + ); +); // upto +Anglemark(nm,plist,options):=( +//help:Anglemark([A,B,C],["E=\theta",2]); +//help:Anglemark("1",[A,B,C],["E=1.2,\theta",2]); +//help:Anglemark(options=["E/L=(sep,)letter",size]); + regional(name,Out,pB,pA,pC,Ctr,ra,sab,sac,ratio,opstr,Bname,Bpos, + Brat,tmp,tmp1,tmp2,Num,opcindy,Ltype,eqL,realL,Rg,Th,Noflg); + name="ag"+nm; + ra=0.5; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + realL=tmp_6; + Bname=""; + Brat=1.5; + Num=20; + if(length(realL)>0, + ra=realL_1*ra; + opstr=opstr+","+text(realL_1); + ); + forall(eqL, + if(substring(#,0,1)=="L",Bname="Letter("); + if(substring(#,0,1)=="E",Bname="Expr("); + Bpos="md"+name; + Bname=Bname+Bpos+","+Dq+"c"+Dq+","+Dq;//16.10.29 + tmp=substring(#,indexof(#,"="),length(#)); + tmp1=indexof(tmp,","); + Bname=Bname+substring(tmp,tmp1,length(tmp))+Dq+")"; + if(tmp1>0, + Brat=parse(substring(tmp,0,tmp1-1)); + ); + ); + pB=Lcrd(plist_1); pA=Lcrd(plist_2); pC=Lcrd(plist_3); + Ctr=Lcrd(pA); + sab=pB-pA; + sac=pC-pA; + Rg=[arctan2(sab)+0,arctan2(sac)+0]; + if(Rg_2<Rg_1,Rg_2=Rg_2+2*pi); + Out=[]; + forall(0..Num, + Th=Rg_1+#*(Rg_2-Rg_1)/Num; + Out=append(Out,Ctr+ra*[cos(Th),sin(Th)]); + ); + if(length(Bname)>0, + Th=(Rg_1+Rg_2)/2; + tmp1=Ctr+Brat*ra*[cos(Th),sin(Th)]; + tmp="Defvar("+Dq+Bpos+"="; + tmp=tmp+textformat(tmp1,5)+Dq+");"; + parse(tmp); + parse(Bname); + ); + if(Noflg<3, + println("generate anglemark "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp=textformat(plist,5); + tmp1=substring(tmp,1,length(tmp)-1); + tmp=name+"=Anglemark("+tmp1+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +Paramark(plist):=Paramark(plist,[]); +Paramark(plist,options):=( +//help:Paramark([A,B,C],["E=\theta"]); + regional(name,Out,pB,pA,pC,ra,sab,sac,ratio,opstr,Bname,Bpos, + Brat,tmp,tmp1,tmp2,Ltype,Noflg,eqL,realL,opcindy); + tmp=textformat(plist,5); + tmp=replace(tmp,",",""); + tmp=substring(tmp,1,length(tmp)-1); + name="pm"+tmp; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + realL=tmp_6; + ra=0.5; + Bname=""; + Brat=1.2; + if(length(realL)>0, + tmp=realL_1; + ra=tmp*ra; + opstr=opstr+","+text(tmp); + ); + forall(eqL, + if(substring(#,0,1)=="L",Bname="Letter("); + if(substring(#,0,1)=="E",Bname="Expr("); + Bpos="md"+name; + Bname=Bname+Dq+Bpos+Dq+","+Dq+"c"+Dq+","+Dq; + tmp=substring(#,indexof(#,"="),length(#)); + tmp1=indexof(tmp,","); + Bname=Bname+substring(tmp,tmp1,length(tmp))+Dq+")"; + if(tmp1>0, + Brat=parse(substring(tmp,0,tmp1-1)); + ); + ); + pB=Lcrd(plist_1); pA=Lcrd(plist_2); pC=Lcrd(plist_3); + Ctr=Lcrd(pA); + Out=[]; + Out=append(Out,pA+ra*(pB-pA)/|pB-pA|); + Out=append(Out,pA+ra*(pB-pA)/|pB-pA|+ra*(pC-pA)/|pC-pA|); + Out=append(Out,pA+ra*(pC-pA)/|pC-pA|); + if(length(Bname)>0, + tmp1=pA+Brat*ra*(pB-pA)/|pB-pA|+Brat*ra*(pC-pA)/|pC-pA|; + tmp="Defvar("+Dq+Bpos+"="+textformat(tmp1,5)+Dq+");"; + parse(tmp); + parse(Bname); + ); + if(Noflg<3, + println("generate paramark "+name); + tmp1=apply(Out,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=substring(textformat(plist,5),1,length(textformat(plist,5))-1); + tmp=name+"=Paramark("+tmp1+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + Out; +); + +MakeBowdata(pA,pB,Hgt):=( + regional(angle,pB2,pH2,pC2,pC,tmp,Th1,Th2,ra,dMA); + angle=arctan2(pB-pA)+0; + pB2=Rotatepoint(pB,-angle,pA); + tmp=Lcrd(pA); + pH2=[(tmp_1+pB2_1)/2,tmp_2-Hgt]; + dMA=|tmp-pB2|/2; + ra=(dMA^2+Hgt^2)/(2*Hgt); + pC2=[pH2_1,pB2_2+(ra-Hgt)]; + pC=Rotatepoint(pC2,angle,pA); + Th1=arctan2(pA-pC2)+angle; + Th2=arctan2(pB2-pC2)+angle; + [pC,ra,Th1,Th2]; +); + +Bowdata(nm,plist,options):=( +//help:Bowdata([C,A],[2,1.2,"Expr=10","da"]); +//help:Bowdata([A,B],["Expr=t0n3,a"]); +//help:Bowdata([A,B],["Exprrot=t0n2r,a"]); + regional(name,Out,pB,pA,pC,ra,tmp,tmp1,tmp2,Ltype,eqL,realL, + Bname,Bpos,Th,Cut,Num,Hgt,opstr,opcindy,Ydata,pC, + Th1,Th2,Noflg,Bops,Bmov,Tmov,Nmov,rev); + name="bw"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + eqL=tmp_5; + realL=tmp_6; + pA=Lcrd(plist_1); pB=Lcrd(plist_2); + Hgt=1/2*|pB-pA|*0.2; + Cut=0; + Num=24; + Bname=""; + Tmov=0;//16.11.01from + Nmov=0; + Bmov=""; + rev=0;//16.11.01upto + if(length(realL)>0, + Hgt=realL_1*Hgt; // 15.04.12 + if(length(realL)>1,Cut=realL_2); + ); + forall(eqL, + tmp=substring(#,0,1); + if(tmp=="L" % tmp=="l", + if(indexof(#,"rot")>0, + Bname="Letterrot("; + , + Bname="Letter("; + ); + ); + if(tmp=="E" % tmp=="e", + if(indexof(#,"rot")>0, + Bname="Exprrot("; + , + Bname="Expr("; + ); + ); + tmp=indexof(#,"="); + Bops=substring(#,tmp,length(#)); // 16.11.01 + ); + Ydata=MakeBowdata(pA,pB,Hgt); + pC=Ydata_1; + ra=Ydata_2; + Th=(Ydata_3+Ydata_4)*0.5; + BOWMIDDLE=[pC_1+ra*cos(Th),pC_2+ra*sin(Th)]; + Bpos="md"+name; // 16.10.31from(moved) + tmp="Defvar("+Dq+Bpos+"="+textformat(BOWMIDDLE,5)+Dq+");"; + parse(tmp);// 16.10.31upto(moved) + if(length(Bname)>0, //16.11.01from + tmp=indexof(Bops,","); + if(tmp>0, + tmp1=substring(Bops,0,tmp-1); + if(length(tmp1)>=4 & substring(tmp1,0,1)=="t" & indexof(tmp1,"n")>0, + Bmov=tmp1; + Bops=substring(Bops,tmp,length(Bops)); + ); + ); + if(length(Bmov)>0, + tmp=indexof(Bmov,"t"); + if(tmp>0, + tmp1=indexof(Bmov,"n"); + Tmov=parse(substring(Bmov,tmp,tmp1-1)); + tmp=indexof(Bmov,"r"); + if(tmp>0, + Nmov=parse(substring(Bmov,tmp1,tmp-1)); + rev=1; + , + Nmov=parse(substring(Bmov,tmp1,length(Bmov))); + ); + ); + ); + Bname=Bname+Bpos;//16.11.01 + if(abs(Tmov)+abs(Nmov)>0, + tmp=Pcrd(pA)-Pcrd(pB); + tmp1=1/norm(tmp)*tmp; + tmp2=[-tmp1_2,tmp1_1]; + tmp=MARKLEN*(Tmov*tmp1+Nmov*tmp2); + tmp=LLcrd(tmp); + Bname=Bname+"+"+text(tmp); + ); + Bname=Bname+","; + if(indexof(Bname,"rot")>0, + if(rev==1,tmp=pB-pA,tmp=pA-pB); + Bname=Bname+textformat(tmp,5)+","; + , + Bname=Bname+Dq+"c"+Dq+","; + ); + Bname=Bname+Dq+Bops+Dq+")"; + parse(Bname); + );//16.11.01upto + if(Cut==0, + Th1=Ydata_3; + Th2=Ydata_4; + Out=[]; + forall(0..Num, + tmp=Th1+#*(Th2-Th1)/Num; + Out=append(Out,pC+ra*[cos(tmp),sin(tmp)]); + ); + , + Th1=Ydata_3; + Th2=Th-Cut/(2*ra); + tmp1=[]; + forall(0..Num/2, + tmp=Th1+#*(Th2-Th1)/(Num/2); + tmp1=append(tmp1,pC+ra*[cos(tmp),sin(tmp)]); + ); + Th1=Th+Cut/(2*ra); + Th2=Ydata_4; + tmp2=[]; + forall(0..Num/2, + tmp=Th1+#*(Th2-Th1)/(Num/2); + tmp2=append(tmp2,pC+ra*[cos(tmp),sin(tmp)]); + ); + Out=[tmp1,tmp2]; + ); + if(Noflg<3, + println("generate bowdata "+name+" and "+Bpos);//16.10.31 + if(MeasureDepth(Out)==1,Out=[Out]); + tmp1=[]; + forall(Out,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=substring(textformat(plist,5),1,length(textformat(plist,5))-1); + tmp=name+"=Bowdata("+tmp1+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); +); + +Deqplot(nm,deq,rng,initf):=Deqplot(nm,deq,rng,Lcrd(initf)_1,initf,[]); +Deqplot(nm,deq,rng,Arg1,Arg2):=( + regional(initt,initf,options); + if(isreal(Arg1) & length(Arg1)==1, + initt=Arg1; + initf=Arg2; + options=[]; + , + initf=Lcrd(Arg1); + initt=initf_1; + options=Arg2; + ); + Deqplot(nm,deq,rng,initt,initf,options); +); +Deqplot(nm,deq,rng,initt,initf,options):=( + regional(name,Noflg,Ltype,eqL,opstr,opcindy,pdL,var2,deq2,rng2,initt2,initf2, + tmp,tmp1,tmp2,tmp3,tmp4); + tmp=tokenize(deq,"="); + tmp1=tmp_1; + tmp2=tmp_2; + tmp3=tokenize(tmp1,"`"); + if(length(tmp3)==2, + if(indexof(tmp1,"[")>0, + Deqplot(nm,deq,rng,initt,initf,options,[2,3]); + , + if(indexof(rng,"=")>0,rng2=rng,rng2=rng+"=[XMIN,XMAX]"); + tmp=tokenize(rng2,"="); + deq2="["+tmp_1+","+replace(tmp1,"`","]")+"`=[1,"+tmp2+"]"; + rng2="t="+tmp_2; + if(isreal(initf) & length(initf)==1, + initf2=[initt,initf]; + initt2=initt; + , + initf2=Lcrd(initf)); + initt2=initf2_1; + Deqplot(nm,deq2,rng2,initt2,initf2,options,[2,3]); + ); + , + name="de"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + eqL=tmp_5; + opcindy=tmp_9; + opstr=""; + forall(eqL, + if(Toupper(substring(#,0,1))=="N", + tmp=indexof(#,"="); + tmp1="N="+substring(#,tmp,length(#)); + opstr=opstr+",'"+tmp1+"'"; + ); + ); + if(Noflg<1, + if(indexof(rng,"=")>0,rng2=rng,rng2=rng+"=[XMIN,XMAX]"); + var2="d"+tmp3_1; + deq2="["+tmp3_1+","+var2+"]`=["; + tmp=replace(tmp2,tmp3_1+"`",var2); + deq2=deq2+var2+","+tmp+"]"; + Deqplot(nm,deq2,rng2,initt,initf,append(options,"nodisp"),[1,2]); + parse(tmp); + tmp=name+"=Deqplot(Assign("+Dq+deq+Dq+"),'"+rng+"',"; + tmp=tmp+initt+","+initf+opstr+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + parse("de"+nm); + ); + ); +); +Deqplot(nm,deq,rng,initt,initf,options,Sel):=( +//help:Deqplot("2","y`=y*(1-y)","x",0, 0.5,["Num=100"]); +//help:Deqplot("1","y``=-y","x",0, [1,0]); +//help:Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",[1,0.5]); + regional(Ltype,Noflg,Inflg,Outflg,strL,opstr,opcindy,Num, + outstr,name,func,xf,yf,pdL,Eps,Inf,t1,t2,tt,Vname,dt,funP,funN,flg, + kl1,kl2,kl3,kl4,x0,y0,x1,y1,tmp,tmp1,tmp2); + name="de"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + Inflg=tmp_3; + Outflg=tmp_4; + eqL=tmp_5; + strL=tmp_7; +// opstr=tmp_(length(tmp)-1); + opstr=""; + opcindy=tmp_(length(tmp)); + outstr=""; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="S", + outstr="Sci"; + ); + ); + Num=50; + forall(eqL, + tmp=indexof(#,"="); + tmp2=substring(#,0,1); + tmp2=Toupper(tmp2); + tmp1=substring(#,tmp,length(#)); + opstr=opstr+",'"+tmp2+"="+tmp1+"'"; + if(Toupper(substring(#,0,1))=="N", + Num=parse(tmp1); + ); + ); + if(outstr=="Sci", + if(Inflg==0 & Outflg==0,Outflg=1;Inflg=1); + ); + if(Noflg<3, + if(outstr=="Sci", + if(Outflg==1, + println("Output Deqplot "+name); + SCIWRLIST=append(SCIWRLIST,name); + ); + if(Inflg==1, + println("Input Deqplot "+name); + if(length(SCIRELIST)==0, + ReadOutData(Fnameout); + ); + tmp=parse(name); + if(islist(tmp), + Extractdata(name,["nodisp"]); // 12.19 + ); + SCIRELIST=append(SCIRELIST,name); + ); + , + Eps=10^(-3); + Inf=10^3; + tmp=tokenize(deq,"="); + tmp1=tmp_1; + func=tmp_2; + tmp=indexof(tmp1,","); + xf=substring(tmp1,1,tmp-1); + yf=substring(tmp1,tmp,length(tmp1)); + tmp=indexof(yf,"]"); + yf=substring(yf,0,tmp-1); + tmp=tokenize(rng,"="); + Vname=tmp_1; + tmp=parse(tmp_2); + t1=tmp_1; + t2=tmp_2; + tmp="funP("+Vname+","+xf+","+yf+"):="+func+";"; + parse(tmp); + tmp=tokenize(func,","); + tmp1="-("+substring(tmp_1,1,length(tmp_1))+")"; + tmp2="-("+substring(tmp_2,0,length(tmp_2)-1)+")"; + tmp="funN("+Vname+","+xf+","+yf+"):=["+tmp1+","+tmp2+"];"; + parse(tmp); + dt=(t2-t1)/Num; + tt=initt; + tmp=Lcrd(initf); + x0=tmp_1; + y0=tmp_2; + pdL=[[tt,x0,y0]]; + flg=0; + forall(1..floor((t2-initt)/dt), + if(flg==0, + kl1=dt*funP(tt,x0,y0); + kl2=dt*funP(tt+dt/2,x0+kl1_1/2,y0+kl1_2/2); + kl3=dt*funP(tt+dt/2,x0+kl2_1/2,y0+kl2_2/2); + kl4=dt*funP(tt+dt,x0+kl3_1,y0+kl3_2);//16.10.14 + tmp1=[x0,y0]+(kl1+2*kl2+2*kl3+kl4)/6; + x0=tmp1_1; + y0=tmp1_2; + tt=initt+#*dt; + pdL=append(pdL,[tt,x0,y0]); + if(|tmp1|>Inf,flg=1); + ); + ); + tt=initt; + tmp=Lcrd(initf); + x0=tmp_1; + y0=tmp_2; + flg=0; + forall(1..floor((initt-t1)/dt), + if(flg==0, + kl1=dt*funN(tt,x0,y0); + kl2=dt*funN(tt+dt/2,x0+kl1_1/2,y0+kl1_2/2); + kl3=dt*funN(tt+dt/2,x0+kl2_1/2,y0+kl2_2/2); + kl4=dt*funN(tt+dt/2,x0+kl3_1/2,y0+kl3_2/2); + tmp1=[x0,y0]+(kl1+2*kl2+2*kl3+kl4)/6; + x0=tmp1_1; + y0=tmp1_2; + tt=initt-#*dt; + pdL=prepend([tt,x0,y0],pdL); + if(|tmp1|>Inf,flg=1); + ); + ); + println("Generate Deqplot "+name); + pdL=apply(pdL,#_Sel); + tmp1=apply(pdL,Pcrd(#)); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + ); + if(Noflg<1, + tmp=name+"=Deqplot(Assign("+Dq+deq+Dq+"),'"+rng+"',"; + tmp=tmp+initt+","+initf+opstr+")"; + GLIST=append(GLIST,tmp); + ); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + if(outstr=="Sci", + if(Inflg==1, + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + , + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + pdL; + ); + ); +); + +Enclosing(nm,plist):=EnclosingS(nm,plist); +Enclosing(nm,plist,options):=EnclosingS(nm,plist,options); +EnclosingS(nm,plist):=EnclosingS(nm,plist,[]); +EnclosingS(nm,plist,options):=( +//help:Enclosing("1",["sc2","crAB","sc2","Invert(sc1)"],[pt,"dr"]); + regional(name,AnsL,Start,Eps,EEps,S,Flg,Fdata,Gdata,KL,pt,qt, + t1,t2,t3,ii,nn,tmp,tmp1,tmp2,Ltype,Noflg,realL,eqL,opstr,opcindy); + name="en"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + eqL=tmp_5; + realL=tmp_6; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + Eps=10^(-3); + EEps=0.1; + Start=[]; + Flg=0; + forall(realL, + if(isList(#) % ispoint(#), + Start=Lcrd(#); // 15.09.12 + , + Flg=Flg+1; + if(Flg==1,Eps=#); + if(Flg==2,EEps=#); + ); + ); +// tmp1=concat([Eps,EEps],eqL); // 15.04.06 + Fdata=plist_1; + Gdata=plist_(length(plist)); + KL=IntersectcrvsPp(Fdata,Gdata); + if(length(KL)==1, + pt=KL_1_1; + t1=KL_1_2; + ); + if(length(KL)==0, + if(Numptcrv(Fdata)>Numptcrv(Gdata), + tmp=Nearestpt(Fdata,Gdata); + pt=tmp_1; + t1=tmp_2; + , + tmp=Nearestpt(Gdata,Fdata); + pt=tmp_3; + t1=tmp_4; + ); + ); + if(length(KL)>1, + if(Start==[], + err("No Start Point"); + , + pt=KL_1_1; + t1=KL_1_2; + tmp=|pt-Start|; + forall(2..length(KL),ii, // 15.04.20 + tmp1=KL_ii_1; + tmp2=|tmp1-Start|; // 15.04.20 + if(tmp2<tmp, + pt=tmp1; + t1=KL_ii_2; + tmp=tmp2; + ); + ); + ); + ); +// pt=Pcrd(pt); // 15.09.12 + Start=pt; + AnsL=[]; + forall(1..length(plist),nn, + Fdata=plist_nn; + if(nn>1, pt=qt); + if(nn==length(plist), + qt=Start; + , + Flg=0; + Gdata=plist_(nn+1); +// tmp1=concat([Eps,EEps],eqL); // 15.04.06 + KL=IntersectcrvsPp(Gdata,Fdata); + if(length(KL)==1, + tmp=KL_1; + qt=KL_1_1; + t3=KL_1_2; + Flg=10; + ); + if(length(KL)==0,Flg=1); + if(length(KL)>1, + tmp1=KL_1_1; + tmp2=KL_2_1; + tmp=|tmp1-tmp2|; + if(tmp<Eps*10, Flg=1); + ); + if(Flg==1, + if(Numptcrv(Fdata)>Numptcrv(Gdata), + tmp=Nearestpt(Fdata,Gdata); + qt=tmp_1; + t3=tmp_4; + Flg=10; + , + tmp=Nearestpt(Gdata,Fdata); + qt=tmp_3; + t3=tmp_2; + Flg=10; + ); + ); + if(Flg<10, + t2=10^6; //%inf; + forall(1..length(KL),ii, + tmp1=KL_ii_1; + tmp=KL_ii_3; + tmp2=ParamonCurve(tmp1,tmp,Fdata); + tmp3=KL_ii_2; + if(tmp2>t1+Eps & tmp2<t2+Eps, + qt=tmp1; + t2=tmp2; + t3=tmp3; + ); + ); + ); + ); + tmp=Partcrv("",pt,qt,Fdata,["nodata"]); + t1=t3; + if(nn==1, + AnsL=tmp; + , + AnsL=concat(AnsL,tmp_(2..length(tmp))); + ); + ); + AnsL=apply(AnsL,Pcrd(#)); // 15.09.12 + AnsL_(length(AnsL))=AnsL_1;//16.10.20 + if(Noflg<3, + println("generate Enclosing "+name); + tmp=name+"="+textformat(AnsL,5); + parse(tmp); +// tmp=name+"=Enclosing(";//16.10.20from +// tmp1="list("; +// forall(plist, +// tmp1=tmp1+#+","; +// ); +// tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; + tmp=apply(AnsL,LLcrd(#)); + tmp=name+"=Listplot("+textformat(tmp,5)+")";//16.10.20upto + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + tmp=apply(AnsL,LLcrd(#));//16.10.20 + tmp; +); + +Shade(plist):=Shade(plist,[]); +Shade(plist,options):=( +//help:Shade(["gr2","sg1"],[0.5]); +//help:Shade([pointlist],[0.5]); + regional(tmp,tmp1,tmp2,opstr,opcindy,Str,G2,flg); + if(isstring(plist_1), // 16.01.24 + println("output Shade of "+plist); + , + println("output Shade of lists"); + ); + tmp=Divoptions(options); + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + flg=0; + forall(plist, + if(flg==0, + if(isstring(#),tmp=parse(#),tmp=#); // from 16.01.24 + if(!islist(tmp),flg=1); upto + ); + ); + if(flg==1, +// err("some data not defined yet"); + , + G2=Joincrvs("1",plist,["nodata"]); + G2=apply(G2,Pcrd(#)); + tmp1="fillpoly("+textformat(G2,5)+opcindy+");"; + parse(tmp1); + ); + Str="Shade("; + tmp1="list("; + forall(plist, + if(isstring(#), // from 16.01.24 + if(length(#)>1, + tmp1=tmp1+#+","; + , + tmp1=tmp1+Dq+#+Dq+","; + ); + , + tmp1=tmp1+"Listplot("+textformat(#,5)+"),"; + ); // upto 16.01.24 + ); + Str=Str+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; + Com2nd(Str); +); + + +//help:start(); + +Rotatepoint(point,Theta,ctr):=( +//help:Rotatepoint(A,2*pi/3,B); + regional(X1,X2,Y1,Y2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + tmp=Lcrd(ctr); + Cx=tmp_1; Cy=tmp_2; + X2=Cx+(X1-Cx)*cos(Theta)-(Y1-Cy)*sin(Theta); + Y2=Cy+(X1-Cx)*sin(Theta)+(Y1-Cy)*cos(Theta); + [X2,Y2]; +); + +Translatepoint(point,mov):=( +//help:Translatepoint(A,[2,3]); + regional(X1,X2,Y1,Y2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + tmp=Lcrd(mov); + Cx=tmp_1; Cy=tmp_2; + X2=X1+Cx; + Y2=Y1+Cy; + [X2,Y2]; +); + +Scalepoint(point,ratio,center):=( +//help:Scalepoint(A,[3,2],[0,0]); + regional(X1,X2,Y1,Y2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + tmp=Lcrd(center); + Cx=tmp_1; Cy=tmp_2; + X2=Cx+ratio_1*(X1-Cx); + Y2=Cy+ratio_2*(Y1-Cy); + [X2,Y2]; +); + +Reflectpoint(point,symL):=( +//help:Reflectpoint(A,B); +//help:Reflectpoint(A,[[2,3]]); +//help:Reflectpoint(A,[C,E]);\\ + regional(X1,X2,Y1,Y2,Us,Vs,Pt1,Pt2,Cx,Cy,tmp); + tmp=Lcrd(point); + X1=tmp_1; Y1=tmp_2; + Pt1=Lcrd(symL_1); + if(length(symL)==1, + Pt2=Pt1; + , + Pt2=Lcrd(symL_2); + ); + Us=Pt2_1-Pt1_1; + Vs=Pt2_2-Pt1_2; + if(Pt1==Pt2, + X2=2*Pt1_1-X1; + Y2=2*Pt1_2-Y1; + , + X2=(Us^2-Vs^2)/(Us^2+Vs^2)*X1+2*Us*Vs/(Us^2+Vs^2)*Y1 + -2*Vs*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + Y2=2*Us*Vs/(Us^2+Vs^2)*X1-(Us^2-Vs^2)/(Us^2+Vs^2)*Y1 + +2*Us*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + ); + [X2,Y2]; +); + +Rotatedata(nm,plist,Theta):=Rotatedata(nm,plist,Theta,[]); +Rotatedata(nm,plist,angle,options):=( +//help:Rotatedata("1","crAB",pi/3,[[1,5],"dr,2"]); + regional(tmp,tmp1,tmp2,pdata,Theta,Pt,Cx,Cy,PdLL,PdL, + opcindy,Nj,Njj,Kj,Mj,X1,Y1,X2,Y2,Ltype,Noflg,name); + name="rt"+nm; + Pt=[0,0]; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + tmp1=tmp_6; + if(length(tmp1)>0,Pt=Lcrd(tmp1_1)); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + if(isstring(angle),Theta=parse(angle),Theta=angle); + Cx=Pt_1; Cy=Pt_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X1=tmp_1; + Y1=tmp_2; + X2=Cx+(X1-Cx)*cos(Theta)-(Y1-Cy)*sin(Theta); + Y2=Cy+(X1-Cx)*sin(Theta)+(Y1-Cy)*cos(Theta); + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate Rotatedata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// tmp1=textformat(plist,5); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=Rotatedata("+tmp1+"," + +textformat(angle,5)+","+textformat(Pt,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +translatedata(nm,plist,mov):=translatedata(nm,plist,mov,[]); +translatedata(nm,plist,mov,options):=( +//help:translatedata("1",["gr1"],[1,2]); + regional(tmp,tmp1,tmp2,pdata,Cx,Cy,PdL,Nj,Njj,Kj, + opcindy,X2,Y2,Ltype,Noflg,name); + name="tr"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + tmp=Lcrd(mov); + Cx=tmp_1; Cy=tmp_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X2=tmp_1+Cx; + Y2=tmp_2+Cy; + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate translatedata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// tmp1=textformat(plist,5); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=translatedata("+tmp1+","+textformat(mov,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +Scaledata(nm,plist,ratioV):=( + regional(tmp); + tmp=Lcrd(ratioV); + Scaledata(nm,plist,tmp_1,tmp_2,[]); +); +Scaledata(nm,plist,Arg1,Arg2):=( +//help:Scaledata("1","crAB",3,2,[[0,0]]); + regional(tmp,options); + if(islist(Arg2), + tmp=Lcrd(Arg1); + options=Arg2; + Scaledata(nm,plist,tmp_1,tmp_2,options); + , + Scaledata(nm,plist,Arg1,Arg2,[]); + ); +); +Scaledata(nm,plist,rx,ry,options):=( + regional(tmp,tmp1,tmp2,pdata,Theta,Pt,Cx,Cy,PdL, + opcindy,Nj,Njj,Kj,X2,Y2,Ltype,Noflg,name); + name="sc"+nm; + Pt=[0,0]; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + tmp1=tmp_6; + if(length(tmp1)>0, + Pt=Lcrd(tmp1_1); + ); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + Cx=Pt_1; Cy=Pt_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X2=Cx+rx*(tmp_1-Cx); + Y2=Cy+ry*(tmp_2-Cy); + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate Scaledata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=Scaledata("+tmp1+"," + +textformat(rx,5)+","+textformat(ry,5)+","+textformat(Pt,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +Reflectdata(nm,plist,symL):=Reflectdata(nm,plist,symL,[]); +Reflectdata(nm,plist,symL,options):=( +//help:Reflectdata("1","crAB",[C]); + regional(tmp,tmp1,tmp2,pdata,Us,Vs,Pt1,Pt2,Cx,Cy,PdL, + opcindy,Nj,Njj,Kj,X1,Y1,X2,Y2,Ltype,Noflg,name); + name="re"+nm; + Pt=[0,0]; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opcindy=tmp_(length(tmp)); + pdata=plist; + if(isstring(pdata),pdata=[pdata]); + if(!isstring(pdata_1) & MeasureDepth(pdata)==1, + pdata=[pdata]; + ); + Pt1=Lcrd(symL_1); + if(length(symL)==1, + Pt2=Pt1; + , + Pt2=Lcrd(symL_2); + ); + Us=Pt2_1-Pt1_1; + Vs=Pt2_2-Pt1_2; + PdL=[]; + forall(pdata,Njj, + if(isstring(Njj),Kj=parse(Njj),Kj=Njj); + if(MeasureDepth(Kj)==1,Kj=[Kj]); + tmp2=[]; + forall(Kj,Nj, + tmp1=[]; + forall(Nj, + tmp=LLcrd(#); + X1=tmp_1; + Y1=tmp_2; + if(Pt1==Pt2, + X2=2*Pt1_1-X1; + Y2=2*Pt1_2-Y1; + , + X2=(Us^2-Vs^2)/(Us^2+Vs^2)*X1+2*Us*Vs/(Us^2+Vs^2)*Y1 + -2*Vs*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + Y2=2*Us*Vs/(Us^2+Vs^2)*X1-(Us^2-Vs^2)/(Us^2+Vs^2)*Y1 + +2*Us*(Us*Pt1_2-Vs*Pt1_1)/(Us^2+Vs^2); + ); + tmp1=concat(tmp1,[[X2,Y2]]); + ); + tmp2=concat(tmp2,[tmp1]); + ); + PdL=concat(PdL,tmp2); + ); + if(Noflg<3, + println("generate Reflectdata "+name); + tmp1=[]; + forall(PdL,tmp2, + tmp=apply(tmp2,Pcrd(#)); + tmp1=append(tmp1,tmp); + ); + if(length(tmp1)==1,tmp1=tmp1_1); + tmp=name+"="+textformat(tmp1,5); + parse(tmp); +// tmp1=textformat(plist,5); + tmp1=text(plist); // 15.10.15 + tmp1=replace(tmp1,"[","list("); + tmp1=replace(tmp1,"]",")"); + tmp=name+"=Reflectdata("+tmp1+","+textformat(symL,5)+")"; + GLIST=append(GLIST,tmp); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + PdL; +); + +Mksegments():=Mksegments([]); +Mksegments(options):=( +//help:Mksegments(); + regional(segstr,p,q,r,tmp1,tmp2,tmp3); + forall(allsegments(),seg, + str=text(inspect(seg,"definition")); + tmp1=indexof(str,"("); + tmp2=indexof(str,";"); + tmp3=indexof(str,")"); + p=substring(str,tmp1,tmp2-1); + q=substring(str,tmp2,tmp3-1); + Listplot([parse(p),parse(q)]); + ); +); + +Mkcircles():=Mkcircles([]); +Mkcircles(options):=( +//help:Mkcircles(): + regional(seg,cir,str,p,q,r,tmp1,tmp2,tmp3,tmp4); + forall(allcircles(),cir, + str=text(inspect(cir,"definition")); + tmp1=indexof(str,"("); + tmp2=indexof(str,";"); + tmp3=indexof(str,")"); + tmp4=indexof(str,";",tmp2+1); + if(tmp4==0, + p=substring(str,tmp1,tmp2-1); + q=substring(str,tmp2,tmp3-1); + Circledata([parse(p),parse(q)]); + , + p=substring(str,tmp1,tmp2-1); + q=substring(str,tmp2,tmp4-1); + r=substring(str,tmp4,tmp3-1); + Circledata([parse(p),parse(q),parse(r)]); + ); + ); +); + +Makesciarg(arglist):=( + regional(str,tmpstr); + str=""; + forall(arglist, + if(isstring(#), + tmpstr=Dq+#+Dq; + , + tmpstr=textformat(#,5); + ); + str=str+tmpstr+","; + ); + str=substring(str,0,length(str)-1); + str; +); + +Setax(arglist):=( +//help:Setax(["l","x","e","y","n","O","sw"]); +//help:Setax([7,"nw"]); + regional(tmp); + tmp=Makesciarg(arglist); + Com1st("Setax("+tmp+")"); +); + +Htickmark(arglist):=( +//help:Htickmark([1,"1",2,"sw","2"]); + regional(tmp); + tmp=""; + tmp=Makesciarg(arglist); + Com2nd("Htickmark("+tmp+")"); +); + +Vtickmark(arglist):=( +//help:Vtickmark([1,"1",2,"sw","2"]); + regional(tmp); + tmp=Makesciarg(arglist); + Com2nd("Vtickmark("+tmp+")"); +); + +Drwxy():=( +//help:Drwxy(); + Com2nd("Drwxy()"); + Addax(0); // 16.01.21 +); + +Drwpt(pstr):=Drawpoint(pstr); +Drwpt(ptlist,nn):=( // 16.03.05 from +//help:Drwpt(A); +//help:Drwpt("[1,1],0"); +//help:Drwpt(A,0); +//help:Drwpt([1,2],0); + Drawpoint(ptlist,nn); +); +Drawpoint(pstr):=( + if(isstring(pstr), + println("Drwpt : "+pstr); + Com2nd("Drwpt("+pstr+")"); + , + Drawpoint(pstr,1); + ); +); +Drawpoint(ptlistorg,nn):=( + regional(ptlist,thick,tmp,tmp1); + println("Drwpt : "+text(ptlistorg)); + if(islist(ptlistorg), + if(MeasureDepth(ptlistorg)==1, + ptlist=ptlistorg + , + ptlist=[ptlistorg] + ); + , + ptlist=[ptlistorg] + ); + thick=PenThick/PenThickInit;// 16.04.09 from + tmp1=max(TenSize/TenSizeInit,1)/8; + Setpen(tmp1); // 16.04.09 upto + forall(ptlist, + tmp=textformat(#,5)+","+text(nn); + Com2nd("Drwpt("+tmp+")"); // 16.04.09 + ); + Setpen(thick); // 16.04.09 +);// 16.03.05 upto + +Addax(param):=( +//help:Addax(0); + ADDAXES=text(param); +); + +Expr(Pt,Dr,St):=Expr([Pt,Dr,St]); +Expr(list):=Expr(list,[]); +Expr(listorg,options):=( //16.10.09 +//help:Expr([A,"e","f(x)=x^2"]); + regional(list,str,tmp,tmp1,tmp2); + list=listorg; + forall(1..round(length(list)/3), + str=list_(3*#); + if(!isstring(str),str=format(str,5)); + str="$"+str+"$"; + list_(3*#)=str; + ); + Letter(list,options); +); + +Letter(Pt,Dr,St):=Letter([Pt,Dr,St]); +Letter(list):=Letter(list,[]); +Letter(list,options):=( +//help:Letter([C,"c","Graph of f(x)"]); + regional(Nj,Pos,Dir,Str,Off,Dmv,Xmv,Ymv,Noflg,opcindy, + opL,aln,sz,clr,bld,ita,tmp,tmp1,tmp2); + tmp=Divoptions(options); + Noflg=tmp_2; + opL=select(options,indexof(#,"->")>0); //16.10.09from + tmp=select(opL,indexof(#,"color")); + size=12; + clr=[0,0,0]; + bld=false; + ita=false; + aln="left"; + forall(opL, + tmp=indexof(#,"->"); + tmp1=removespace(substring(#,0,tmp-1)); + tmp2=substring(#,tmp+1,length(#)); + if(tmp1=="size",sz=parse(tmp2)); + if(tmp1=="color",clr=parse(tmp2)); + if(tmp1=="bold",bld=parse(tmp2)); + if(tmp1=="ita",ita=parse(tmp2)); + );//16.10.09upto + Off=-4; + Dmv=8; + Nj=1; + while(Nj+2<=length(list), +// Pos=textformat(list_Nj,5); + Pos=list_Nj; + Dir=list_(Nj+1); + tmp=indexof(Dir,"s")+indexof(Dir,"n");//16.10.19from + if(tmp>0, + tmp=indexof(Dir,"w")+indexof(Dir,"e"); + if(tmp==0, + Dir="c"+Dir;//16.10.08 + ); + );//16.10.19upto + Str=list_(Nj+2); + if(!isstring(Str),Str=format(Str,5)); // 16.09.30,10.09 + tmp=replace(Str,".xy",""); + tmp=replace(tmp,".x","(1)"); + Str=replace(tmp,".y","(2)"); + if(indexof(Str,"`")>0, +// tmp=Dq+",Assign('"+Str+"','`',Prime()))"; + tmp=Dq+",Assign('"+Str+"'))"; // 15.02.22 + , + tmp=Dq+","+Dq+Str+Dq+")"; + ); + if(Noflg==0, + Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10 + ); + if(Noflg<2, + Xmv=0;//16.10.13 + Ymv=-4; + if(indexof(Dir,"n")>0, + Ymv=Dmv/2; + ); + if(indexof(Dir,"s")>0, + Ymv=-Dmv*3/2;//16.10.13 + ); + if(indexof(Dir,"e")>0, + Xmv=Dmv/2; + Off=0; + aln="left"; + ); + if(indexof(Dir,"w")>0, + Xmv=-Dmv/2; + Off=0; // 16.09.30from + aln="right"; + ); + if(indexof(Dir,"c")>0, + Xmv=0;//16.10.13 + Off=0; + if(Ymv==0,Ymv=-4);//16.10.08 + aln="mid"; // 16.09.30upto + ); + drawtext(Pcrd(Pos),Str,offset->[Off+Xmv,Off+Ymv], + size->sz,color->clr,align->aln,bold->bld,italics->ita);//16.10.09 + ); + Nj=Nj+3; + ); +); + +Letterrot(pt,dir,str):=Letterrot(pt,dir,0,0,str); +Letterrot(pt,dir,movstr,str):=( +//help:Letterrot(C,B-A,"AB"): +//help:Letterrot(C,B-A,0,5,"AB"): +//help:Letterrot(C,B-A,"t0n5","AB"): + regional(tmov,nmov,tmp,tmp1,tmp2); + tmp1=indexof(movstr,"t"); + tmp2=indexof(movstr,"n"); + if(tmp1>0, + if(tmp2>0,tmp=tmp2-1,tmp=length(movstr)); + tmov=parse(substring(movstr,tmp1,tmp)); + , + tmov=0; + ); + if(tmp2>0, + nmov=parse(substring(movstr,tmp2,length(movstr))); + , + nmov=0; + ); + Letterrot(pt,dir,tmov,nmov,str); +); +Letterrot(pt,dir,tmov,nmov,str):=( + Letter([pt,"c",str],["notex"]); + Com2nd("Letterrot("+pt+","+dir+","+tmov+","+nmov+",'"+str+"')"); +); + +Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str); +Exprrot(pt,dir,movstr,str):=( +//help:Exprrot(C,B-A,"d"): +//help:Exprrot(C,B-A,0,5,"d"): +//help:Exprrot(C,B-A,"t0n5","d"): + regional(tmov,nmov,tmp,tmp1,tmp2); + tmp1=indexof(movstr,"t"); + tmp2=indexof(movstr,"n"); + if(tmp1>0, + if(tmp2>0,tmp=tmp2-1,tmp=length(movstr)); + tmov=parse(substring(movstr,tmp1,tmp)); + , + tmov=0; + ); + if(tmp2>0, + nmov=parse(substring(movstr,tmp2,length(movstr))); + , + nmov=0; + ); + Exprrot(pt,dir,tmov,nmov,str); +); +Exprrot(pt,dir,tmov,nmov,str):=( + Expr([pt,"c",str],["notex"]); + Com2nd("Exprrot("+pt+","+dir+","+tmov+","+nmov+",'"+str+"')"); +); + +Slider(ptstr,p1,p2):=( //17.04.11 +//help:Slider("A-C-B",[-3,0],[3,0]); + regional(pA,pB,pC,seg,sname,Alpha,tmp,tmp1); + tmp=indexall(ptstr,"-"); + pA=substring(ptstr,0,tmp_1-1); + pC=substring(ptstr,tmp_1,tmp_2-1); + pB=substring(ptstr,tmp_2,length(ptstr)); + seg=pA+pB; + Alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + sname=""; + forall(1..(length(seg)), + tmp=substring(seg,#-1,#); + tmp1=indexof(Alpha,tmp); + if(tmp1>0, + sname=sname+unicode(text(tmp1+96),base->10); + , + sname=sname+tmp; + ); + ); + Putpoint(pA,p1); + Putpoint(pB,p2); + Listplot([parse(pA),parse(pB)],["notex","color->[0,0.4,0.4]","size->2"]); +// create([sname],"Segment",[parse(pA),parse(pB)]); +// tmp2=Listplot("",[p1,p2],["nodata"]); + Putonseg(pC,parse("sg"+pA+pB)); +// create([pC],"PointOn",[parse(sname),0.5]); +); + +Putpoint(name,Pt):=Putpoint(name,Pt,Pt); +Putpoint(name,Ptinit,Pt):=( +//help:Putpoint("A",[1,2],[1,A.y]); + regional(ptstr); + ptstr=apply(allpoints(),#.name); + if(!contains(ptstr,name), + createpoint(name,Pcrd([Ptinit_1,Ptinit_2])); + , + ptstr=name+".xy="+textformat(Pcrd(Pt),5); + parse(ptstr); + ); +); + +Bezierpt(t,ptlist,ctrlist):=( + regional(flg3,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9); + p0=ptlist_1; + p3=ptlist_2; + p1=ctrlist_1; + if(length(ctrlist)==1, + p2=p3; + flg3=0; + , + p2=ctrlist_2; + flg3=1; + ); + if(length(p0)<3, // 15.02.08 + p0=Lcrd(p0); + p3=Lcrd(p3); + p1=Lcrd(p1); + p2=Lcrd(p2); + ); + p4=(1-t)*p0+t*p1; + p5=(1-t)*p1+t*p2; + p6=(1-t)*p2+t*p3; + p7=(1-t)*p4+t*p5; + p8=(1-t)*p5+t*p6; + p9=(1-t)*p7+t*p8; + if(flg3==0,p7,p9); +); + +Bezier(ptctrlist):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,[]); +Bezier(ptctrlist,options):=BezierCurve(ptctrlist_3,ptctrlist_1,ptctrlist_2,options); +Bezier(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); +Bezier(nm,ptlist,ctrlist,options):=BezierCurve(nm,ptlist,ctrlist,options); +BezierCurve(nm,ptlist,ctrlist):=BezierCurve(nm,ptlist,ctrlist,[]); +BezierCurve(nm,ptlistorg,ctrlistorg,options):=( +//help:Bezier("1",[A,D],[B,C]); +//help:Bezier(options=["Num=10"]); + regional(name,Ltype,Noflg,opstr,opcindy,Num, + ptlist,ctrlist,tmp,tmp1,tmp2,ii,st,out,list); + name="bz"+nm; + tmp=Divoptions(options); + Ltype=tmp_1; + Noflg=tmp_2; + opstr=tmp_(length(tmp)-1); + opcindy=tmp_(length(tmp)); + Num=10; + tmp1=tmp_5; + forall(tmp1, // 14.12.31 + if(substring(#,0,1)=="N", + tmp2=indexof(#,"="); + Num=parse(substring(#,tmp2,length(#))); + opstr=opstr+","+Dq+#+Dq; + ); + ); + ptlist=apply(ptlistorg,Lcrd(#)); // 16.08.16 + ctrlist=[]; // 14.12.31 + if(length(ctrlistorg)==length(ptlist)-1, + forall(ctrlistorg,tmp1, + if(MeasureDepth(tmp1)==0,tmp=[tmp1],tmp=tmp1); + tmp=apply(tmp,Lcrd(#)); // 16.08.16 + ctrlist=append(ctrlist,tmp); + ); + , + forall(1..(length(ptlist)-1),ii, + tmp=ctrlistorg_((2*ii-1)..(2*ii)); + tmp=apply(tmp,Lcrd(#)); // 16.08.16 + ctrlist=append(ctrlist,tmp); + ); + ); + if(!islist(Num), + Num=apply(ctrlist,Num); + ); + list=[]; + forall(1..(length(ptlist)-1),ii, + tmp1=ptlist_(ii..(ii+1)); + tmp2=ctrlist_ii; + if(ii==1,st=0,st=1); + forall(st..Num_ii, + tmp=Bezierpt(#/Num_ii,tmp1,tmp2); + list=append(list,tmp); + ); + ); + if(Noflg<3, + println("generate Bezier "+name); + out=apply(list,Pcrd(#)); + tmp=name+"="+textformat(out,5); + parse(tmp); + tmp1=textformat(ptlist,5); + tmp1="list("+substring(tmp1,1,length(tmp1)-1)+")"; + tmp2=textformat(ctrlist,5); + tmp2="list("+substring(tmp2,1,length(tmp2)-1)+")"; + GLIST=append(GLIST,name+"=Bezier("+tmp1+","+tmp2+opstr+")"); + ); + if(Noflg<2, + if(isstring(Ltype), + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); + list; +); + +Readcsvsla(fname):=Readplotdigdata(fname,[]); +Readcsvsla(fname,options):=Readplotdigdata(fname,options); +Readplotdigdata(fname):=Readplotdigdata(fname,[]); +Readplotdigdata(fname,options):=( + regional(fsc,mv,cmdall,dataL,nd,npt,ptdata,ii,tmp,tmp1,tmp2,tmp3); + tmp=Divoptions(options); + tmp1=tmp_6; + sc=1;//10; + mv=[0,0];//[5,5]; + forall(tmp1, + if(!islist(#),sc=#,mv=#); + ); + if(indexof(fname,".")>0, + tmp=load(fname); + , + tmp=load(fname+".txt"); + ); + cmdall=tokenize(tmp,"//"); + dataL=[]; + forall(2..length(cmdall),ii, + tmp1=parse("["+cmdall_ii+"]"); + dataL=append(dataL,tmp1); + ); + if(length(dataL_(length(dataL)))<2, + dataL=dataL_(1..(length(dataL)-1)); + ); + nd=length(dataL_1)/2; + npt=length(dataL); + ptdata=[]; + forall(1..nd,ii, + tmp3=[]; + forall(1..npt, + tmp1=dataL_#_(2*ii-1); + tmp2=dataL_#_(2*ii); + if(isreal(tmp1), + tmp3=append(tmp3,[tmp1,tmp2]); + ); + ); + ptdata=append(ptdata,tmp3); + ); + tmp1=[]; + forall(ptdata, + tmp=#/sc; + tmp=translatedata("1",[tmp],-mv,["nodata"]); + tmp1=append(tmp1,tmp); + ); + ptdata=tmp1; + ptdata; +); + +Putbezierdata(name,ptL):=Putbezierdata(name,ptL,[]); +Putbezierdata(name,ptL,options):=( + regional(psize,Deg,tmp,tmp1,tmp2,p1,p2,pts,ctrs); + tmp=Divoptions(options); + psize=3; + Deg=3; + tmp1=tmp_5; + forall(tmp1, + if(substring(#,0,1)=="D", + tmp=indexof(#,"="); + Deg=parse(substring(#,tmp,length(#))); + ); + if(substring(#,0,1)=="S", + tmp=indexof(#,"="); + psize=parse(substring(#,tmp,length(#))); + ); + ); + pts=[]; + ctrs=[]; + forall(1..length(ptL), + p2=ptL_#; // 16.08.16 + if(ispoint(p2), + tmp1=text(p2); + , + tmp1=name+text(#); + Putpoint(tmp1,p2,Lcrd(parse(tmp1))); // 16.08.16 + ); + inspect(parse(tmp1),"ptsize",psize); + pts=append(pts,parse(tmp1)); + inspect(parse(tmp1),"color",4); + if(#>1, + p1=Lcrd(ptL_(#-1)); // 16.08.16 + p2=Lcrd(ptL_#); // 16.08.16 + if(Deg==3, + tmp=(2*p1+p2)/3; + tmp1=name+"p"+text(#-1); + Putpoint(tmp1,tmp,Lcrd(parse(tmp1))); // 16.08.16 + inspect(parse(tmp1),"labeled",false); //15.01.22 + Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 + inspect(parse(tmp1),"ptsize",psize); + inspect(parse(tmp1),"color",3); + tmp=(p1+2*p2)/3; + tmp2=name+"q"+text(#-1); + Putpoint(tmp2,tmp,Lcrd(parse(tmp2))); // 16.08.16 + inspect(parse(tmp2),"labeled",false); //15.01.22 + Letter([parse(tmp2),"ne",tmp2],["notex"]); //15.01.22 + inspect(parse(tmp2),"ptsize",psize); + inspect(parse(tmp2),"color",3); + ctrs=append(ctrs,[parse(tmp1),parse(tmp2)]); + , + tmp=(p1+p2)/2; + tmp1=name+"p"+text(#-1); + Putpoint(tmp1,tmp,Lcrd(parse(tmp1))); // 16.08.16 + inspect(parse(tmp1),"labeled",false); //15.01.22 + Letter([parse(tmp1),"ne",tmp1],["notex"]); //15.01.22 + inspect(parse(tmp1),"ptsize",psize); + inspect(parse(tmp1),"color",3); + ctrs=append(ctrs,[parse(tmp1)]); + ); + ); + ); + [pts,ctrs,name]; +); + +Bezierstart(n):=( // 2016.02.26 + BezierNumber=n; +); + +Mkbezierptcrv(ptdata):=Mkbezierptcrv(ptdata,[]); +Mkbezierptcrv(ptdata,options):=( + //help:Mkbezierptcrv([A,B,C,D]); + //help:Mkbezierptcrv([[A,B],[C,D]]); + //help:Mkbezierptcrv(options=["Num=10"]); + // global BezierNumber + regional(ptlist,Out,tmp,tmp1,tmp2); + if(isstring(ptdata), + ptlist=Readcsvsla(ptdata,options); + , + ptlist=ptdata; + ); + if(MeasureDepth(ptlist)==1,ptlist=[ptlist]); + Out=[]; + forall(1..length(ptlist), + tmp=floor((BezierNumber-1)/26);// 15.02.23 + if(tmp==0,tmp="",tmp=text(tmp)); + tmp2=mod(BezierNumber,26); + if(tmp2==0,tmp2=26); + tmp1=unicode(text(96+tmp2),base->10)+tmp;// 15.03.11 + tmp2=Putbezierdata(tmp1,ptlist_#,options); + Bezier(tmp2,options); + BezierNumber=BezierNumber+1; + Out=append(Out,tmp2_(1..2)); + ); + Out; +); + +Mkbeziercrv(nm,ptctrL):=Mkbeziercrv(nm,ptctrL,[]); +Mkbeziercrv(nm,ptctrL,options):=( + //help:Mkbeziercrv("1",[[A,B,C,D],[[P,Q],[R,S],T]]); + regional(ptctrLL,name,ptlist,ctrlist,tmp,tmp1,tmp2); + if(MeasureDepth(ptctrL)==2,ptctrLL=[ptctrL],ptctrLL=ptctrL); + forall(1..length(ptctrLL), + name=nm+text(#); + ptlist=ptctrLL_#_1; + ctrlist=ptctrLL_#_2; + Bezier(name,ptlist,ctrlist,options); + ); +); + +Writebezier():=Writebezier(Fhead,"all"); +Writebezier(head):=Writebezier(head,"all"); +Writebezier(head,seL):=( +//help:Writebezier(file); +//help:Writebezier(file,"acd"); + regional(bz,dt,name,tmp,tmp1,tmp2); + bz=select(GLIST,indexof(#,"=Bezier")>0); + tmp1=[]; // 16.04.22from + if(seL!="all", + forall(1..length(seL), + tmp=substring(seL,#-1,#); + tmp=select(bz,indexof(#,"bz"+tmp)>0); + tmp1=concat(tmp1,tmp); + ); + bz=tmp1;// 16.04.22upto + ); + dt=[head+"n",[[length(bz),0]]]; + forall(1..length(bz), + tmp=indexof(bz_#,"="); + name=substring(bz_#,0,tmp-1); + tmp=indexof(bz_#,","+Dq); + if(tmp>0, + tmp1=substring(bz_#,0,tmp-1)+")"; + , + tmp1=bz_#; + ); + tmp1=replace(tmp1,"Bezier(","["); + tmp1=replace(tmp1,"list(","["); + tmp1=replace(tmp1,")","]"); + tmp1=replace(tmp1,",",".xy,"); + tmp1=replace(tmp1,"]",".xy]"); + tmp1=replace(tmp1,".xy,[",",["); + tmp1=replace(tmp1,"].xy","]"); + tmp1=replace(tmp1,name,head+text(#)); + parse(tmp1); + tmp=parse(head+text(#)+"_1"); + dt=concat(dt,[head+text(#)+"k",tmp]); + tmp=parse(head+text(#)+"_2"); + dt=concat(dt,[head+text(#)+"c",tmp]); + ); + WriteOutData(head+".txt",dt); + dt; +); + +Readbezier(file):=Readbezier(file,[]); +Readbezier(file,optionorg):=( +//help:Readbezier("xsr"); +//help:Readbezier(options=["Num=10","nogeo"]); + regional(nn,options,stL,geo,nc,alpha,out,tmp,tmp1,tmp2,tmp3); + options=optionorg; + tmp=Divoptions(options); + stL=tmp_7; + geo=0; + forall(stL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="G",geo=1); + options=remove(options,[#]); + ); + ReadOutData(file); + tmp=file+"n_1_1"; + nn=parse(tmp); + out=[]; + forall(1..nn,nc, + tmp=file+text(nc); + tmp1=parse(tmp+"k"); + tmp2=parse(tmp+"c"); + if(MeasureDepth(tmp2)==1,tmp2=[tmp2]); // 16.04.22from + if(geo==1, + alpha="abcdefghijklmnopqrstuvwxyz"; + forall(1..length(tmp1), + tmp="k"+BezierNumber+"n"+text(nc)+substring(alpha,#-1,#); + Putpoint(tmp,tmp1_#,parse(tmp+".xy")); + inspect(parse(tmp),"labeled",false); + inspect(parse(tmp),"ptsize",3); + tmp1_#=parse(tmp+".xy"); + ); + forall(1..length(tmp2), + tmp="c"+BezierNumber+"n"+text(nc)+substring(alpha,#-1,#)+"1"; + Putpoint(tmp,tmp2_#_1,parse(tmp+".xy")); + inspect(parse(tmp),"labeled",false); + inspect(parse(tmp),"color",4); + inspect(parse(tmp),"ptsize",3); + tmp2_#_1=parse(tmp+".xy"); + tmp="c"+BezierNumber+"no"+text(nc)+substring(alpha,#-1,#)+"2"; + Putpoint(tmp,tmp2_#_2,parse(tmp+".xy")); + inspect(parse(tmp),"labeled",false); + inspect(parse(tmp),"color",4); + inspect(parse(tmp),"ptsize",3); + tmp2_#_2=parse(tmp+".xy"); + ); + BezierNumber=BezierNumber+1; + ); + Bezier(file+text(nc),tmp1,tmp2,options);// 16.04.22upto + out=append(out,"bz"+tmp); + ); + out; +); + +Ospline(nm,ptlist):=Ospline(nm,ptlist,[]); +Ospline(nm,ptlist,options):=( +//help:Ospline("1",ptlist,[options]); + regional(tmp,tmp1,tmp2,list,ptL,ctrL,name,closed,flg, + p0,p1,p2,p3,pQ,pR,cc,p01,p02,p11,p12,p21,p22,p31,p32); + name="o"+nm; + if(isstring(ptlist),list=parse(ptlist),list=ptlist); + if(|list_1-list_(length(list))|<10^(-6),closed=1,closed=0); +// list=apply(list,LLcrd(#)); + ctrL=[]; + forall(1..(length(list)-1), + flg=0; + p1=Lcrd(list_#); // 16.08.16 + p2=Lcrd(list_(#+1)); // 16.08.16 + if(#==1 % #==length(list)-1, + flg=1; + if(closed==0, + pQ=(p1+2*p2)/3; // 15.09.21 // 16.08.16 + pR=(2*p1+p2)/3; // 16.08.16 + ctrL=append(ctrL,[pQ,pR]); + flg=2; + , + if(#==1, + p0=Lcrd(list_(length(list)-1)); // 16.08.16 + p3=Lcrd(list_(#+2)); // 16.08.16 + , + p0=Lcrd(list_(#-1)); // 16.08.16 + p3=Lcrd(list_2); // 16.08.16 + ); + ); + ); + if(flg<=1, + if(flg==0, + p0=Lcrd(list_(#-1)); // 16.08.16 + p3=Lcrd(list_(#+2)); // 16.08.16 + ); + tmp=1+sqrt((1+Dotprod(p2-p0,p3-p1)/|p2-p0|/|p3-p1|)/2); + cc=4*|p2-p1|/3/(|p2-p0|+|p3-p1|)/tmp; + pQ=p1+cc*(p2-p0); // 15.09.21 // 16.08.16 + pR=p2+cc*(p1-p3); // 16.08.16 + ctrL=append(ctrL,[pQ,pR]); + ); + ); +// list=apply(list,LLcrd(#)); // 16.08.16 +// ctrL=apply(ctrL,LLcrd(#)); + if(closed==0, // 15.09.21 + p1=ctrL_2_1; + p2=Lcrd(list_2); // 16.08.16 + pQ=p2+(p2-p1); + ctrL_1=[pQ]; + tmp=length(ctrL); + tmp1=ctrL_(tmp-1); + p1=ctrL_(tmp-1)_2; + p2=Lcrd(list_(tmp)); // 16.08.16 + pQ=p2+(p2-p1); + ctrL_tmp=[pQ]; + ); + Bezier("o"+nm,list,ctrL,options); +); + +CRspline(nm,ptL):=CRspline(nm,ptL,[]); +CRspline(nm,ptL,options):=( + // Catmull-Rom spline +//help:CRspline("1",[A,B,C,A]); + regional(name,ptlist,ctrpts,eqL,opcindy,c,v,tmp,tmp1,tmp2,ctrlist,cflg); + name="crsp"+nm; + if(MeasureDepth(ptL)==1,tmp=[ptL],tmp=ptL); + ptlist=tmp_1; + if(length(tmp)==1, + cflg=1; + , + cflg=0; + ctrpts=tmp_2; + ); + c=1/6; + tmp=Divoptions(options); + eqL=tmp_5; + opcindy=tmp_(length(tmp)); // 15.03.05 + forall(eqL, + if(substring(#,0,1)=="R", + tmp2=indexof(#,"="); + c=parse(substring(#,tmp2,length(#))); + ); + ); + ptlist=apply(ptlist,Lcrd(#)); // 16.08.16 + ctrlist=[]; + forall(1..(length(ptlist)-1), + if(#==1, + if(cflg==0, + tmp1=ctrpts_1; + , + v=ptlist_2-ptlist_(length(ptlist)-1); + tmp1=ptlist_#+c*v; + ); + , + v=ptlist_(#+1)-ptlist_(#-1); + tmp1=ptlist_#+c*v; + ); + if(#==length(ptlist)-1, + if(cflg==0, + tmp2=ctrpts_2; + , + v=ptlist_2-ptlist_#; + tmp2=ptlist_(#+1)-c*v; + ); + , + v=ptlist_(#+2)-ptlist_#; + tmp2=ptlist_(#+1)-c*v; + ); + tmp=select(options,indexof(text(#),"->")>0); + tmp=append(tmp,"notex"); //15.03.05 + Pointdata(name+text(#),[tmp1,tmp2],tmp); + ctrlist=append(ctrlist,[tmp1,tmp2]); + ); + Bezier(nm,ptlist,ctrlist,options); +); + +Beziersmooth(nm,ptL):=Bzspline(nm,ptL,[]); +//help:Beziersmooth("1",[A,B,C,A]); +Beziersmooth(nm,ptL,options):=Bzspline(nm,ptL,options); +Bzspline(nm,ptL):=Bzspline(nm,ptL,[]); +Bzspline(nm,ptLorg,options):=( + // smooth bezier + regional(name,Eps,ptL,pt,pt1,pt2,pt3,npt,lstr, + tmp,tmp1,tmp2,cflg,ctrlist); + name="bzsp"+nm; + Eps=10^(-3); + ptL=apply(ptLorg,Lcrd(#)); // 16.08.16 + if(|ptL_1-ptL_(length(ptL))|<Eps,cflg=1,cflg=0); + forall(2..length(ptL), + pt=ptL_#; + pt1=ptL_(#-1); + tmp1="C"+text(#-1)+"q"; + Putpoint(tmp1,(pt1+4*pt)/5,Lcrd(parse(tmp1))); // 16.08.16 + ); + forall(2..(length(ptL)-1), + if(#<length(ptL) % cflg==1, + lstr="c"+text(#); + pt=ptLorg_#; // 16.08.16 + pt1=parse("C"+text(#-1)+"q"); + create([lstr],"Join",[pt1,pt]); + tmp2="C"+text(#)+"p"; + tmp=Append((2*pt.xy-pt1.xy),1); + create([tmp2],"PointOnLine",[parse(lstr),tmp]); + ); + ); + if(cflg==0, + pt=ptL_1; + pt1=ptL_2; + tmp1="C1p"; + Putpoint(tmp1,(4*pt+pt1)/5,Lcrd(parse(tmp1))); // 16.08.16 + ); + if(cflg==1, + lstr="c1"; + pt=ptLorg_1; // 16.08.16 + pt1=parse("C"+text(length(ptL)-1)+"q"); + create([lstr],"Join",[pt1,pt]); + tmp1="C1p"; + tmp=Append((2*pt.xy-pt1.xy),1); + create([tmp1],"PointOnLine",[parse(lstr),tmp]); + ); + ctrlist=[]; + forall(1..(length(ptL)-1), + if(#>1 % cflg==1, + tmp1="c"+text(#); + inspect(parse(tmp1),"alpha",0.3); + ); + tmp1="C"+text(#)+"p"; + tmp2="C"+text(#)+"q"; + inspect(parse(tmp1),"ptsize",3); + inspect(parse(tmp1),"color",3); + inspect(parse(tmp2),"ptsize",3); + inspect(parse(tmp2),"color",3); + tmp=[parse(tmp1),parse(tmp2)]; + ctrlist=append(ctrlist,tmp); + ); + Bezier(nm,ptL,ctrlist,options); + [ptL,ctrlist]; +); + +Beziersym(nm,ptL):=Bzsspline(nm,ptL,[]); +Beziersym(nm,ptL,options):=Bzsspline(nm,ptL,options); +Bzsspline(nm,ptL):=Bzsspline(nm,ptL,[]); +Bzsspline(nm,ptLorg,options):=( + // smooth bezier with symmetric control points + regional(name,Eps,ptL,pt,pt1,pt2,pt3,npt,lstr, + tmp,tmp1,tmp2,cflg,ctrlist); + name="bzssp"+nm; + Eps=10^(-3); + ptL=apply(ptLorg,Lcrd(#)); // 16.08.16 + if(|ptL_1-ptL_(length(ptL))|<Eps,cflg=1,cflg=0); + forall(2..length(ptL), + pt=ptL_#; + pt1=ptL_(#-1); + tmp1="C"+text(#-1)+"q"; + Putpoint(tmp1,(pt1+4*pt)/5,Lcrd(parse(tmp1))); + ); + forall(2..(length(ptL)-1), + if(#<length(ptL) % cflg==1, + pt=ptL_#; + pt1=parse("C"+text(#-1)+"q"); + tmp2="C"+text(#)+"p=2*pt-pt1"; + parse(tmp2); + ); + ); + if(cflg==0, + pt=ptL_1; + pt1=ptL_2; + Putpoint("C1p",(4*pt+pt1)/5,Lcrd(C1p)); // 16.08.16 + inspect(C1p,"ptsize",3); + inspect(C1p,"color",3); + ); + if(cflg==1, + pt=ptL_1; + pt1=Lcrd(parse("C"+text(length(ptL)-1)+"q")); // 16.08.16 + tmp1="Putpoint("+Dq+"C1p"+Dq+",2*pt-pt1)"; // 16.08.16 + parse(tmp1); + ); + ctrlist=[]; + forall(1..(length(ptL)-1), + tmp1="C"+text(#)+"p"; + tmp2="C"+text(#)+"q"; + inspect(parse(tmp2),"ptsize",3); + inspect(parse(tmp2),"color",3); + tmp=[parse(tmp1),parse(tmp2)]; + ctrlist=append(ctrlist,tmp); + ); + Bezier(nm,ptL,ctrlist,options); + [ptL,ctrlist]; +); + +Listbspline2bz(listorg):=( + regional(Eps,list,pcl,ptl,ctrl,k); + Eps=10^(-3); + list=apply(listorg,Lcrd(#)); // 16.08.16 + k=length(list); + if(|list_1-list_k|>Eps, + pcl=list; + pcl_1=2*list_1-list_2; + pcl_k=2*list_k-list_(k-1); + , + pcl=concat(list,[list_2]); + ); + ctrl=apply(2..(length(pcl)-1),[pcl_#]); + ptl=apply(1..(length(pcl)-1),(pcl_#+pcl_(#+1))/2); + [ptl,ctrl]; +); + +Bspline(nm,ctrL):=Bspline(nm,ctrL,[]); +Bspline(nm,ctrL,options):=( +//help:Bspline("",[A,B,C]); + regional(list,tmp); + list=Listbspline2bz(ctrL); + tmp=BezierCurve("b"+nm,list_1,list_2,options); + tmp; +); + +MeetCurve(Crv,Xorg,Yorg):=( + regional(Cv,tmp,tmp1,tmp2,X0,Y0,x1,x2,y1,y2,Ylist,Ban,Tate); + if(isstring(Crv),Cv=parse(Crv),Cv=Crv); + if(MeasureDepth(Cv)==2,Cv=Cv_1); + Cv=apply(Cv,LLcrd(#)); // 14.12.18 + while(length(Cv)==1, + Cv=Cv_1; + ); + Cv=apply(Cv,Lcrd(#)); + tmp1=min(apply(Cv,#_1)); + tmp2=max(apply(Cv,#_1)); + if(isstring(Xorg),X0=parse(Xorg),X0=Xorg); + if(isstring(Yorg),Y0=parse(Yorg),Y0=Yorg); + if(X0<tmp1, + X0=tmp1; + , + if(X0>tmp2, + X0=tmp2; + ); + ); + tmp1=select( + 1..(length(Cv)-1),Cv_#_1<=X0 & X0<=Cv_(#+1)_1); + tmp2=select( + 1..(length(Cv)-1),Cv_#_1>=X0 & X0>=Cv_(#+1)_1); + tmp2=remove(tmp2,common(tmp2,tmp1)); + Ban=concat(tmp1,tmp2); + Tate=select(Ban, + abs(Cv_#_1-Cv_(#+1)_1)<= + 10^(-2)*abs(Cv_#_2-Cv_(#+1)_2) + ); + Ban=remove(Ban,Tate); + Ylist=[]; + forall(Ban, + tmp=Cv_#; + x1=tmp_1; y1=tmp_2; + tmp=Cv_(#+1); + x2=tmp_1; y2=tmp_2; + tmp=((x2-X0)*y1+(X0-x1)*y2)/(x2-x1); + Ylist=append(Ylist,tmp); + ); + forall(Tate, + tmp=Cv_#; + x1=tmp_1; y1=tmp_2; + tmp=Cv_(#+1); + x2=tmp_1; y2=tmp_2; + tmp1=min([y1,y2]); + tmp2=max([y1,y2]); + if(Y0<tmp1, + tmp=tmp1; + , + if(Y0>tmp2, + tmp=tmp2; + , + tmp=Y0; + ); + ); + Ylist=append(Ylist,tmp); + ); + tmp=sort(Ylist,abs(#_1-Y0)); + [X0,tmp_1]; +); + +PutonLine(name,p1,p2):=PutonLine(name,p1,p2,[]); +PutonLine(name,p1org,p2org,options):=( +//help:PutonLine("C","sgAB"); +//help:PutonLine("C",pA,pB); + regional(par,p1,p2,dx,dy,tmp,tmp1,tmp2); + par=0.5; + tmp=Divoptions(options); + if(length(tmp_6)>0, + par=tmp_6_1; + ); + p1=Lcrd(p1org);//16.10.11from + p2=Lcrd(p2org); + dx=p2_1-p1_1; + dy=p2_2-p1_2; + tmp1=(1-par)*p1+par*p2; + if(abs(dx)>abs(dy), + tmp=name+".x"; + tmp2="["+tmp+",dy/dx*("+tmp+"-p1_1)+p1_2]";//16.10.11upto + Putpoint(name,tmp1,parse(tmp2)); + , + if(abs(dy)>0, + tmp=name+".y"; + tmp2="[dx/dy*("+tmp+"-p1.y)+p1_1,"+tmp+"]"; + Putpoint(name,tmp1,parse(tmp2)); + , + tmp2=p1;//16.10.11 + Putpoint(name,tmp1,tmp2); + ); + ); +); + +PutonSeg(name,sgstr):=( + regional(seg,p1,p2); + if(isstring(sgstr),seg=parse(sgstr),seg=sgstr); + PutonSeg(name,LLcrd(seg_1),LLcrd(seg_2)); +); +PutonSeg(name,p1,p2):=PutonSeg(name,p1,p2,[]); +PutonSeg(name,p1org,p2org,options):=( +//help:PutonSeg("C","sgAB"); +//help:PutonSeg("C",pA,pB); + regional(par,dx,dy,p,tmp,tmp1,tmp2); + par=0.5; + tmp=Divoptions(options); + if(length(tmp_6)>0, + par=tmp_6_1; + ); + p1=Lcrd(p1org);//16.10.11from + p2=Lcrd(p2org); + PutonLine(name,p1,p2,[par]); + dx=p2_1-p1_1; + dy=p2_2-p1_2; + p=parse(name+".xy"); + p=LLcrd(p); + if(abs(dx)>abs(dy) & (p_1-p1_1)*(p_1-p2_1)>0, + if(|p-p1|<|p-p2|, + parse(name+".xy=Pcrd(p1)"); + , + parse(name+".xy=Pcrd(p2)"); + ); + ); + if(abs(dx)<abs(dy) & (p_2-p1_2)*(p_2-p2_2)>0, + if(|p-p1|<|p-p2|, + parse(name+".xy=Pcrd(p1)"); + , + parse(name+".xy=Pcrd(p2)");//16.10.11upto + ); + ); +); + +PutonCurve(pn,crv):=PutonCurve(pn,crv,[]); +PutonCurve(pn,crv,options):=( +//help:PutonCurve("A","gr1"); + regional(Pmt,pstr,optionL,leftlim,rightlim,tmp,tmp1,Flg,Msg); + if(!islist(options),optionL=[options],optionL=options); + leftlim=XMIN; + rightlim=XMAX; + Flg=0; + Msg="y"; + forall(optionL, + if(isstring(#), // 16.02.10 from + tmp=indexof(#,"="); + tmp1=Toupper(substring(#,tmp,tmp+1)); + if(tmp1=="N", Msg="n"); // 16.02.10 upto + , + if(Flg==0, + leftlim=#; + Flg=Flg+1; + , + rightlim=#; + ); + ); + ); + Pmt=MeetCurve(crv,leftlim,0); + pstr=apply(allpoints(),textformat(#,5)); // 15.04.07 + if(!contains(pstr,pn), + createpoint(pn,Pcrd(Pmt)); + , + tmp1=parse(pn+".x"); + if(tmp1< leftlim % tmp1>rightlim, + if(tmp1< leftlim,tmp= leftlim, tmp=rightlim); + Pmt=MeetCurve(crv,textformat(tmp,5),pn+".y"); + , + Pmt=MeetCurve(crv,pn+".x",pn+".y"); + ); + ptstr=pn+".xy="+textformat(Pcrd(Pmt),5)+";"; + parse(ptstr); + ); + if(Msg=="y", + println("Put "+pn+" on Curve "+text(crv)); + ); +); + +CrossPoint(name,Crv1,Crv2,range):=( + regional(Mx1,Mx2,Mx3,tmp,Crs1,Crs2,Crs3,Crs4,df1,df2); + Mx1=range_1; Mx2=range_2; + repeat(15, + Mx3=(Mx1+Mx2)/2; + Crs1=MeetCurve(Crv1,Mx1,0); + Crs2=MeetCurve(Crv2,Mx1,0); + Crs3=MeetCurve(Crv1,Mx3,0); + Crs4=MeetCurve(Crv2,Mx3,0); + df1=Crs1_2-Crs2_2; + df2=Crs3_2-Crs4_2; + if((df1>0 & df2>0) % (df1<0 & df2<0), + Mx1=Mx3; + , + Mx2=Mx3; + ); + ); + Putpoint(name,Crs1); +); + +Setscaling(sc):=( +//help:Setscaling(3); + SCALEX=1; + SCALEY=sc; + Com0th("Setscaling("+sc+")"); + Setwindow("Msg=no"); +); + +Tabledatalight(nm,xLst,yLst,rmvL):=Tabledatalight(nm,xLst,yLst,rmvL,[]); +Tabledatalight(nm,xLst,yLst,rmvL,options):=( +//help:Tabledatalight("",xLst,yLst,rmvL,[2]); + regional(name,upleft,ul,flg,tick,n,m,xsize,ysize,rlist,clist,Tb, + tmp,tmp1,tmp2,tmp3,Eps); +// name="tb"+nm; + name="tb"; + println("Tabledatalight "+name+" generated"); + tmp=sum(yLst); + upleft=[0,tmp]; + tick=1; + tmp=Divoptions(options); + flg=0; + forall(tmp_6, + if(flg==0, + tick=#; + flg=flg+1; + , + upleft=tmp_6_1; + ); + ); + ul=upleft/10; + m=length(xLst); + n=length(yLst); + xsize=sum(xLst); + ysize=sum(yLst); + clist=[ul]; + rlist=[ul]; + forall(1..m, + tmp1=clist_(#)_1+xLst_#/10; + clist=append(clist,[tmp1,clist_1_2]); + ); + forall(1..n, + tmp1=rlist_(#)_2-yLst_#/10; + rlist=append(rlist,[0,tmp1]); + ); + Tb=[clist,rlist]; + tmp=name+"="+Tb; + parse(tmp); + forall(0..m, + tmp1="c"+text(#)+"r0"; + tmp2="c"+text(#)+"r"+text(n); + Tlistplot("c"+text(#)+"r0r"+text(n),[tmp1,tmp2],options); + if(mod(#,tick)==0 % #==m, + tmp=clist_(#+1); + drawtext(clist_(#+1)-[0.04,-0.1],"c"+text(#)); + ); + ); + forall(0..n, + tmp1="c0r"+text(#); + tmp2="c"+text(m)+"r"+text(#); + Tlistplot("r"+text(#)+"c0c"+text(m),[tmp1,tmp2],options); + if(mod(#,tick)==0 % #==n, + tmp=rlist_(#+1); + drawtext(rlist_(#+1)-[0.4,0.1],"r"+text(#)); + ); + ); + Tsegrmv(rmvL,options); + Addax(0); + Eps=10^(-3); + tmp1=clist_(length(clist)); + tmp2=rlist_1; + tmp3=rlist_(length(rlist)); + Setwindow([0-Eps,tmp1_1+Eps],[tmp3_2-Eps,tmp2_2+Eps]); + Tb; +); + +Tabledata(nm,n,m,xsize,ysize,rmvL):= + Tabledata(nm,n,m,xsize,ysize,rmvL,[]); +Tabledata(nm,n,m,xsize,ysize,rmvL,options):=( + regional(Tb,name,tmp,xLst,yLst); + name="tb"+nm; + xLst=apply(1..n,xsize/n); + yLst=apply(1..m,ysize/m); + Tabledata(nm,xLst,yLst,rmvL,options) +); +Tabledata(nm,xLst,yLst,rmvL):=Tabledata(nm,xLst,yLst,rmvL,[]); +Tabledata(nm,xLst,yLst,rmvL,options):=( +//help:Tabledata("",xLst,yLst,rmvL,[2]); + regional(name,upleft,ul,flg,tick,n,m,xsize,ysize,rlist,clist,Tb, + tmp,tmp1,tmp2,tmp3,Eps); +// name="tb"+nm; + name="tb"; + println("Tabledata "+name+" generated"); + tmp=sum(yLst); + upleft=[0,tmp]; + tick=1; + tmp=Divoptions(options); + flg=0; + forall(tmp_6, + if(flg==0, + tick=#; + flg=flg+1; + , + upleft=tmp_6_1; + ); + ); + ul=upleft/10; + m=length(xLst); + n=length(yLst); + xsize=sum(xLst); + ysize=sum(yLst); + clist=[ul]; + rlist=[ul]; + forall(1..m, + tmp1=clist_(#)_1+xLst_#/10; + clist=append(clist,[tmp1,clist_1_2]); + ); + forall(1..n, + tmp1=rlist_(#)_2-yLst_#/10; + rlist=append(rlist,[0,tmp1]); + ); + Tb=[clist,rlist]; + tmp=name+"="+Tb; + parse(tmp); + forall(0..m, + tmp="C"+text(#); + tmp1="c"+text(#)+"r0"; + if(#==0, + Putpoint(tmp,Tgrid(tmp1)); + , + Putpoint(tmp,Tgrid(tmp1),[parse(tmp+".x"),C0.y]); + clist_(#+1)=parse(tmp+".xy"); + ); + inspect(parse(tmp),"ptsize",3); + inspect(parse(tmp),"labeled",false); + if(mod(#,tick)==0 % #==m, + tmp=clist_(#+1); + drawtext(clist_(#+1)-[0.04,-0.1],"c"+text(#)); + ); + ); + forall(0..n, + tmp="R"+text(#); + tmp1="c0r"+text(#); + if(#==0, + Putpoint(tmp,Tgrid(tmp1)); + , + Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); + rlist_(#+1)=parse(tmp+".xy"); + ); + Putpoint(tmp,Tgrid(tmp1),[R0.x,parse(tmp+".y")]); + inspect(parse(tmp),"ptsize",3); + inspect(parse(tmp),"labeled",false); + if(mod(#,tick)==0 % #==n, + tmp=rlist_(#+1); + drawtext(rlist_(#+1)-[0.4,0.1],"r"+text(#)); + ); + ); + Tb=[clist,rlist]; + tmp=name+"="+Tb; + parse(tmp); + forall(0..m, + tmp1="c"+text(#)+"r0"; + tmp2="c"+text(#)+"r"+text(n); + Tlistplot("c"+text(#)+"r0r"+text(n),[tmp1,tmp2],options); + if(#<m, + tmp1=parse("C"+text(#)); + tmp2=parse("C"+text(#+1)); + tmp=(tmp1.xy+tmp2.xy)/2; + drawtext(tmp+[-0.2,0.5],text((tmp2.x-tmp1.x)*10)); + ); + ); + forall(0..n, + tmp1="c0r"+text(#); + tmp2="c"+text(m)+"r"+text(#); + Tlistplot("r"+text(#)+"c0c"+text(m),[tmp1,tmp2],options); + if(#<n, + tmp1=parse("R"+text(#)); + tmp2=parse("R"+text(#+1)); + tmp=(tmp1.xy+tmp2.xy)/2; + drawtext(tmp-[1.2,0.1],text(abs(tmp1.y-tmp2.y)*10)); + ); + ); + Tsegrmv(rmvL,options); + Addax(0); + Eps=10^(-3); + tmp1=clist_(length(clist)); + tmp2=rlist_1; + tmp3=rlist_(length(rlist)); // 15.06.11 + Setwindow([0-Eps,tmp1_1+Eps],[tmp3_2-Eps,tmp2_2+Eps]); + Tb; +); + +Tseginfo(seg):=( + regional(cr,tp,tpc,n1,n2,n3,tmp,tmp1,tmp2); + if(substring(seg,0,2)=="sg", + cr=substring(seg,2,length(seg)); + , + cr=seg; + ); + tp=substring(cr,0,1); + if(tp=="c", + tpc="r"; + , + tpc="c"; + ); + tmp1=indexof(cr,tpc); + tmp=substring(cr,tmp1,length(cr)); + tmp2=tmp1+indexof(tmp,tpc); + n1=substring(cr,1,tmp1-1); + n2=substring(cr,tmp1,tmp2-1); + n3=substring(cr,tmp2,length(cr)); + [tp+n1,tpc,parse(n2),parse(n3)]; +); + +Tsegrmv(rmvL):=Tsegrmv(rmvL,[]); +Tsegrmv(rmvL,options):=( + regional(cr,gcL,flg,gc,hd,tail,tpc,m1,m2,n1,n2,tmp,tmp1,tmp2); + forall(rmvL,cr, + tmp1=Tseginfo(cr); + hd=tmp1_1; + tpc=tmp1_2; + m1=tmp1_3; + m2=tmp1_4; + gcL=select(GCLIST,Tseginfo(#_1)_1==tmp1_1); + flg=0; + forall(gcL, + if(flg==0, + tmp=Tseginfo(#_1); + n1=tmp_3; + n2=tmp_4; + if(m1>=n1 & m2<=n2, + gc=#; + flg=1; + ); + ); + ); + if(flg==1, + Changestyle([gc_1],["nodisp"]); + tail=""; + if(indexof(hd,"r")>0, + tail=hd; hd=""; + ); + if(n1<m1, + tmp1=tpc+text(n1); + tmp2=tpc+text(m1); + tmp=hd+tail+tmp1+tmp2; + Tlistplot(tmp,[hd+tmp1+tail,hd+tmp2+tail],options); + ); + if(m2<n2, + tmp1=tpc+text(m2); + tmp2=tpc+text(n2); + tmp=hd+tail+tmp1+tmp2; + Tlistplot(tmp,[hd+tmp1+tail,hd+tmp2+tail],options); + ); + ); + ); +); + +Tgrid(ptstr):=( +//help:Tgrid("c2r5"); + regional(tmp,tmp1,tmp2); + tmp=parse(ptstr); + if(islist(tmp), + tmp; + , + tmp=indexof(ptstr,"r"); + tmp1=substring(ptstr,1,tmp-1); + tmp1=parse(tmp1); + tmp2=substring(ptstr,tmp,length(ptstr)); + tmp2=parse(tmp2); + [tb_1_(tmp1+1)_1,tb_2_(tmp2+1)_2]; + ); +); + +Tlistplot(ptL):=Tlistplot(ptL,[]); +Tlistplot(Ag1,Ag2):=( + regional(nm,ptL,options); + if(isstring(Ag1), + nm=Ag1; + ptL=Ag2; + options=[]; + , + ptL=Ag1; + options=Ag2; + nm=ptL_1+ptL_2; + ); + Tlistplot(nm,ptL,options); +); +Tlistplot(nm,ptL,options):=( +//help:Tlistplot(["c0r0","c0r4"]); +//help:Tlistplot("1",["c0r0","c0r4"]); + regional(tmp); + tmp=apply(ptL,Tgrid(#)); // 15.06.03 + Listplot(nm,tmp,append(options,"Msg=no")); +); + +ChangeTablestyle(nameL,style):=( +////help:ChangeTablestyle(["r0c0c3"],["da"]); + regional(nmL,tmp,tmp1,tmp2); + if(islist(nameL),nmL=nameL,nmL=[nameL]); + nmL=apply(nmL,"sg"+#); + nmL=select(nmL,islist(parse(#))); + Changestyle(nmL,style); +); + +Findcell(pos1,pos2):=Findcell("",pos1,pos2); +Findcell(Tbdata,pos1,pos2):=( +//help:Findcell("c0r0","c2r1"); + regional(tmp1,tmp2,posnw,posse,ctr,dx,dy); + if(isstring(pos1), + posnw=Tgrid(pos1); // 15.05.20 + posse=Tgrid(pos2); + //posnw=parse(pos1); + //posse=parse(pos2); + , + if(islist(pos1), + posnw=pos1; + posse=pos2; + , + tmp1="c"+text(pos1-1)+"r"+text(pos2-1); + tmp2="c"+text(pos1)+"r"+text(pos2); + posnw=Tgrid(tmp1); + posse=Tgrid(tmp2); +// posnw=parse(tmp1); +// posse=parse(tmp2); + ); + ); + ctr=(posnw+posse)/2; + dx=abs(posse_1-ctr_1); + dy=abs(posnw_2-ctr_2); + [ctr,dx,dy]; +); + +Putcell(pos1,pos2,dir,lttr):=Putcell("",pos1,pos2,dir,lttr); +Putcell(Tbdata,pos1,pos2,dir,lttr):=( +//help:Putcell("c0r0","c2r1","lt","abc"); +//help:Putcell(2,3,"c","xyz"); + regional(tmp,tmp1,tmp2,posnw,posse, + posdir,posstr,ctr,dx,dy); + tmp=Findcell(Tbdata,pos1,pos2); + ctr=tmp_1; dx=tmp_2; dy=tmp_3; + posdir=ctr; + posstr=dir; + if(indexof(dir,"b")>0, + posdir_2=posdir_2-dy; + posstr=replace(posstr,"b","n"); + ); + if(indexof(dir,"t")>0, + posdir_2=posdir_2+dy; + posstr=replace(posstr,"t","s"); + ); + if(indexof(dir,"l")>0, + posdir_1=posdir_1-dx; + posstr=replace(posstr,"l","e"); + ); + if(indexof(dir,"r")>0, + posdir_1=posdir_1+dx; + posstr=replace(posstr,"r","w"); + ); + Letter(posdir,posstr,text(lttr)); +); + +Putcellexpr(pos1,pos2,dir,ex):=Putcellexpr("",pos1,pos2,dir,ex); +Putcellexpr(Tbdata,pos1,pos2,dir,ex):=( +//help:Putcellexpr("c0r0","c2r1","lt","abc"); +//help:Putcellexpr(2,3,"c","\sin x"); + Putcell(Tbdata,pos1,pos2,dir,"$"+text(ex)+"$"); +); + +Putrow(nrow,dir,lttrL):=Putrow("",nrow,dir,lttrL); +Putrow(Tbdata,nrow,dir,lttrL):=( +//help:Putrow(1,"c",["x","y","z"]); + regional(tmp,tmp1,mcol); + mcol=length(lttrL); + forall(1..mcol, + Putcell(Tbdata,#,nrow,dir,lttrL_#); + ); +); + +Putrowexpr(nrow,dir,exL):=Putrowexpr("",nrow,dir,exL); +Putrowexpr(Tbdata,nrow,dir,exL):=( +//help:Putrowexpr(2,"r",["x","y","z"]); + regional(lttrL); + lttrL=apply(exL,"$"+#+"$"); + Putrow(Tbdata,nrow,dir,lttrL); +); + +PutcoL(mcol,dir,lttrL):=PutcoL("",mcol,dir,lttrL); +PutcoL(Tbdata,mcol,dir,lttrL):=( +//help:PutcoL(1,"c",["x","y","z"]); + regional(tmp,tmp1,nrow); + nrow=length(lttrL); + forall(1..nrow, + Putcell(Tbdata,mcol,#,dir,lttrL_#); + ); +); +PutcoLexpr(mcol,dir,exL):=PutcoLexpr("",mcol,dir,exL); +PutcoLexpr(Tbdata,mcol,dir,exL):=( +//help:PutcoLexpr(2,"r",["x","y","z"]); + regional(lttrL); + lttrL=apply(exL,"$"+#+"$"); + PutcoL(Tbdata,mcol,dir,lttrL); +); + +Setwindow():=Setwindow("Msg=yes"); +Setwindow(str):=( + regional(tmp,tmp1,tmp2,msg); + msg="y"; + tmp=indexof(str,"="); // 16.02.10 + tmp1=Toupper(substring(str,tmp,tmp+1)); + if(tmp1=="N",msg="n"); + if((ispoint(SW) & ispoint(NE)), + tmp1=Lcrd(SW); + tmp2=Lcrd(NE); + XMIN=tmp1_1; XMAX=tmp2_1; + YMIN=tmp1_2; YMAX=tmp2_2; + , +// XMIN=-5; XMAX=5; +// YMIN=Lcrdy(-5); YMAX=Lcrdy(5); + createpoint("SW",Pcrd([XMIN,YMIN])); + createpoint("NE", Pcrd([XMAX,YMAX])); + ); + if(msg=="y", + println("Setwindow(["+XMIN+","+XMAX+"],["+YMIN+","+YMAX+"])"); + ); + layer(KETPICLAYER); + autoclearlayer(KETPICLAYER,true); + drawpoly([Pcrd([XMIN,YMIN]), Pcrd([XMAX,YMIN]), + Pcrd([XMAX,YMAX]),Pcrd([XMIN,YMAX])],color->[1,1,1]); +); +Setwindow(xrange,yrange):=( +//help:Setwindow([2,3],[-1,1]); + XMIN=xrange_1; + XMAX=xrange_2; + YMIN=yrange_1; + YMAX=yrange_2; +// Setwindow(); +); + +Sciform(list):=( + regional(plotlist,comp,pos,out,out2,nn,strL,flg, + tmp,tmp1,tmp2,tmp3,Nj); + plotlist=Flatten([list]); + out=replace(plotlist_1,".xy",""); + out=replace(out,".x","(1)"); + out=replace(out,".y","(2)"); + if(length(plotlist)==1, + comp=[]; + forall(1..length(out), + comp=append(comp,substring(out,#-1,#)); + ); + out=""; + pos=0; + forall(comp, + if(#!="'", + out=out+#; + , + if(pos==0, + tmp=indexof(out,"Assign("); + if(substring(out,length(out)-7,length(out))=="Assign(", + out=out+"'"; + pos=1; + , + out=out+"Assign('"; + pos=2; + ); + , + if(pos==2, + out=out+"')"; + , + out=out+"'"; + ); + pos=0; + ); + ); + ); + , + forall(2..length(plotlist), + comp=plotlist_#; + if(isstring(comp), + pos=indexof(comp,"Assign("); + if(pos>0, + comp=substring(comp,6,length(comp)); + ); + out=out+"Assign("; + comp=replace(comp,".xy",""); + comp=replace(comp,".x","(1)"); + comp=replace(comp,".y","(2)"); + out=out+"'"+comp+"'"; + out=out+"),"; + ); + if(islist(comp), + forall(comp, + out=out+"'"+#+"',"; + ); + ); + ); + if(length(plotlist)>1, + out=substring(out,0,length(out)-1); + out=out+");"; + ); + ); + pos=[]; + forall(1..length(out), + tmp=indexof(substring(out,#-1,length(out)),"Assign"); + if(tmp>0, + tmp1=#-1+tmp; + if(length(pos)==0, + pos=[tmp1]; + , + if(pos_(length(pos))<tmp1, + pos=append(pos,tmp1); + ); + ); + ); + ); + if(length(pos)>0, + strL=[]; + Nj=0; + forall(pos, + tmp=substring(out,Nj,#-1); + strL=append(strL,tmp); + Nj=#-1; + ); + strL=append(strL,substring(out,Nj,length(out))); + out=""; + forall(strL, + if(indexof(#,"Assign")==0, + out=out+#; + , + tmp=indexof(#,"('"); + tmp1=indexof(#,"')"); + tmp2=substring(#,tmp+1,tmp1-2); + tmp3=substring(#,tmp1-2,length(#)); + if(indexof(tmp2,"=")==0, + out=out+#; + , + tmp=substring(tmp2,0,indexof(tmp2,"=")); + out=out+"'"+tmp+"'+"+"Assign('"; + tmp=substring(tmp2,indexof(tmp2,"="),length(tmp2)); + out=out+tmp+tmp3; + ); + ); + ); + ); + out2=""; // patched 16.01.21 from + nn=length(out); + flg=0; + forall(1..nn, + if(flg==0, + tmp=indexof(out,"='+Assign('"); + if(tmp==0, + out2=out2+out; + flg=1; + , + out2=out2+substring(out,0,tmp); + out=substring(out,tmp+10,length(out)); + tmp=indexof(out,"'"); // 16.04.19 from + tmp1=substring(out,0,tmp-1); + tmp2="1234567890"; + tmp=apply(1..length(tmp1), + indexof(tmp2,substring(tmp1,#-1,#))); + tmp=min(tmp); + if(tmp==0, // 16.04.19 upto + out2=out2+"'+Assign('"; + , + tmp=indexof(out,"'"); + out=substring(out,0,tmp)+substring(out,tmp+1,length(out)); // 16.04.18 upto + ); + ); + ); + ); + out2=replace(out2,"Dist=","D="); + out2=replace(out2,"Dis=","D="); + out2; +); + + +Rform(list):=( + regional(plotlist,comp,pos,out,strL,tmp,tmp1,tmp2,tmp3,Nj); + out=list; + out=replace(out,"[[[","list([["); + out=replace(out,"[","c("); + out=replace(out,"]",")"); + out=replace(out,".xy",""); + out=replace(out,".x","[1]"); + out=replace(out,".y","[2]"); + out; +); + +Defvar(varstr):=( + regional(name,value,tmp,tmp1); + parse(varstr); + tmp=indexof(varstr,"="); + name=substring(varstr,0,tmp-1); + value=substring(varstr,tmp,length(varstr)); + value=parse(value); + tmp1=select(1..length(VLIST),VLIST_#_1==name+"="); + if(length(tmp1)>0, + tmp=tmp1_1; + VLIST_tmp=[name+"=",value]; + , + VLIST=prepend([name+"=",value],VLIST); + ); +); + +Defvar(name,value):=( +//help:Defvar("a",0.3); + regional(tmp,tmp1); + if(islist(value), + tmp1="["; + forall(value, + tmp1=tmp1+format(#,5)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]"; + , + tmp1=format(value,5); + ); + tmp=name+"="+tmp1; // 15.02.06 + parse(tmp); + VLIST=select(VLIST,#_1!=name+"="); // 15.02.08 + VLIST=prepend([name+"=",value],VLIST); +); + +Iftosci(strorg):=( // 16.06.10 + regional(str,ifL,ppL,cpL,kk,sL, + tmp,tmp1,tmp2,tmp3,tmp4); + str=replace(strorg,LFmark,""); + ifL=Indexall(str,"if("); + ppL=Bracket(str,"()"); + cpL=Indexall(str,","); + tmp1=Bracket(str,"[]"); + forall(1..(length(tmp1)/2),kk, + cpL=select(cpL,#<tmp1_(2*kk-1)_1%#_1>tmp1_(2*kk)_1); + ); + forall(1..length(ifL),kk, + tmp=select(ppL,#_1>ifL_kk); + tmp1=tmp_1; + tmp2=select(tmp,#_2==-tmp1_2); + tmp2=tmp2_1; + tmp3=select(cpL,#>tmp1_1 & #<tmp2_1); + ifL_kk=[tmp1_1,tmp2_1,tmp1_2,tmp3]; + ); + forall(1..length(cpL),kk, + tmp=select(1..length(ifL),contains(ifL_#_4,cpL_kk)); + tmp1=tmp_(length(tmp)); + cpL_kk=[cpL_kk,tmp1]; + ); + sL=apply(1..length(str),substring(str,#-1,#)); + forall(1..length(ifL),kk, + tmp1=ifL_kk_1; + tmp2=ifL_kk_2; + tmp=select(cpL,#_2==kk); + tmp3=apply(tmp,#_1); + sL_tmp1=" "; + sL_tmp2=";end;"; + sL_(tmp3_1)=" then,"; + if(length(tmp3)>1, + sL_(tmp3_2)=";else,"; + ); + ); + tmp=sum(sL); +); + +Fortosci(strorg):=( + regional(str,jj,var,tmp,tmp1,tmp2,tmp3,tmp4, + Out,repL,Pflg,Iflg,Cflg); + str=strorg; + repL=[]; + tmp1=Indexall(str,"forall"); + tmp2=Indexall(str,","); + forall(1..length(tmp1),jj, + tmp=select(tmp2,#>tmp1_jj); + var=substring(str,tmp_1,tmp_2-1); + tmp3=substring(str,tmp1_jj-1,tmp_2-1); + tmp=indexof(tmp3,"("); + tmp4=substring(tmp3,tmp,length(tmp3)); + tmp=indexof(tmp4,","); + tmp4=substring(tmp4,0,tmp-1); + tmp4="for "+var+"="+tmp4; + tmp4=replace(tmp4,"..",":"); + repL=concat(repL,[tmp3,tmp4]); + ); + forall(1..length(repL)/2, + str=replace(str,repL_(2*#-1),repL_(2*#)); + ); + tmp=Bracket(str); + tmp=select(tmp,#_2==0); + tmp=tmp_1_1; + tmp1=substring(str,tmp-1,length(str)); + tmp1=replace(tmp1,")",";end"); + str=substring(str,0,tmp-1)+tmp1; + str=replace(str,";;",";"); + str; +); + +Deffun(name,bodylist):=( +//help:Deffun("f(x)",["regional(y)","y=x^2*(x-3)","y"]); // 16.02.18 + regional(funstr,tmp,tmp1,str,Pos); + funstr=name+":=("; + forall(bodylist, + funstr=funstr+#+";"; + ); + funstr=funstr+");"; + parse(funstr); + tmp=bodylist_(length(bodylist)); + str="function "+tmp+"="+name+","; + forall(1..(length(bodylist)-1), + tmp1=bodylist_#; + tmp1=replace(tmp1,LFmark,"");// 16.05.26 + tmp1=replace(tmp1," ","");// 16.05.26 + Pos=indexof(tmp1,"regional")+indexof(tmp1,"local"); + if(Pos==0, + tmp=replace(tmp1,".xy",""); + tmp=replace(tmp,".x","(1)"); + tmp=replace(tmp,".y","(2)"); + if(indexof(tmp,"if(")>0, + tmp=iftosci(tmp); + ); + if(indexof(tmp,"forall(")>0, // 16.05.26from + tmp=Fortosci(tmp); + ); // 16.05.26upto + str=str+tmp+","; + ); + ); + str=str+"endfunction;"; + FUNLIST=append(FUNLIST,str); +); + +Windispg():=( + regional(Nj,Nk,Dt,Vj,tmp,tmp1,tmp2,tmp3,opcindy); + gsave(); + layer(KETPIClayer); + forall(GCLIST,Nj, + if(isstring(Nj_1),Dt=parse(Nj_1),Dt=Nj_1); // 11.17 + if(islist(Dt) & length(Dt)>0, // 12.19,12.22 + tmp=MeasureDepth(Dt); + if(tmp==1,Dt=[Dt]); + opcindy=Nj_3; + if(Nj_2<0,tmp1=0,tmp1=Nj_2); + if(tmp1<10, + forall(Dt,Nk, +// tmp2=apply(Nk,if(ispoint(#),Lcrd(#),#)); +// tmp2=apply(tmp2,Pcrd(#)); + tmp2=Nk; // 14.12.04 + if(length(Nk)>1, + forall(2..length(Nk), + tmp3=textformat(Nk_[#-1,#],5); + tmp3=substring(tmp3,1,length(tmp3)-1); + if(tmp1==1,opcindy=opcindy+",dashpattern->[2,2]"); + tmp="draw("+tmp3+ + ",dashtype->"+text(tmp1)+",linecolor->"+KCOLOR+opcindy+")"; + parse(tmp); + ); + , + if(length(Nk)==1, + tmp="draw("+text(tmp2_1)+opcindy+")"; // 14.12.31 + parse(tmp); + ); + ); + ); + ); + ); + ); +// if(ADDAXES=="1", // 16.10.08from +// draw([XMIN,0],[XMAX,0],color->[0,0.2,0]); +// draw([0,YMIIN],[0,YMAX],color->[0,0.2,0]); +// Letter([[XMAX,0],"e","x",[0,YMAX],"n","y"]); +// Letter([[0,0],"sw","O"]); +// ); // 16.10.08upto + grestore(); + layer(0); +); +</script> + <script type="text/javascript"> +var cdy = CindyJS({ + scripts: "cs*", + use: ["katex"], + defaultAppearance: { + dimDependent: 0.7, + fontFamily: "sans-serif", + lineSize: 1, + pointSize: 5.0, + textsize: 12.0 + }, + angleUnit: "°", + geometry: [ + {name: "SW", type: "Free", pos: [-2.5744680851063833, -4.0, 0.8525536333742482], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "NE", type: "Free", pos: [4.0, 2.4285714285714284, 0.44032989855593035], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "A", type: "Free", pos: [0.0, -4.0, -0.8], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "B", type: "Free", pos: [-0.02366863905325444, -4.0, 0.9484028584281579], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "a", type: "Segment", color: [0.0, 0.0, 1.0], args: ["A", "B"], labeled: true}, + {name: "C", type: "PointOnSegment", pos: [0.011092747971205843, -4.0, -1.619421523013707], color: [1.0, 0.0, 0.0], args: ["a"], labeled: true}, + {name: "E", type: "Free", pos: [0.0, -4.0, 0.6666666666666666], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "F", type: "Free", pos: [4.0, -2.1818181818181817, 0.36363636363636365], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "b", type: "Segment", color: [0.0, 0.0, 1.0], args: ["E", "F"], labeled: true}, + {name: "G", type: "PointOnSegment", pos: [3.5770716007636896, -4.0, 0.6666666666666666], color: [1.0, 0.0, 0.0], args: ["b"], labeled: true}, + {name: "H", type: "Free", pos: [0.0, -4.0, 0.5714285714285714], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "K", type: "Free", pos: [4.0, -2.5454545454545454, 0.36363636363636365], color: [1.0, 0.0, 0.0], labeled: true}, + {name: "c", type: "Segment", color: [0.0, 0.0, 1.0], args: ["H", "K"], labeled: true}, + {name: "L", type: "PointOnSegment", pos: [0.5714285657142855, -4.0, 0.5714285714285713], color: [1.0, 0.0, 0.0], args: ["c"], labeled: true}, + {name: "M", type: "Free", pos: [-2.0, -4.0, -1.0], color: [1.0, 0.0, 0.0], size: 2.0}, + ], + ports: [{ + id: "CSCanvas", + width: 1024, + height: 545, + transform: [{visibleRect: [-9.745440419289913, 6.700770173058494, 15.809824598259054, -6.900420681008095]}], + axes: true, + grid: 1.0, + snap: true, + background: "rgb(168,176,192)" + }], + csconsole: false, + cinderella: {build: 1901, version: [2, 9, 1901]} +}); + </script> +</head> +<body> + <div id="CSCanvas"></div> +</body> +</html> diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1603gamow.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1603gamow.cdy Binary files differnew file mode 100644 index 00000000000..2c300fa3051 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1603gamow.cdy diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/KetCindyPlugin.iml b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/KetCindyPlugin.iml new file mode 100644 index 00000000000..2ecc1971e36 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/KetCindyPlugin.iml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module relativePaths="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/classes" /> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library" scope="PROVIDED"> + <library> + <CLASSES> + <root url="jar:///private/tmp/KetCindyPlugin/lib/cindy2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar:///private/tmp/KetCindyPlugin/lib/commons-math.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + </component> +</module> + diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/build.xml b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/build.xml new file mode 100755 index 00000000000..2f3eeff2c6a --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/build.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="ExamplePlugin" default="copy"> + + <target name="init" description="setup paths"> + <mkdir dir="target"/> + <property name="cindy2jar" location="lib/cindy2.jar"/> + <property name="pluginfolder" location="target/Plugins"/> + <property name="plugin" location="KetCindyPlugin.jar"/> + <mkdir dir="target/Plugins"/> + </target> + <path id="libraries"> + <fileset dir="lib" includes="*.jar"/> + </path> + + <!-- no changes necessary below this line --> + + + <target name="compile" depends="init" description="compile Example Plugin for Cinderella"> + <mkdir dir="target/classes"/> + <javac encoding="utf-8" debug="on" optimize="on" + srcdir="src" destdir="target/classes" target="1.6" + source="1.6"> + <classpath> + <pathelement location="${cindy2jar}"/> + <path refid="libraries"/> + </classpath> + </javac> + </target> + + <target name="build" depends="compile" description="create the complete jRealityPlugin for Cinderella"> + + <delete file="${plugin}"/> + + <!-- add compiled classes --> + <jar basedir="target/classes" destfile="${plugin}" includes="**/*"> + </jar> + + <!-- add class path --> + <pathconvert property="mf.classpath" pathsep=" "> + <path refid="libraries"/> + <flattenmapper/> + </pathconvert> + <jar destfile="${plugin}" update="true" index="true"> + <manifest> + <attribute name="Class-Path" value="${mf.classpath}"/> + </manifest> + <zipgroupfileset dir="lib" includes="*.jar"> + <exclude name="cindy2.jar"/> + </zipgroupfileset> + </jar> + + <!-- Add services file --> + <jar destfile="${plugin}" basedir="config" update="true"> + <file file="META-INF/services/de.cinderella.api.cs.CindyScriptPlugin"/> + </jar> + </target> + + <target name="copy" depends="build" description="Copy plugin to Plugins folder"> + <copy file="${plugin}" todir="${pluginfolder}"/> + </target> + + + <target name="clean"> + <delete dir="target"/> + </target> + +</project>
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/config/META-INF/services/de.cinderella.api.cs.CindyScriptPlugin b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/config/META-INF/services/de.cinderella.api.cs.CindyScriptPlugin new file mode 100755 index 00000000000..66f6d6c3265 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/config/META-INF/services/de.cinderella.api.cs.CindyScriptPlugin @@ -0,0 +1 @@ +KetCindyPlugin diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/cindy2.jar b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/cindy2.jar Binary files differnew file mode 100755 index 00000000000..fe2f87e7194 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/cindy2.jar diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/commons-math.jar b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/commons-math.jar Binary files differnew file mode 100755 index 00000000000..1dc2517c210 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/commons-math.jar diff --git a/Master/texmf-dist/doc/support/ketcindy/source/ketjava/KetCindyPlugin.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/src/KetCindyPlugin.java index 4aa74435807..16fe6ae454a 100644 --- a/Master/texmf-dist/doc/support/ketcindy/source/ketjava/KetCindyPlugin.java +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/src/KetCindyPlugin.java @@ -427,4 +427,82 @@ public class KetCindyPlugin extends CindyScriptPlugin { return date.toString(); } + @CindyScript("gettexmfdist") + public static String gettexmfdist() { + try { + return kpsewhich("-var-value=TEXMFDIST"); + } catch ( Exception e ) { + e.printStackTrace(); + return ""; + } + } + + + /** + * The following function is copied from TeXOSQuery.java + * which is under LPPL + */ + /** + * Runs kpsewhich and returns the result. This is for single + * argument lookups through kpsewhich, such as a file location + * or variable value. + * @param arg The argument to pass to kpsewhich + * @return The result read from the first line of STDIN + * @since 1.2 + */ + protected static String kpsewhich(String arg) + throws IOException,InterruptedException + { + // Create and start the process. + Process process = + new ProcessBuilder("kpsewhich", arg).start(); + + int exitCode = process.waitFor(); + + String line = null; + + if (exitCode == 0) + { + // kpsewhich completed with exit code 0. + // Read STDIN to find the result. + + InputStream stream = process.getInputStream(); + + if (stream == null) + { + throw new IOException(String.format( + "Unable to open input stream from process: kpsewhich '%s'", + arg)); + } + + BufferedReader reader = null; + + try + { + reader = new BufferedReader(new InputStreamReader(stream)); + + // only read a single line, nothing further is required + // for a variable or file location query. + line = reader.readLine(); + } + finally + { + if (reader != null) + { + reader.close(); + } + } + } + else + { + // kpsewhich failed. + + throw new IOException(String.format( + "\"kpsewhich '%s'\" failed with exit code: %d", arg, exitCode)); + } + + return line; + } + + } diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin150906.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin150906.java new file mode 100755 index 00000000000..09da2d3b795 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin150906.java @@ -0,0 +1,150 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("getDirhead") + public String getDirhead() { + if(iswindows()){ + return "C:\ketcindy"; + } + if(ismacosx()){ + return "/Applications/ketcindy"; + } + if(islinux()){ + return "/usr/share/ketcindy"; + } + } + + @CindyScript("kc") + public static void kc(String args) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } + }; + Process process = pb.start(); + return; + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160515.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160515.java new file mode 100755 index 00000000000..d0834fe0b1c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160515.java @@ -0,0 +1,137 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static void kc(String args) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } + }; + Process process = pb.start(); + return; + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160518.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160518.java new file mode 100755 index 00000000000..443ac0ebb04 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160518.java @@ -0,0 +1,154 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static void kc(String args) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } + }; + Process process = pb.start(); + return; + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return "C:\\ketcindy"; + } + else if(ismacosx()){ + return "/Applications/ketcindy"; + } + else if(islinux()){ + return "/usr/share/ketcindy"; + } + else{ + return "/Applications/ketcindy"; + } + } + + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160530.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160530.java new file mode 100755 index 00000000000..1e2351c48a8 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160530.java @@ -0,0 +1,154 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static void kc(String args) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + pb.command("sh",args); + } + else{ + pb.command("sh",args); + } + }; + Process process = pb.start(); + return; + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return "C:\\ketcindy"; + } + else if(ismacosx()){ + return "/Applications/ketcindy"; + } + else if(islinux()){ + return "/usr/share/ketcindy"; + } + else{ + return "/Applications/ketcindy"; + } + } + + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160601.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160601.java new file mode 100755 index 00000000000..086cebdc20c --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160601.java @@ -0,0 +1,154 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static void kc(String args) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + pb.command("sh",args); + } + else{ + pb.command("sh",args); + } + }; + Process process = pb.start(); + return; + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160604.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160604.java new file mode 100755 index 00000000000..a32b50fac77 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160604.java @@ -0,0 +1,205 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kcnow") + public static Long kcnow(String args){ + return System.currentTimeMillis(); + } + + @CindyScript("kcmodified") + public static Long kcmodified(String args){ + File f = new File(args); + return System.currentTimeMillis()-f.lastModified(); + } + + @CindyScript("kc") + public static void kc(String args) throws IOException {} + + @CindyScript("kc") + public static void kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + // 16.06.04from + File f = new File(args); + int flg=0; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + str=str.toUpperCase(); + if(str.indexOf("RM ")>-1){ + flg=1; + } + if(str.indexOf("DEL ")>-1){ + flg=1; + } + if(str.indexOf("MV ")>-1){ + flg=1; + } + if(str.indexOf("RD ")>-1){ + flg=1; + } + if(str.indexOf("*")>-1){ + flg=1; + } + if(str.indexOf("?")>-1){ + flg=1; + } + } + br.close(); + Long tm=System.currentTimeMillis()-f.lastModified(); +// if(tm<5000 && flg==0){ + if(flg==0){ + if(iswindows()){ + if((args.endsWith("\\kc.bat")&&args2.endsWith("\\ketbin"))&&args3.endsWith(".tex")){ + pb.command("cmd.exe","/c","start",args); + } + } + else{ + if(ismacosx()){ + if((args.endsWith("/kc.sh")&&args2.endsWith("/ketbin"))&&args3.endsWith(".tex")){ + pb.command("sh",args); + } + } + else{ + if((args.endsWith("/kc.sh")&&args2.endsWith("/ketbin"))&&args3.endsWith(".tex")){ + pb.command("sh",args); + } + } + } + } + // 16.06.04upto + Process process = pb.start(); + return; + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160609.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160609.java new file mode 100755 index 00000000000..f5c5ea41125 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160609.java @@ -0,0 +1,259 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + if(str.indexOf(args3.toUpperCase())==-1){ + flg=2; + } + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } + if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + } + } + br.close(); + // 16.06.05from + if(flg>0){ + return "Improper file "+String.valueOf(flg); + } + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketbin")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160723.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160723.java new file mode 100644 index 00000000000..fb287873d90 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160723.java @@ -0,0 +1,269 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161019.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161019.java new file mode 100644 index 00000000000..13c303ac0c0 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161019.java @@ -0,0 +1,311 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return System.getProperty("user.home")+"/ketcindy"; + // "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("getdirhead") + public static String getdirhead(String dir){ + if(iswindows()){ + return dir+"\\ketcindy"; + } + else if(ismacosx()){ + return dir+"/ketcindy"; + } + else if(islinux()){ + return dir+"/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("isexists") + // 16.10.02 + public static boolean isheadexists(String dir,String fname){ + File file = new File(dir+"/"+fname); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("setexec") + // 16.10.19 + public static boolean setexec(String dir,String fname){ + File file = new File(dir+"/"+fname); + if(file.exists()){ + file.setExecutable(true); + return true; + } + else{ + return false; + } + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161021.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161021.java new file mode 100644 index 00000000000..67decd5b861 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161021.java @@ -0,0 +1,330 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; +import java.util.Date; +//16.10.21 + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return System.getProperty("user.home")+"/ketcindy"; + // "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("getdirhead") + public static String getdirhead(String dir){ + if(iswindows()){ + return dir+"\\ketcindy"; + } + else if(ismacosx()){ + return dir+"/ketcindy"; + } + else if(islinux()){ + return dir+"/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + file.setExecutable(true,false); + //16.10.19 + return true; + } + else{ + return false; + } + } + + @CindyScript("isexists") + // 16.10.02 + public static boolean isexists(String dir,String fname){ + File file = new File(dir+"/"+fname); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("setexec") + // 16.10.19 + public static String setexec(String dir,String fname){ + File file = new File(dir+"/"+fname); + File path = new File(dir); + if(path.exists()){ + if(file.exists()){ + file.setExecutable(true,false); + return fname+" executable"; + } + else{ +// file.createNewFile(); +// file.setExecutable(true,false); + return fname+" not exists"; + } + } + else{ + return dir+" not exists"; + } + } + + @CindyScript("getdatetime") + // 16.10.21 + public static String getdatetime(){ + Date date=new Date(); + return date.toString(); + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161209.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161209.java new file mode 100644 index 00000000000..bf997abf3ef --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161209.java @@ -0,0 +1,372 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; +import java.util.Date; +//16.10.21 + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return System.getProperty("user.home")+"/ketcindy"; + // "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("getdirhead") + public static String getdirhead(String dir){ + if(iswindows()){ + return dir+"\\ketcindy"; + } + else if(ismacosx()){ + return dir+"/ketcindy"; + } + else if(islinux()){ + return dir+"/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + file.setExecutable(true,false); + //16.10.19 + return true; + } + else{ + return false; + } + } + + @CindyScript("isexists") + // 16.10.02 + public static boolean isexists(String dir,String fname){ + File file = new File(dir+"/"+fname); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("fileslength") + // 16.12.09 + public static int fileslength(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + int ctr=0; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(head.equals(".")){ctr=ctr+1;} + } + return files.length-ctr; + } + else{ + return -1; + } + } + + @CindyScript("fileslist") + // 16.12.09 + public static String fileslist(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + String strall=""; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(!head.equals(".")){strall=strall+","+str;} + } + return strall.substring(1); + } + else{ + return ""; + } + } + + @CindyScript("setexec") + // 16.10.19 + public static String setexec(String dir,String fname){ + File file = new File(dir+"/"+fname); + File path = new File(dir); + if(path.exists()){ + if(file.exists()){ + file.setExecutable(true,false); + return fname+" executable"; + } + else{ +// file.createNewFile(); +// file.setExecutable(true,false); + return fname+" not exists"; + } + } + else{ + return dir+" not exists"; + } + } + + @CindyScript("getdatetime") + // 16.10.21 + public static String getdatetime(){ + Date date=new Date(); + return date.toString(); + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170605.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170605.java new file mode 100644 index 00000000000..3a34639335e --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170605.java @@ -0,0 +1,377 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; +import java.util.Date; +//17.06.05 + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("ketjavaversion") + public String ketjavaversion() { + return "Ketjava 2017.06.05"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return System.getProperty("user.home")+"/ketcindy"; + // "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("getdirhead") + public static String getdirhead(String dir){ + if(iswindows()){ + return dir+"\\ketcindy"; + } + else if(ismacosx()){ + return dir+"/ketcindy"; + } + else if(islinux()){ + return dir+"/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + file.setExecutable(true,false); + //16.10.19 + return true; + } + else{ + return false; + } + } + + @CindyScript("isexists") + // 16.10.02 + public static boolean isexists(String dir,String fname){ + File file = new File(dir+"/"+fname); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("fileslength") + // 16.12.09 + public static int fileslength(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + int ctr=0; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(head.equals(".")){ctr=ctr+1;} + } + return files.length-ctr; + } + else{ + return -1; + } + } + + @CindyScript("fileslist") + // 16.12.09 + public static String fileslist(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + String strall=""; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(!head.equals(".")){strall=strall+","+str;} + } + return strall.substring(1); + } + else{ + return ""; + } + } + + @CindyScript("setexec") + // 16.10.19 + public static String setexec(String dir,String fname){ + File file = new File(dir+"/"+fname); + File path = new File(dir); + if(path.exists()){ + if(file.exists()){ + file.setExecutable(true,false); + return fname+" executable"; + } + else{ +// file.createNewFile(); +// file.setExecutable(true,false); + return fname+" not exists"; + } + } + else{ + return dir+" not exists"; + } + } + + @CindyScript("getdatetime") + // 16.10.21 + public static String getdatetime(){ + Date date=new Date(); + return date.toString(); + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170906.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170906.java new file mode 100644 index 00000000000..404d9e3e162 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170906.java @@ -0,0 +1,388 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; +import java.util.Date; +//17.06.05 + +public class KetCindyPlugin extends CindyScriptPlugin { + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("ketjavaversion") + public String ketjavaversion() { + return "Ketjava 2017.06.05"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return System.getProperty("user.home")+"/ketcindy"; + // "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("getdirhead") + public static String getdirhead(String dir){ + if(iswindows()){ + return dir+"\\ketcindy"; + } + else if(ismacosx()){ + return dir+"/ketcindy"; + } + else if(islinux()){ + return dir+"/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + file.setExecutable(true,false); + //16.10.19 + return true; + } + else{ + return false; + } + } + + @CindyScript("isexists") + // 16.10.02 + public static boolean isexists(String dir,String fname){ + File file = new File(dir+"/"+fname); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("makedir") + // 17.09.06 + public static boolean makedir(String dir,String dirname){ + File newfile = new File(dir+"/"+dirname); + if (newfile.mkdir()){ + return true; + }else{ + return false; + } + } + + @CindyScript("fileslength") + // 16.12.09 + public static int fileslength(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + int ctr=0; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(head.equals(".")){ctr=ctr+1;} + } + return files.length-ctr; + } + else{ + return -1; + } + } + + @CindyScript("fileslist") + // 16.12.09 + public static String fileslist(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + String strall=""; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(!head.equals(".")){strall=strall+","+str;} + } + return strall.substring(1); + } + else{ + return ""; + } + } + + @CindyScript("setexec") + // 16.10.19 + public static String setexec(String dir,String fname){ + File file = new File(dir+"/"+fname); + File path = new File(dir); + if(path.exists()){ + if(file.exists()){ + file.setExecutable(true,false); + return fname+" executable"; + } + else{ +// file.createNewFile(); +// file.setExecutable(true,false); + return fname+" not exists"; + } + } + else{ + return dir+" not exists"; + } + } + + @CindyScript("getdatetime") + // 16.10.21 + public static String getdatetime(){ + Date date=new Date(); + return date.toString(); + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin171112.java b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin171112.java new file mode 100644 index 00000000000..3e7d6312802 --- /dev/null +++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin171112.java @@ -0,0 +1,399 @@ +import de.cinderella.api.cs.CindyScript; +import de.cinderella.api.cs.CindyScriptPlugin; +import org.apache.commons.math.linear.MatrixUtils; +import org.apache.commons.math.linear.RealMatrix; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.io.*; +import java.util.Date; + +public class KetCindyPlugin extends CindyScriptPlugin { + + @CindyScript("ketjavaversion") + public String ketjavaversion() { + return "Ketjava 2017.11.08"; + } + + public String getName() { + return "KetCindy Plugin"; + } + + public String getAuthor() { + return "The KetCindy Project Team"; + } + + @CindyScript("systemproperty") + public String getUserID(String s) { + return System.getProperty(s); + } + + @CindyScript("square") + public double quadrieren(double x) { + return x * x; + } + + @CindyScript("grayvalue") + public double getGray(Color c) { + return (c.getBlue() + c.getRed() + c.getGreen()) / 3.; + } + + @CindyScript("testarray") + public String writeArray(ArrayList<Double> al) { + return Arrays.toString(al.toArray()); + } + + @CindyScript("getdir") + public String getdir() { + return System.getProperty("user.dir"); + } + + @CindyScript("gethome") + public String gethome() { + return System.getProperty("user.home"); + } + + @CindyScript("getname") + // 17.10.08 + public String getname() { + return System.getProperty("user.name"); + } + + @CindyScript("iswindows") + static public boolean iswindows(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("windows")){ + return true; + } + else{ + return false; + } + } + @CindyScript("ismacosx") + public static boolean ismacosx(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("mac")){ + return true; + } + else{ + return false; + } + } + @CindyScript("islinux") + public static boolean islinux(){ + String os=System.getProperty("os.name").toLowerCase(); + if(os!=null && os.startsWith("linux")){ + return true; + } + else{ + return false; + } + } + + @CindyScript("iswin") + public static boolean iswin() { + String OS_NAME = System.getProperty("os.name").toLowerCase(); + return OS_NAME.startsWith("windows"); + } + + @CindyScript("kc") + public static String kc(String args){ + return "Improper call"; + } + + @CindyScript("kc") + public static String kc(String args,String args2,String args3) throws IOException { + ProcessBuilder pb = new ProcessBuilder(); + File f = new File(args); + int flg=0; + int pos=0; + String kst=""; + BufferedReader br = new BufferedReader(new FileReader(f)); + String str; + while((str = br.readLine()) != null){ + if(str.indexOf("*")>-1|| str.indexOf("?")>-1){ + flg=1; + } + else{ + str=str.toUpperCase(); + str=str.replaceAll("\""," "); /* 16.06.08 */ + if(str.indexOf("RM ")>-1 || str.indexOf("DEL ")>-1){ + //16.07.21from + if(str.indexOf(".DVI")==-1 && str.indexOf(".TXT")==-1){ + flg=2; + } + // 16.07.21upto + } + if(str.indexOf("MV ")>-1 || str.indexOf("MOVE ")>-1){ + flg=3; + } + if(str.indexOf("RD ")>-1 || str.indexOf("RMDIR ")>-1){ + flg=4; + } + // 16.04.09from + if(str.indexOf("SHUTDOWN ")>-1 || str.indexOf("SLEEP ")>-1){ + flg=5; + } + if(str.indexOf("CLEAR ")>-1 || str.indexOf("CLS ")>-1){ + flg=6; + } + if(str.indexOf("FTP ")>-1|| str.indexOf("TELNET ")>-1){ + flg=7; + } + if(str.indexOf("USERMOD ")>-1 || str.indexOf("USERDEL ")>-1){ + flg=8; + } + if(str.indexOf("USERADD ")>-1 || str.indexOf("USERMOD ")>-1){ + flg=9; + } + if(str.indexOf("CHMOD ")>-1){ + if(str.indexOf("CHMOD +")==-1){ + flg=10; + } + } + if(str.indexOf("CRONTAB ")>-1 || str.indexOf("KILL ")>-1){ + flg=11; + } + if(str.indexOf("AT ")>-1){ + pos=str.indexOf("AT "); + if(pos==0){ + flg=12; + } + else{ + kst=str.substring(pos-1,pos); + if(!kst.equals("B")){ + flg=12; + } + } + // 16.04.09upto + } +// if(str.indexOf("PATH ")>-1 || str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + if(str.indexOf("PAUSE ")>-1 || str.indexOf("ARP ")>-1){ + flg=13; + } + if(str.indexOf("RENAME ")>-1 || str.indexOf("START ")>-1){ + flg=14; + } + // 16.07.21 + if(str.indexOf(".SH")>-1 || str.indexOf(".BAT")>-1){ + if(str.indexOf("MAXIMA.")==-1 && str.indexOf("KC.")==-1){ /* 2016.07.22 */ + flg=15; + } + } + } + if(flg>0){ + br.close(); + return "Improper file "+String.valueOf(flg)+" "+str; + } + } + br.close(); + // 16.06.05from + Long tm=System.currentTimeMillis()-f.lastModified(); + if(tm>10000 || tm<0){ /* 16.06.08 */ + flg=50; + return "Time expired"; + } + if((args.indexOf("kc.")==-1|| args2.indexOf("ketlib")==-1) || args3.indexOf(".t")==-1){ + flg=60; + return "Improper form"; + } + if(flg==0){ + if(iswindows()){ + pb.command("cmd.exe","/c","start",args); + } + else{ + if(ismacosx()){ + if(args2.indexOf("open")>-1){ /* 2016.06.07from */ + pb.command("open",args); + } + else{ + pb.command("sh",args); + } /* 2016.06.07upto */ + } + else{ + pb.command("sh",args); + } + } + } + Process process = pb.start(); + return "Normal end"; + // 16.06.05upto + } + + @CindyScript("ispaulvisiting") + public static boolean ispaulvisiting() { + return true; + } + + @CindyScript("texv") + public static void texv( String s, String d, String sf, String tf) throws Exception{ + ProcessBuilder pb = new ProcessBuilder(); + String[] cmd = {s,d,sf,tf}; + pb.command(cmd); + Process process = pb.start(); + return ; + } + + @CindyScript("givemeamatrix2") + public static Object givemeamatrix2() { + try { + return "the Matrix: " + theGiveMeAMatrix().toString(); + } catch (Throwable e) { + e.printStackTrace(); + return "no Matrix: " + e.toString(); + } + } + + public static Object theGiveMeAMatrix() { + double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; + RealMatrix m = MatrixUtils.createRealMatrix(matrixData); + return m; + } + + @CindyScript("getdirhead") + public static String getdirhead(){ + if(iswindows()){ + return System.getProperty("user.home")+"\\ketcindy"; + } + else if(ismacosx()){ + return System.getProperty("user.home")+"/ketcindy"; + } + else if(islinux()){ + return System.getProperty("user.home")+"/ketcindy"; + // "/usr/share/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("getdirhead") + public static String getdirhead(String dir){ + if(iswindows()){ + return dir+"\\ketcindy"; + } + else if(ismacosx()){ + return dir+"/ketcindy"; + } + else if(islinux()){ + return dir+"/ketcindy"; + } + else{ + return "unknown"; + } + } + + @CindyScript("iskcexists") + public static boolean iskcexists(String dir){ + File file = new File(dir+"/kc.sh"); + if(file.exists()){ + file.setExecutable(true,false); + //16.10.19 + return true; + } + else{ + return false; + } + } + + @CindyScript("pathsep") + // 17.09.06 + public static String pathsep(){ + return File.separator; + } + + @CindyScript("isexists") + // 16.10.02 + public static boolean isexists(String dir,String fname){ + File file = new File(dir+File.separator+fname); + if(file.exists()){ + return true; + } + else{ + return false; + } + } + + @CindyScript("makedir") + // 17.09.06 + public static String makedir(String dir,String dirname){ + File newfile = new File(dir+File.separator+dirname); + if (newfile.mkdir()){ + return dirname+" created"; + }else{ + return dirname+" already exists"; + } + } + + @CindyScript("fileslength") + // 16.12.09 + public static int fileslength(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + int ctr=0; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(head.equals(".")){ctr=ctr+1;} + } + return files.length-ctr; + } + else{ + return -1; + } + } + + @CindyScript("fileslist") + // 16.12.09 + public static String fileslist(String dirname){ + File dir=new File(dirname); + File[] files=dir.listFiles(); + String str; + String head; + String strall=""; + if(dir.exists()){ + for(int i=0;i<files.length;i++){ + str=files[i].getName(); + head=str.substring(0,1); + if(!head.equals(".")){strall=strall+","+str;} + } + return strall.substring(1); + } + else{ + return ""; + } + } + + @CindyScript("setexec") + // 16.10.19 + public static String setexec(String dir,String fname){ + File file = new File(dir+File.separator+fname); + File path = new File(dir); + if(path.exists()){ + if(file.exists()){ + file.setExecutable(true,false); + return fname+" executable"; + } + else{ +// file.createNewFile(); +// file.setExecutable(true,false); + return fname+" not exists"; + } + } + else{ + return dir+" not exists"; + } + } + + @CindyScript("getdatetime") + // 16.10.21 + public static String getdatetime(){ + Date date=new Date(); + return date.toString(); + } + +} diff --git a/Master/texmf-dist/doc/support/ketcindy/source/ketmanual/KeTCindyReferenceJ.tex b/Master/texmf-dist/doc/support/ketcindy/source/ketmanual/KeTCindyReferenceJ.tex index 7c2eb7564fc..25a75372a03 100644 --- a/Master/texmf-dist/doc/support/ketcindy/source/ketmanual/KeTCindyReferenceJ.tex +++ b/Master/texmf-dist/doc/support/ketcindy/source/ketmanual/KeTCindyReferenceJ.tex @@ -1,7 +1,7 @@ \documentclass[papersize,a4paper,12pt,uplatex]{jsarticle} \usepackage{ketpic,ketlayer} \usepackage{amsmath} -\usepackage{newtxmath} +% \usepackage{amsmath,newtxmath} \usepackage[dvipdfmx]{graphicx,color} \usepackage{wrapfig} \usepackage[dvipdfmx,bookmarks=false,colorlinks=true,linkcolor=blue]{hyperref} @@ -14,7 +14,6 @@ \author{\ketcindy\ Project Team} \maketitle - \tableofcontents \newpage @@ -214,7 +213,7 @@ YaThick, YMAX, YMIN, VLIST \\ 例:$f(x)=\dfrac{1}{x^2+1}$ を定義し,グラフを描いてx=1 における微分係数を求める。 \begin{verbatim} - Deffun("f(x)",["regional(y)","y=1/(x\verb|^|2+1)","y"]); + Deffun("f(x)",["regional(y)","y=1/(x^2+1)","y"]); Plotdata("1","f(x)","x"); coeff=Derivative("f(x)","x",1); \end{verbatim} @@ -227,7 +226,7 @@ YaThick, YMAX, YMIN, VLIST \end{verbatim} \input{Fig/deffun}\\ - 例:$f(x)=\left\{\begin{array}{l}1 (x\geqq 0)\\ -1 (x<0)\\ \end{array}\right.$ を定義する。 + 例:$f(x)=\left\{\begin{array}{l}1 (x\geq 0)\\ -1 (x<0)\\ \end{array}\right.$ を定義する。 \begin{verbatim} Deffun("f(x)",["regional(y)","if(x>=0,y=1,y=-1)","y"]); \end{verbatim} @@ -244,7 +243,11 @@ YaThick, YMAX, YMIN, VLIST \item[機能] 変数を定義する \item[説明] 変数の定義をScilabと共有する。また,ScilabのAssignリストに追加する。\\ \\ - 例:\verb|Defvar("const=3");| + 例:\verb|Defvar("const=3");|\\ + \\ + 複数の変数を定義するときはリストにする。\\ + \\ + 例:\verb|Defvar([“a”,3,”b”,1]);|\\ \\ \hypertarget{drwxy}{} \item[関数] Drwxy() @@ -293,9 +296,9 @@ YaThick, YMAX, YMIN, VLIST \item[機能] \ketcindy を初期化する \item[説明] opution 縦方向の倍率と描画領域を設定\\ - 例:\verb|Ketinit()| :倍率1,描画領域 $-5 \leqq x \leqq 5 , -5 \leqq y \leqq 5$(デフォルト)\\ - \verb|Ketinit(2)| : 倍率2,描画領域 $-5 \leqq x \leqq 5 , -5 \leqq y \leqq 5$\\ - \verb|Ketinit(2,[-2,3],[-2,4])| : 倍率2,描画領域 $-2 \leqq x \leqq 3 , -2 \leqq y \leqq 4$\\ + 例:\verb|Ketinit()| :倍率1,描画領域 $-5 \leq x \leq 5 , -5 \leq y \leq 5$(デフォルト)\\ + \verb|Ketinit(2)| : 倍率2,描画領域 $-5 \leq x \leq 5 , -5 \leq y \leq 5$\\ + \verb|Ketinit(2,[-2,3],[-2,4])| : 倍率2,描画領域 $-2 \leq x \leq 3 , -2 \leq y \leq 4$\\ 描画領域(TeXに出力する領域)は制御点SW(左下)とNE(右上)を対角とする矩形領域。描画領域を指定すると,制御点がなければその位置に作り,すでに存在する場合は何もしない。作成された制御点はドラッグして描画領域を変更することができる。\\ 倍率は,Setscaling(倍率)を実行するのと同じ。ただし,Cinderellaで作図した幾何要素に対しては無効。(Setscaling()の項参照)\\ @@ -382,11 +385,11 @@ YaThick, YMAX, YMIN, VLIST を実行すると,矢じりつきの弧を赤で表示することができる。\\ 1行目は,\verb|Setcolor("red");| でもよい。\\ ただし,Cinderellaの描画面では着色されない。\\ - 描画面でも着色したい場合は,オプション \verb|"color->[R,G,B]"| を用いる。\\ + 描画面でも着色したい場合は,オプション \verb|"Color=[R,G,B]"| を用いる。\\ 上の例の場合, \begin{verbatim} - Circledata([A,D],["Rng=[0,pi/3]","color->[1,0,0]"]); - Arrowhead(E,[-1,0.8],[2,1,"color->[1,0,0]"]); + Circledata([A,D],["Rng=[0,pi/3]","Color=[1,0,0]"]); + Arrowhead(E,[-1,0.8],[2,1,"Color=[1,0,0]"]); \end{verbatim} とすれば,描画面でも赤で表示される。\\ @@ -485,7 +488,7 @@ YaThick, YMAX, YMIN, VLIST \hypertarget{setunitlen}{} \item[関数] Setunitlen(文字列) \item[機能] 単位長を設定する。デフォルトは 1cm\\ - \\ + この関数は,スクリプトの初めの方に書くのがよい。\\ \\ \hypertarget{setwindow}{} \item[関数] Setwindow() @@ -495,9 +498,22 @@ YaThick, YMAX, YMIN, VLIST しかし,これとは別に出力範囲を設定したい場合にこの関数を用いる。\\ また,表を作成したときは,表の範囲が出力範囲として優先される(Tabledata()を実行したとき)ので,表外に図を描いた場合は,最後にこの関数で出力範囲を指定して書き出す。\\ \\ -\end{description} +\hypertarget{slider}{} +\item[関数] Slider(名称,位置1,位置2) +\item[機能] スライダを作成する +\item[説明] 名称は "A-C-B" の形で,端点をA,B,スライダ点をCとしたスライダを作る。\\ + 端点A,Bの位置を,位置1,位置2で指定する。 + +例:端点をA,Bとし,スライダの点をCとして,Aの位置を[0,2],Bの位置を[8,2]としてスライダを作る。 +\begin{verbatim} + Slider("A-C-B",[0,2],[8,2]); +\end{verbatim} + スライダにより取得したい値は,点Cの座標(たとえば C.x)を利用する。 + \\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} +\end{description} + \newpage %第5節================================= \subsection{描画} @@ -520,8 +536,8 @@ YaThick, YMAX, YMIN, VLIST "id,m,n" \>ギャップからはじまる破線を描く。Scilab のファイルに Invdashline() を出力する。\\ "do,m,n" \>点線で描く。Scilab のファイルに Dottedline() を出力する。\\ \>mは点の間隔,nは太さ (m,nは省略可)\\ - 描画色指定は,Cindyscriptの表記と同様で,RGBのリストで指定するか,色名を用いる。\\ - 例:\verb|"color->[0,0.7,0]"| で暗い緑になる。\\ + 描画色指定は,RGBまたはCMYKのリストで指定するか,色名を用いる。\\ + 例:\verb|"Color=[0,0.7,0]"| で暗い緑になる。\\ 出力の有無は\\ "notex" \>Cinderella画面上で補助線として用いた図形をScilabに出力しない\\ "nodisp" \>Cinderella画面上にも出力しない\\ @@ -866,6 +882,7 @@ C2p と C3p は表示さ\\れず,動かせない。 \end{verbatim} \input{Fig/bowdata2}\\ + \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \hypertarget{bspline}{} @@ -887,6 +904,8 @@ C2p と C3p は表示さ\\れず,動かせない。 \\ \input{Fig/checkbs2} \\ + 参照:\hyperlink{ospline}{Ospline:大島のスプラインを描く} \\ + \hypertarget{crspline}{} \item[関数] CRspline(名前,節点リスト,[オプション] ) \item[機能] 単独のCatmull-Rom スプライン曲線を描く @@ -1195,6 +1214,18 @@ Plotdata() と Lineplot() により,3次曲線と接線のプロットデー \input{Fig/hyper1}\\ +\hypertarget{ospline}{} +\item[関数] Ospline(名前,制御点リスト,[オプション] ) +\item[機能] 大島のspline曲線を描く +\item[説明] 制御点を通るスプライン曲線を描く\\ + リストの最初と最後が同じ場合は閉曲線になる。\\ + + +例:\verb|Ospline("1",[A,B,C,D,E]);| \verb|Ospline("1",[A,B,C,D,A]);|\\ + \input{Fig/ospline1} \input{Fig/ospline2} + \\ + 参照:\hyperlink{bspline}{Bspline:Bスプラインを描く} \\ + \hypertarget{parabolaplot}{} \item[関数] Parabolaplot(name,点リスト ,定義域, options) \item[機能] 点リスト[A,B,C]で示された焦点,準線で決まる放物線を描く。 @@ -1203,7 +1234,7 @@ Plotdata() と Lineplot() により,3次曲線と接線のプロットデー 例:点Aを焦点,直線BCを準線とする放物線を描く\\ \verb|Parabolaplot("1",[A,B,C]); |\\ - \verb|Parabolaplot("1",[A,B,C],"[-5,5]");| 定義域を $-5 \leqq x \leqq 5$ とする。\\ + \verb|Parabolaplot("1",[A,B,C],"[-5,5]");| 定義域を $-5 \leq x \leq 5$ とする。\\ 点(0,1)を焦点,直線$y=-1$を準線とする放物線を描く\\ \verb|Parabolaplot("1",[[0,1],[-1,-1],[1,-1]]);|\\ \\ @@ -1373,13 +1404,13 @@ Plotdata() と Lineplot() により,3次曲線と接線のプロットデー 1234567890123456789012345678901234\=\kill optionsの使用例\\ \verb|Listplot([A,B]);| \>線分ABを描く。太さはデフォルト。\\ - \verb|Listplot([C,D],["dr,2"]);| \>線分ABを描く。太さ2\\ - \verb|Listplot([E,F],["da"]);| \>線分ABを破線で描く\\ - \verb|Listplot([G,H],["da,3,1"]);| \>線分ABを破線で描く。線を長く\\ - \verb|Listplot([K,L],["da,1,3"]);| \>線分ABを破線で描く。間隔を空ける\\ - \verb|Listplot([M,N],["do"]);| \>線分ABを点線で描く。\\ - \verb|Listplot([O,P],["do,3"]);| \>線分ABを点線で描く。間隔を空ける\\ - \verb|Listplot([Q,R],["do,3,3"]);| \>線分ABを点線で描く。間隔を空けて太く\\ + \verb|Listplot([C,D],["dr,2"]);| \>線分CDを描く。太さ2\\ + \verb|Listplot([E,F],["da"]);| \>線分EFを破線で描く\\ + \verb|Listplot([G,H],["da,3,1"]);| \>線分GHを破線で描く。線を長く\\ + \verb|Listplot([K,L],["da,1,3"]);| \>線分KLを破線で描く。間隔を空ける\\ + \verb|Listplot([M,N],["do"]);| \>線分MNを点線で描く。\\ + \verb|Listplot([O,P],["do,3"]);| \>線分OPを点線で描く。間隔を空ける\\ + \verb|Listplot([Q,R],["do,3,3"]);| \>線分QRを点線で描く。間隔を空けて太く\\ 結果は次図左から。 \end{tabbing} \input{Fig/listplot3} @@ -1605,14 +1636,18 @@ optionsの使用例。左から,デフォルト,太線,破線,点線の "Dis=数値" \>値が指定数値以上ジャンプする場合は不連続点とみなす。\\ "Exc=数値リスト \>リストで示された点は除外する。\\ "Exc=関数" \>関数の零点は除外する。\\ + "Color=RGB" \>色指定。RGBはCMYKでもよい。\\ \end{tabbing} 例:2次関数 $f(x)=x^2-2x$ のグラフを定義域指定なしで描く。\\ \verb|Plotdata("1","x^2-2*x","x");|\\ \\ \input{Fig/plotdata1} \\ + \verb|Plotdata("1","x^2-2*x","x",["Color=[0,0,1]"]);|\\ + \\ + とすると赤で描かれる。\\ \\ - 例:三角関数 $2\sin \left(2x-\dfrac{\pi}{4} \right)$ のグラフを,定義域 $0 \leqq x \leqq 2 \pi$で描く。\\ + 例:三角関数 $2\sin \left(2x-\dfrac{\pi}{4} \right)$ のグラフを,定義域 $0 \leq x \leq 2 \pi$で描く。\\ \verb|Plotdata("3","2*sin(2*x-pi/4)","x=[0,2*pi]");|\\ \\ \input{Fig/plotdata2} @@ -1640,15 +1675,13 @@ optionsの使用例\\ 例:$f(x)=$tan$x$ のグラフは,そのままではあたかも漸近線が描かれたようになるが,これは,不連続点をそのまま結んでいるためである。 \begin{verbatim} - Deffun("f(x)", ["regional(y)","y=tan(x)","y"]); - Plotdata("1","f(x)","x",["Num=200","Dis=50"]); + Plotdata("1","tan(x)","x",["Num=200","Dis=50"]); \end{verbatim} で漸近線が描かれなくなる。\\ 例:ガウス記号 [$x$] で表される関数のグラフは,不連続な階段状になる。この関数は天井関数 floor()であるので, \begin{verbatim} - Deffun("f(x)", ["regional(y)","y=floor(x)","y"]); - Plotdata("1","f(x)","x",["Num=100","Dis=0.9"]); + Plotdata("1","floor(x)","x",["Num=100","Dis=0.9"]); \end{verbatim} できれいに描ける。\\ @@ -1844,6 +1877,7 @@ optionsの使用例\\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} + \hypertarget{translatepoint}{} \item[関数] Translatepoint(点 , 移動ベクトル) \item[機能] 点を平行移動する @@ -2062,7 +2096,7 @@ optionsの使用例\\ \item[説明] 曲線のリストは隣接する順番で指定する。プロットデータ名の頭部はjoin。\\ optionsは線種 "dr, n" , "da,m,n" , "do,m,n"\\ \\ -例:線分$y=x\ (-\sqrt{2} \leqq x \leqq \sqrt{2})$と半円を繋いで得られる閉曲線を描く。\\ +例:線分$y=x\ (-\sqrt{2} \leq x \leq \sqrt{2})$と半円を繋いで得られる閉曲線を描く。\\ \begin{verbatim} Plotdata("1","x","x=[-sqrt(2),sqrt(2)]"); Putpoint("B",[sqrt(2),sqrt(2)]); @@ -2132,8 +2166,7 @@ part2 の図 例3:放物線$y=x^2$が円で切り取られる部分を描く。 \begin{verbatim} Circledata([A,B]); - Deffun("f(x)",["regional(y)","y=x^2","y"]); - Plotdata("1","f(x)","x",["do"]); + Plotdata("1","x^2","x",["do"]); tmp3=Intersectcrvs("crAB","gr1"); Partcrv("2",tmp3_2,tmp3_1,"gr1",["dr,2"]); \end{verbatim} @@ -2150,24 +2183,13 @@ optionsは[$x$座標の範囲]。\\ 例:アステロイド上の動点P をとる。 \begin{verbatim} - Deffun("fx(t)", ["local(x)","x=2*cos(t)^3","x"]); - Deffun("fy(t)", ["local(y)","y=2*sin(t)^3","y"]); + Paramplot("1","[2*cos(t)^3,2*sin(t)^3]","t=[0,2*pi]"); + PutonCurve("P","gp1",[-1,1]); \end{verbatim} -で関数を定義し,\\ - \verb|Paramplot("1","[fx(t),fy(t)]","t=[0,2*pi]");|\\ -でアステロイドを表示する。プロットデータは gp1 となる。\\ -そこで\\ - \verb|PutonCurve("P","gp1",[-1,1]); |\\ -で$x$座標が $-1$ である点Pがアステロイド上にでき,この点はドラッグするとアステロイド上を $-1 \leqq x\leqq 1$ の範囲で動かすことができる。\\ +点Pがアステロイド上にでき,この点はドラッグするとアステロイド上を $-1 \leq x\leq 1$ の範囲で動かすことができる。\\ \input{Fig/putoncurve.tex} -なお\\ - \verb|fx(t):=2*cos(t)^3;|\\ -で関数を定義すると Scilab に関数定義情報が渡されないので\\ - \verb|Deffun("fx(t)", ["local(x)","x=2*cos(t)^3","x"]);|\\ -で f(x) を定義する必要がある。 - \\ \\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} @@ -2264,7 +2286,7 @@ optionsは[$x$座標の範囲]。\\ \begin{verbatim} Plotdata("1","x^2-1","x=[-sqrt(2),sqrt(2)]",["Num=100"]); Plotdata("2","x^2/2","x=[-sqrt(2),sqrt(2)]",["Num=100"]); - Shade(["gr2","gr1"],[0.2,"color->[1,0,0]","alpha->0.4"]); + Shade(["gr2","gr1"],[0.2,"Color=[1,0,0]","alpha->0.4"]); \end{verbatim} \begin{center} \input{Fig/shade01} @@ -2406,7 +2428,8 @@ optionsは[$x$座標の範囲]。\\ \item[機能] 表の枠を作成し,表のデータlist を返す \item[説明] Cinderellaの描画面上に左下を原点とする表を作成する。\\ 他の関数との引数の整合性,\ketpic のコマンドとの整合性などから,先頭にnameの引数をつけるが,実際にはあまり利用しないので,空文字""でもよい。\\ - optionsは線種と"notex"など。\\ + optionsは線種と"notex"など,および "Rng=n"。\\ + "Rng=n" をつけると,NE,SWによる出力領域指定が有効になる。つけない場合は,表の部分だけが出力される。\\ 縦横データには,次の2通りの書式がある。\\ \\ (1) 横のセル数 , 縦のセル数 , 表の横幅 , 表の縦幅 を指定する。\\ @@ -2438,11 +2461,9 @@ optionsは[$x$座標の範囲]。\\ 例:\verb|Tabledata("",Yoko,Tate,[]);|\\ \\ - Tabledata()関数は,制御点r0,r1,・・・,c0,c1,・・・ がなければ新しく作り,すでに存在する場合はそのままとする。したがって,一度表を作成したのち,行数・列数を修正して作り直す場合は,一度既存の点を消去する必要がある。そのためには,「すべての点を選択する」ツールをクリックして点を消去するのがよい。クリックすると,消去後すぐに新規作成される。\\ - すでに他の点を描画してしまった場合は,表示メニューの「式による表示」で一覧表を出して,制御点を選択して消去する。\\ - ただし,行数,列数が多すぎた場合は,必ずしも作り直す必要はない。Settable() 関数により,実際に書き出す表の範囲を指定できるからである。\\ - - なお,表を作成したときは,表の範囲が出力範囲として優先される(Tabledata()を実行したとき)ので,表外に図を描いた場合は,最後にこの関数で出力範囲を指定して書き出す。\\ + Tabledata()関数は,制御点r0,r1,・・・,c0,c1,・・・ がなければ新しく作り,すでに存在する場合はそのままとする。したがって,一度表を作成したのち,行数・列数を修正して作り直す場合は,一度既存の点を消去する必要がある。そのためには,「すべての点を選択する」ツールをクリックして点を消去するのがよい。クリックすると,消去後すぐに新規作成される。(誤って「すべての要素のを選択する」を選ばないこと)\\ + 他の点が描画されている場合は,表の部分だけドラッグで選択するか,表示メニューの「式による表示」で一覧表を出して,制御点を選択して消去する。\\ + ただし,行数,列数が多すぎた場合は,必ずしも作り直す必要はない。Settable() 関数により,実際に書き出す表の範囲を指定できる。\\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} @@ -2461,28 +2482,30 @@ optionsは[$x$座標の範囲]。\\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} -\hypertarget{tableseg}{} -\item[関数] Tableseg( 罫線リスト, 線種) -\item[機能] 罫線の線種を指定する -\item[説明] 罫線リストを与えて線種を指定する\\ - 罫線リストは,["r1c0c1","r4c2c4"] のように与える。\\ - 破線・点線にする場合は,Tabledata()であらかじめ除外しておく。\\ - - 例: \verb|Rmv=["r1c0c1","c3r0r1","c3r3r5","r4c2c4"];|\\ - \verb|Tabledata("",4,5,80,50,Rmv);|\\ - \verb|Tableseg(["r1c0c1","r4c2c4"],["da"]);|\\ - - \input{Fig/tableseg}\\ - - 注)R0,C0,・・は実際には表示されない\\ - \\ +%\hypertarget{tableseg}{} +%\item[関数] Tableseg( 罫線リスト, 線種) +%\item[機能] 罫線の線種を指定する +%\item[説明] 罫線リストを与えて線種を指定する\\ +% 罫線リストは,["r1c0c1","r4c2c4"] のように与える。\\ +% 破線・点線にする場合は,Tabledata()であらかじめ除外しておく。\\ + +% 例: \verb|Rmv=["r1c0c1","c3r0r1","c3r3r5","r4c2c4"];|\\ +% \verb|Tabledata("",4,5,80,50,Rmv);|\\ +% \verb|Tableseg(["r1c0c1","r4c2c4"],["da"]);|\\ +% +% \input{Fig/tableseg}\\ +% +% 注)R0,C0,・・は実際には表示されない\\ +% \\ \hypertarget{changetablestyle}{} \item[関数] ChangeTablestyle(罫線リスト, 変更オプション) \item[機能] Table の罫線の描画オプションを変更 -\item[説明] 罫線を部分的に指定して描画オプションを変更できる。\\ - \\ -例:\verb|ChangeTablestyle(["r0c0c3"],["da"]);| +\item[説明] 罫線の部分的に指定して描画オプションを変更できる。\\ \\ +例:\verb|ChangeTablestyle(["r0c0c3"],["da"]);| \\ + の実行により、r0の位置の横線がc0からc3まで破線に変わる。\\ + \verb|ChangeTablestyle(["c1r0r2"],["da"]);|\\ + の実行により、c1の位置の縦線がr0からr2まで破線に変わる。\\ \\ \hypertarget{findcell}{} \item[関数] Findcell(列番号, 行番号) @@ -2567,8 +2590,8 @@ optionsは[$x$座標の範囲]。\\ セルの中にグラフを描く例。実際には,セルの位置にグラフを描いているだけ。 \begin{verbatim} Tabledata("",3,3,120,90,["r1c0c3","r2c0c3"],["dr,2"]); - Tableseg(["r1c0c3"],["dr"]); - Tableseg(["r2c0c3"],["da"]); + ChangeTablestyle(["r1c0c3"],["dr"]); + ChangeTablestyle(["r2c0c3"],["da"]); Plotdata("1","(x-2)^2+1.5","x=[0.5,3.5]"); Plotdata("2","(x-6)^2+2","x=[4.5,7.5]"); Plotdata("3","(x-10)^2+2.5","x=[8.5,11.5]"); @@ -2583,9 +2606,8 @@ optionsは[$x$座標の範囲]。\\ \input{Fig/tablesample1}\\ \\ 注意:この例を実行するとわかるが,セルのサイズと文字サイズの関係などにより,Cinderellaの画面上と\TeX への書き出しは必ずしも同一にはならない。\\ - -\newpage - 例:増減表とグラフ\\ + \\ +例:増減表とグラフ\\ 関数の増減表とグラフを1つの表の中に入れた例。 \begin{verbatim} @@ -2613,6 +2635,31 @@ optionsは[$x$座標の範囲]。\\ Expr(Ptend(tr1),"nw-2","y=x-\sqrt{x}"); \end{verbatim} \input{Fig/tablesample2} + \\ + + 例:凹凸を含めた増減表 +\begin{verbatim} + Tabledata("",8,4,80,40,[]); + Putrowexpr(1,c,["x","\cdots","-1","\cdots","0","\cdots","1","\cdots"]); + Putrowexpr(2,c,["y`","+","+","+","0","-","-","-"]); + Putrowexpr(3,c,["y``","+","0","-","-","-","0","+"]); + Putrowexpr(4,c,["y","\nelarrow","\frac{1}{\sqrt{e}}","\nerarrow", + "1","\serarrow","\frac{1}{\sqrt{e}}","\selarrow"]); +\end{verbatim} + \input{Fig/zogen3}\\ + \\ + ここで,凹凸を示す矢印は,ketpic.sty で定義されているものである。 + + nelarrow,nerarrow,selarrow,serarrow,NELarrow,NERarrow,SELarrow,SERrarrow がある。\\ + + 先頭の ne,se で北東・南東(右上・右下)次の r,l は回転の向き(r:right:反時計回り,l:left:時計回り)の矢印(arrow)と覚えるとよい。 + + 直線系の矢印は\\ + NEarrow,SEarrrow\\ + 少しずつ違うので試されたい。 + + なお,これらの矢印はCindyTeXにはないので,Cinderellaの描画面には表示されない。 + \\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \hypertarget{settable}{} @@ -2815,7 +2862,7 @@ optionsは[$x$座標の範囲]。\\ \item[説明] 曲線は折れ線として描かれるが,曲線上の各点はこの折れ線の節点を基準としたパラメータ値を持つ。パラメータ値は整数部分が節点の番号,小数部分が節間の位置を表す。\\ 例:図のような点PからQに至る円周上の5等分点を節点とする折れ線sg1において, -$n$番目の線分上の点は$n\leqq t\leqq n+1$の範囲のパラメータ値を持つ。\\ +$n$番目の線分上の点は$n\leq t\leq n+1$の範囲のパラメータ値を持つ。\\ 図の点$\mathrm{A}$は2番目の線分上にあり,パラメータ値は2.45である。この値は\\ \verb|Paramoncrv(A.xy,"sg1");|\\ によって得られる。\\ @@ -3072,27 +3119,16 @@ Fhead のほか,ディレクトリ指定などのため,次のグローバ \end{verbatim} とすると,fig.tex を表示した pic.pdf が作成される。pic.pdf が目的のPDF。\\ Texparent は Fhead とは異なるものにする。\\ -(2) 出力は,「Parent」「Exekc」の順にボタンを押す。「Texview」は押さない。\\ - なお,これらのボタンを使わずにスクリプトで実行するか,オリジナルのボタンを作る場合は,次のコマンドを実行する。 -\begin{verbatim} - Writetosci(2); - Makeshell(); - kc(); -\end{verbatim} - Writetosci(2); と Makeshell(); で fig.sce とpic.tex が作成される。\\ - Windowsの場合は Makebat(); とする。\\ - \verb|kc();| により kc.sh が実行され,Scilabで fig.sceからfig.tex を作るところからPDF作成までの一連の作業が行われる。\\ +(2) 出力は,「Parent」のボタンを押す。\\ \\ optionは,マージン(余白)と平行移動量。指定しない場合はデフォルト値。\\ -引数が1つの実数の場合は,左右上下同一の指定した余白となる。\\ -引数が4つの数をコンマで区切った文字列を要素とするリストの場合,左右上下の余白指定となる。\\ -引数が2つの数をコンマで区切った文字列を要素とするリストの場合,右,下方向への平行移動指定となる。\\ +余白は,左右上下の順に4つの数をコンマで区切る。。\\ +平行移動量は,右方向,下方向をリストで与える。\\ 余白指定と平行移動指定は同時に行うことができる。\\ -例: \verb|Figpdf(10);| 上下左右10mmの余白\\ - \verb|Figpdf(["5,5,10,10"]);| 左右に5mm,上下10mmの余白\\ - \verb|Figpdf(["5,10"]);| 右に5mm,下に10mm平行移動して表示\\ - \verb|Figpdf(["5,8,10,10","5,-5"]);| 左5mm,右8mm,上下10mmの余白,\\ - 右に5mm,上に5mm平行移動して表示\\ +例:\verb|Figpdf([5,5,10,10]);| 左右に5mm,上下10mmの余白\\ + \verb|Figpdf([5,10]);| 右に5mm,下に10mm平行移動して表示\\ + \verb|Figpdf([5,8,10,10,[5,-5]]);| 左5mm,右8mm,上下10mmの余白,\\ + 右に5mm,上に5mm平行移動して表示\\ なお,座標軸を表示する場合,右側は最低3mmの余白を設定しないと軸の文字が入らない。\\ \hypertarget{texcom}{} @@ -3264,13 +3300,13 @@ Rは主に統計解析のためのソフトウェアで, binorm(二項分 Boxplot("1",dt1,1,1/2); \end{verbatim} \\ - 複数列から成るcsvファイルを読み込むには,Readcsvを使う。読み込んだファイルは,Readcsv()で指定した名前のリストに入る。(頭部はrc)\\ + 複数列から成るcsvファイルを読み込むには,Readcsvを使う。csvファイルは,ketworkフォルダに入れておく。戻り値は読み込んだファイル。\\ データの値を画面に入るように調節するには,次のようにリストの計算を利用すればよい。\\ また,Framedata2(),Rulerscale() を併用することで目盛を入れることができる。Framedata2() のために,表示領域の対角点A,BをCinderellaの作図ツールで作図しておく。\\ \begin{verbatim} - Readcsv("1","datafile.csv"); - dt1=apply(rc1,#_1); - dt2=apply(rc1,#_2); + data=Readcsv("datafile.csv"); + dt1=apply(data,#_1); + dt2=apply(data,#_2); Boxplot("1",dt1/20,1,1/2); Boxplot("2",dt2/20,3,1/2); Framedata2("1",[A,B]); @@ -3371,8 +3407,8 @@ Rは主に統計解析のためのソフトウェアで, binorm(二項分 Addax(0); Setscaling(5); Setunitlen("0.6mm"); - Readcsv("1","datafile.csv",[""]); - Histplot("1",dt1,[""]); + data=Readcsv("datafile.csv"); + Histplot("1",data,[""]); Framedata2("1",[A,B]); Rulerscale(A,["r",0,100,10],["r",0,15,5]); \end{verbatim} @@ -3424,7 +3460,7 @@ Aはグラフ上を動かすことができて,Bはそれに伴って動く。 tmp2=Colorcmyk2rgb(tmp1); Setcolor(tmp1); Setcolor([0.2,0,0,0]); - Shade(["en1"],["color->"+text(tmp2)]); + Shade(["en1"],["Color="+text(tmp2)]); Setcolor("black"); PlotdataR("1","dnorm(x)","x=[-5,5]",["Num=100"]); Putpoint("A",[0,0],[A.x,0]); @@ -3473,9 +3509,13 @@ PlotdiscR("3","dgeom(k,0.3)","k=[0,10]"); \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \hypertarget{readcsv}{} -\item[関数] Readcsv(name,filename,option) +\item[関数] Readcsv(path,filename,option) \item[機能] Rを利用してcsvファイルを読む。 -\item[説明] Rを使ってcsvファイルを読み,KeTCindyに引き渡す。\\ +\item[説明] Rを使ってcsvファイルを読みこむ。戻り値は読み込んだデータのリスト。\\ +第1引数の path は,ファイルを ketwork フォルダに置いた場合は省略することができる。そうでない場合は,フルパスで指定する。たとえば,"/Users/Hoge/Desktop"\\ +option は,"Flat=" で,"Flat=y" の場合は,読み込んだデータをリスト化したときに平滑化(1次元のリスト)にする。デフォルトは "Flat=n"\\ +また,Rを使わずScilabを使って読み込むこともできる。その場合は,optionに"Use=S" をつけるが,Macで作成したファイルで,改行コードがCRのみの場合はうまく読み込むことができない。Windows標準のCR+LFなら読み込める。 + 利用例は Boxplot() などの例を参照のこと。\\ \\ @@ -3608,6 +3648,7 @@ Maximaでその処理を行うコマンドを定義し,CalbyMで実行する \input{Fig/maxfun02}\\ \\ cmdLで定義しているMaximaのコマンド(trigsimp など)については,Maximaの解説書などを参照されたい。\\ +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \\ \hypertarget{example}{} \item[関数] Example("Mxfun",文字) @@ -3631,6 +3672,7 @@ Maximaでその処理を行うコマンドを定義し,CalbyMで実行する CalcbyM("ret",cmdL,[]); \end{verbatim} とする。(Concat() はリストを結合するCindyscriptの関数)\\ +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \\ \hypertarget{mxfun}{} @@ -3727,6 +3769,7 @@ Mxtex() を用いて,Mxfun()の結果の mx1をTeX書式にして表示する (%e^a-%e^-a)/2*(x-a)+((exp(a)+exp(-a))/2) \end{verbatim} が表示される。\\ +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \\ \hypertarget{mxtex}{} @@ -3884,6 +3927,7 @@ Cindyscriptの文字列の関数 replace を用いて,\\ \end{description} \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} + \newpage % FriCASとの連携 ================================== \subsection{FriCAS(Axiom)との連携} @@ -3909,39 +3953,210 @@ Cindyscriptの文字列の関数 replace を用いて,\\ \begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} \newpage + +% MeshLabとの連携 ================================== +\subsection{MeshLabとの連携} + +MeshLabは,3Dデータ(objデータなど)を読み込んでレイトレーシングで表示・編集するソフトウェアである。レイトレーシングで3Dグラフィクスを描くには,Cinderellaと親和性の高い Cindy3D を利用するのがよいが,MeshLabを使うメリットは3Dプリンタ用のSTLファイルを出力できることである。また,KeTCindyで描いた3Dの図がレイトレーシングでどのようになるのかを見ることも比較的簡単にできる。\\ + MeshLabとの連携は,KeTCindyから Obj 形式のデータを書き出すことで行う。Mkobj**() 関数でデータを作り,Mkviewobj() 関数でMeshLabを呼び出して表示を行う。\\ + なお,Mkviewobj() 関数でMeshLabを呼び出して表示を行う場合,これをDrawスロットに書くと頻繁に呼び出しが行われるため非効率となる。そこで,if(1==0,・・・) で・・・の部分にMeshLabの呼び出し関係のスクリプトを書いて,実際に呼び出すときに if(1==1,・・・)とする方法と,呼び出し関係のスクリプトを関数化してボタンに割り当てる方法がある。ketcindyパッケージに含まれる sample にボタンをつけたものがある。\\ + なお,3Dであるので,Initialization スロットに\\ + \verb|Ketinit();| + \verb|Ketinit3d();| +を記述しておく。 + +\begin{description} + +\hypertarget{mkobjcmd}{} +\item[関数] Mkobjcmd(name,式,option) +\item[機能] 厚みを持たない曲面のobjファイルのためのコマンドを作成する +\item[説明] オプションは [分割数1,分割数2,表側の方向の指定]\\ +表側の方向は,変数に対して,右手系の方向が"+"\\ +作成されるデータは"oc"+name のファイル名の obj データである。この名称は,Mkviewobj() で用いる。(以下,Mkobj**()関数では同様)\\ +\\ +【例】:サドル面 +\begin{verbatim} + fd=[ "z=x^2-y^2", "x=[-1,1]","y=[-1,1]"," "]; + Sf3data("1",fd); + Windispg(); + Mkobjcmd("1",fd,[40,40,"-"]); + Meshlab():=( + Mkviewobj("saddle",oc1, ["m","v"]); + ); +\end{verbatim} +このうち,\verb|Sf3data("1",fd); | はCinderellaの画面に表示するためであって,なくてもよい。 +次図で,左が option + の場合,右が - の場合である。\\ +\includegraphics[bb=0 0 1359 527 , width=12cm]{Fig3d/meshlab01.png} + \\ +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} + +\hypertarget{mkobjcrvcmd}{} +\item[関数] Mkobjcrvcmd(name,PD,option) +\item[機能] 空間曲線(直線)のobjファイルのためのコマンドを作成 +\item[説明] オプションは [太さ,断面の形状(正多角形)の辺の数,断面の正面]\\ +曲線は紐のようなもので表す。その断面は正多角形で,デフォルトは正6角形である。断面の正面は"xy","yz","zx"のいずれかで指定する。太くなった時に形状の差が現れる。 + +例 太さ0.03で螺旋を描く +\begin{verbatim} + Spacecurve("1","[(6*pi-t)/(6*pi)*cos(t),(6*pi-t)/(6*pi)*sin(t),0.1*t]", + "t=[0,6*pi]",["Num=200"]); + Windispg(); + Mkobjcrvcmd("1","sc3d1",[0.03]); + Meshlab():=( + Mkviewobj("spiral",oc1,["m","v"]); + ); +\end{verbatim} + +\verb| Mkobjcrvcmd("1","sc3d1",[0.1,8,"yz"]);| としたのが下図右。\\ + + \includegraphics[bb=0 0 1229 473 , width=12cm]{Fig3d/meshlab02.png}\\ +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} + +\hypertarget{mkobjnrm}{} +\item[関数] Mkobjnrm(name,式) +\item[機能] 法線ベクトルのデータを作成 +\item[説明] 式は曲面を表す式。これに対し,法線ベクトルを表す式を求める。\\ + +\hypertarget{mkobjplatecmd}{} +\item[関数] Mkobjplatecmd(name,面データ,options) +\item[機能] 面を描く +\item[説明] 面データを渡して面を描く。\\ +options は,面の厚みの指定。厚みは中心線に対し,両側につけることができる。\\ +たとえば,[0.05] はプラス側に 0.05 の厚み,[0.05,-0.04] はマイナス側にも0.04の厚みをつける。\\ + +【例】三角形のプレートを描く +\begin{verbatim} + Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]"); + p1=[2,0,0]; + p2=[0,2,0]; + p3=[0,0,2]; + plane=[[p1,p2,p3],[[1,2,3]]]; + Mkobjplatecmd("1",plane,[0.05]); + Mkobjcrvcmd("2","ax3d"); + Mkviewobj("plane",Concatcmd([oc1,oc2]),["m","v"]); + \end{verbatim} + \includegraphics[bb=0 0 574 456 , width=5cm]{Fig3d/meshlab03.png}\\ + + +\hypertarget{mkobjpolycmd}{} +\item[関数] Mkobjpolycmd(name,PD,options) +\item[機能] 多面体を描く +\item[説明] VertexEdgeFace() の戻り値を PDとして渡して多面体を描く。\\ + + + +\hypertarget{mkobjsymbcmd}{} +\item[関数] Mkobjsymbcmd(PD, 実数,実数,ベクトル, ベクトル) +\item[機能] 文字等のobjデータのためのコマンドを作成 +\item[説明] 引数のPDを描く。第2引数は大きさ,第3引数は回転角,第4引数は正面方向のベクトル,第5引数はPDの中心の位置。\\ +PDは,平面の描画コマンドによるプロットデータが使える。また,PD に半角アルファベットを文字として与えることができる。この場合,文字は n,p,q,r,t,x,y,z で,該当するフォントが data フォルダの fontF フォルダに用意されている。この中にないフォントは使えない。 \\ +【例】軸の名前 x,y,z を表示し,円を描く。\\ +円は Circledata(); でプロットデータを作成する。\\ +\begin{verbatim} +\end{verbatim} + + +\hypertarget{mkobjthickcmd}{} +\item[関数] Mkobjthickcmd(name,式) +\item[機能] 厚みを持つ曲面のobjファイルのためのコマンドを作成 +\item[説明] オプションは [分割数1,分割数2,厚み,表側の方向の指定,条件] +表側の方向は,変数に対して,右手系の方向が"+"。厚みを持つため,nsew のそれぞれについて, +"+n+s-e-w" のように指定する。\\ +条件として,\verb|"Assume(R>0)"| をつけると,Rが0以下になるための不具合を回避できる。\\ +また,"ratsimp" をつけると有理関数について,"trigsimp"をつけると三角関数について,処理を速くすることができる。 +なお,この関数はMaximaを使うので,Maximaをインストールしていることが前提。\\ +【例】回転放物線 +\begin{verbatim} + fd=[ + "z=(x^2+y^2)", + "x=R*cos(T)","y=R*sin(T)", + "R=[0,2]","T=[0,2*pi]","e" + ]; + Mkobjthickcmd("1",fd,[40,40,0.2,"+n+s-e-w+","assume(R>0)"]); + Mkviewobj("pala",oc1,["m","v","Wait=5"]); +\end{verbatim} + \includegraphics[bb=0 0 574 378 , width=5cm]{Fig3d/meshlab06.png}\\ + +\hypertarget{mkviewobj}{} +\item[関数] Mkviewobj(name,PD, options) +\item[機能] objファイルを作成。optionにより MeshLab を立ち上げて表示する。 +\item[説明] 第2引数に複数のプロットデータを与えるときは,Concatcmd() により1つにまとめる。 +オプションは +\begin{tabbing} +12345678901234567890\=\kill + "m"または"make" \> データを作る(指定しない場合もデータがなければ作る)\\ + "v"または"view" \>MeshLabを立ち上げて表示する\\ + "W=n" \>作成するための待ち時間。n秒。これを過ぎると終了する\\ + "Unit=mm" \>Setunitlen()と連動して3Dプリンタの数値の単位をmmで指定する\\ + \>3Dプリンターがインチで認識する場合は "Unit=in" とする。\\ +\end{tabbing} + + +\end{description} +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} + +\newpage % 表計算ソフトとの連携 ================================== \subsection{表計算ソフトとの連携} - 表計算ソフトでは,複数のセルを選択してコピー(Windowsでは Crtl+ C ,Macでは Command+C)すると,セルの内容はtab区切りのテキストデータとしてクリップボードにコピーされる。これをCindyscriptエディタにペーストすることで表計算ソフトのデータをKeTCindyで利用できる。逆に,Cindyscriptのコンソールへの出力を表計算ソフトのシートにコピーすることもできる。 +表計算ソフトでは,複数のセルを選択してコピー(Windowsでは Crtl+ C ,Macでは Command+C)すると,セルの内容はtab区切りのテキストデータとしてクリップボードにコピーされる。これをCindyscriptエディタにペーストすることで表計算ソフトのデータをKeTCindyで利用できる。逆に,Cindyscriptのコンソールへの出力を表計算ソフトのシートにコピーすることもできる。 + +また,表計算ソフトから書き出したCSVファイルについても同様にしてCSV形式のデータを扱うことができる。 \begin{description} \hypertarget{tab2list}{} \item[関数] Tab2list(str,option) \item[機能] str の内容をリストに変換する -\item[説明] tab区切りになっている文字列 str をリストに変換する。\\ - optionは,NULLのセルの置き換え。リストで表す。デフォルトは[0]。\\ -次のような手順で表計算ソフトからデータをKeTCindyに写すことができる。\\ - \\ -(1) 表計算ソフトで,適当な範囲を指定しクリップボードにコピーする。\\ - Windowsなら Ctrl+C,Macなら Command+C\\ - \\ -\includegraphics[bb=0 0 742 308 , width=8cm]{Fig/tab2list01.png}\\ +\item[説明] tabやコンマ区切りになっている文字列 str をリストに変換する。\\ + optionは,次の通り。\\ + Blank=a :NULLのセルをaに置き換える。\\ + Sep=b :セパレータ(区切り文字)を b とする。デフォルトは tabコード\\ + +次のような手順で表計算ソフトやCSVファイルからデータをKeTCindyに移すことができる。\\ \\ -(2) Cindyscriptエディタで,適当な文字変数を用意する。\\ +(1) Cindyscriptエディタで,適当な文字変数を用意する。\\ たとえば,data="";\\ \\ \includegraphics[bb=0 0 858 298 , width=10cm]{Fig/tab2list02.png}\\ \\ -(3) ここにペーストすると,文字列にコピーされる。\\ - もし,右のようになったら(表計算ソフトによります)左のように,最後の "" の前で改行しておく。\\ +(2) 表計算ソフトで,適当な範囲を指定しクリップボードにコピーする。\\ + Windowsなら Ctrl+C,Macなら Command+C\\ \\ -\includegraphics[bb=0 0 748 276 , width=6cm]{Fig/tab2list001.png} \includegraphics[bb=0 0 738 236 , width=6cm]{Fig/tab2list00.png}\\ - +\includegraphics[bb=0 0 742 308 , width=8cm]{Fig/tab2list01.png}\\ + \\ +(3) data=""; のダブルクウォートの間にペーストする。\\ + 最後の行は右図のように," の前で改行されていてもよい。\\ + \\ +\includegraphics[bb=0 0 738 236 , width=6cm]{Fig/tab2list00.png} + \includegraphics[bb=0 0 748 276 , width=6cm]{Fig/tab2list001.png}\\ \\ (4) この文字変数 data に対し,Tab2list(data) を実行すると,行列を表すリストが返される。\\ これを適当な変数に代入し,作表コマンドで表にするなど,目的に応じて利用する。\\ 数値だけなら行列として計算もできる。\\ + \\ +\includegraphics[bb=0 0 1245 457 , width=10cm]{Fig/tab2list03.png}\\ + \\ + 空文字のセル(NULL)が含まれる場合,デフォルトではそのまま空文字になるが,アンケート処理などで無回答を0にしたいような場合は\\ \\ -\includegraphics[bb=0 0 1245 457 , width=10cm]{Fig/tab2list03.png} + \verb|dlist=Tab2list(data,["Blank=0"];|\\ + \\ + とする。\\ + + CSVファイルからCSV形式(コンマ区切り)のデータをコピーした場合は\\ + \\ + \verb|dlist=Tab2list(data,["Sep=,"];|\\ + \\ + とする。\\ + + なお,文字列をセパレータで区切ってリスト化するCindyscriptの関数に tokenize()がある。上の例で,\\ + \verb|dlist=tokenize(data,[unicode("000a"),unicode("0009")]);|\\ + とすると,改行コード(000a)とtabコード(0009)で切り分けてリスト化する。このとき,リストの各要素はつぎのようになる。\\ + 文字列→文字列\\ + 数値形式の文字→実数 例: 14 → 整数14 12.3 → 実数12.3\\ + 計算式の形 → 文字列 例: 437-0023 → 437-0023 (文字列)\\ +これに対し,Tab2list()では,計算式の形の文字列は数値と見なして計算結果を取得する。\\ + 例: 437-0023 → 414 (数値)\\ +したがって,郵便番号や日付(28/12/5)のようなものは計算されてしまうので,tokenize() を用いるのがよい。なお,tokenize()の場合,空行は空リストになるので,最後の行でダブルクウォートの前で改行されていると空リストが入るので注意されたい。\\ + \hypertarget{dispmat}{} \item[関数] Dispmat(list) @@ -3950,51 +4165,64 @@ Cindyscriptの文字列の関数 replace を用いて,\\ 実際にはTAB区切りの文字列。(println としなくても直接コンソールに表示される)\\ これを表計算ソフトのシートにコピーする。\\ \\ -\includegraphics[bb=0 0 855 395 , width=8cm]{Fig/tab2list04.png}\ +\includegraphics[bb=0 0 855 395 , width=8cm]{Fig/tab2list04.png}\\ +\\ + +\hypertarget{writecsv}{} +\item[関数] Writecsv(namelist, data, filename, option) +\item[機能] data の内容をCSVファイルに出力する +\item[説明] ベクトルまたは行列となっている data を、filenameのファイル名としてCSVファイルに書き出す。\\ + optionは,次の通り。(省略できる)\\ + Col=nn :自然数nnで指定した列数のCSVファイルとして書き出す。\\ + namelistは,CSVファイルの1行目に追加される項目名。省略すると"C1,C2,..."という項目名が付く。\\ + + なお,列数の指定を省略するとdataが行列の場合は、その列数をdataがベクトルの場合はnamelistの項目数を利用する。 \end{description} + +\begin{flushright} \hyperlink{functionlist}{$\Rightarrow$関数一覧}\end{flushright} + \newpage % MeshLabとの連携 ================================== %\subsection{MeshLabとの連携} % アニメーション ================================== -\section{アニメーションPDF:KeTCindymv} +\section{アニメーションPDF} \subsection{概要} アニメーションのできるPDFを作る。 Cinderellaの作図機能とCindyscriptを用いてアニメーションができるが,PDFにすることでCinderellaがなくてもPDFビュアーがあればアニメーションを実行できるので,プレゼンテーションや教材の受け渡しなどに便利である。 -KeTCindymvの画面は次のようになっている。(templatemv.cdy)\\ +次の画面は,samplesフォルダにある「s06animation」の「s0601cycloid」のものである。\\ \\ - \includegraphics[bb=0 0 1594 710 , width=12cm]{Figmv/mvgaiyou01.png} + \includegraphics[bb=0 0 1581 880 , width=12cm]{Figmv/mvgaiyou01.png} 画面上方のボタンには,次のようなスクリプトが割り当てられているので,ボタンを自作することもできる。 \begin{tabbing} - 12345678978\=1234567897890123\=\kill - Texview \>: Viewtex(); \>現在の画面のPDFデータを作る\\ - TexMv \>: Texmovie(); \>アニメーションPDFデータを作る\\ - Texpara \>: Texpara(); \>フレームに分割したPDFデータを作る\\ - Exekc \>: kc(); \>バッチファイルを実行する + 12345678\=1234567897890123456\=\kill + Figure \>: Viewtex(); \>現在の画面のPDFデータを作る\\ + Parent \>: \>Figpdf() を使うときに使用する。\\ + ParaF \>: Parafolder(); \>パラパラ動画のデータを作る\\ + Anime \>: Mkanimation(); \>アニメーションPDFを作る\\ + Flip \>: Mkflipanime(); \>パラパラ動画PDFを作る \end{tabbing} -アニメーションの作成は,フレームを定義する関数を作成し,Moviedata() 関数を実行する。実行後,TexMv,Exekc のボタンを順に押すことで,Fhead+"moviefigs.tex" と Fhead+"moviemain.tex",Fhead+"moviemain.pdf" が生成されて表示される。たとえば,Fhead が "abc" の場合,TeX の文書には\\ - \verb|\input{abcmoviefigs.tex}|\\ -で動画を挿入することができる。 - -ただし,動画のできるPDFを作成するには,ドキュメントクラスと使用パッケージについて注意が必要である。 - -ドキュメントクラスは,article または jarticle とする。jsarticle は使えない。 +アニメーションの作成は,フレームを定義する関数を作成し,Mkanimation() 関数を実行する(Animeボタン)。 +%たとえば,Fhead が "hoge" の場合,TeX の文書には\\ +% \verb|\input{hogemoviefigs.tex}|\\ +%で動画を挿入することができる。 -パッケージは animate に dvipdfmx オプションをつける。\\ - \verb|\usepackage[dvipdfmx]{animate}| +%ただし,動画のできるPDFを作成するには,ドキュメントクラスと使用パッケージについて注意が必要である。 -また,アニメーションPDFでアニメーションを行うにはAdobe Acrobat Reader など,アニメーションに対応したPDFリーダーが必要である。WindowsのSumatraPDF,Macの プレビューでは動かない。\\ +%ドキュメントクラスは,article または jarticle とする。jsarticle は使えない。 -次に,Texpara,Exekc のボタンを順に押すことで,フレームに分割した Fhead+"parafigs.tex" と Fhead+"paramain.tex" ,Fhead+"paramain.pdf" が生成されて表示される。この図を利用するにはパッケージの指定がやや面倒である。 Fhead+"mvparamain.tex" を参照されたい。 \\ +%パッケージは animate に dvipdfmx オプションをつける。\\ +% \verb|\usepackage[dvipdfmx]{animate}| -画面下方のスライダによりアニメーションの途中図を描くことができる。Texview と Exekc ボタンによりその図のファイルが作成される。 +なお,アニメーションPDFでアニメーションを行うにはAdobe Acrobat Reader など,アニメーションに対応したPDFリーダーが必要である。WindowsのSumatraPDF,Macの プレビューでは動かない。 +Flipボタンを押すと,フレームに分割したPDFが生成されて表示される。 \subsection{設定} KeTCindymvでは,KeTCindyと若干異なる設定が必要である。 @@ -4028,7 +4256,7 @@ KeTCindymvでは,KeTCindyと若干異なる設定が必要である。 \item[説明] str1 はアニメーションを定義する関数名を文字列とする。str2 は定義域。\\ optionsは,Cut と Div \\ Cut : 1秒のフレーム数。初期値は20。\\ - Civ : 全体のフレーム数。初期値は80。\\ + Div : 全体のフレーム数。初期値は80。\\ したがって,初期値では4秒間のアニメーションとなる。\\ \\ 【例】定円上を動く点Pと,定点Aを結ぶ線分の中点をQとして動きを見る。\\ @@ -4083,6 +4311,12 @@ TexMvボタン または TexParaボタンを押すと画面上でもアニメー \end{verbatim} \begin{flushright} \hyperlink{functionlist3d}{$\Rightarrow$関数一覧}\end{flushright} +\hypertarget{setpara}{} +\item[関数] Setpara(str) +\item[機能] parapa のタイトルを指定する +\item[説明] パラパラ動画のタイトルを str にする。デフォルトは Fhead。\\ + "" にした場合はタイトルを表示しない。 + \end{description} \newpage @@ -4126,11 +4360,12 @@ KeTCindy3Dでは,点・直線・曲線・面の描画を描画関数を用い \\ \hypertarget{start3d}{} -\item[関数] Start3d() +\item[関数] Start3d(option) \item[機能] 3Dの画面設定と空間点の認識 \item[説明] 副画面を作り,幾何点を3Dの点として認識する。この関数は必須で,Drawスロットのはじめの方に置く。\\ Cinderellaの作図ツールで,点・線分を作図すると,内部関数の Ptseg3data() によってそれらを空間の点として認識し,副画面上に対応する点をとる。ただし,始めはz座標を0とする。点の名前がAであれば,副画面上の点はAzとなる。点をポイントして選択すると副画面の上に座標が表示される。\\ 作図した点の名称をインスペクタで変更した場合,新しい名称に対応する点を副画面上に作成するが,以前の点は消えないので要注意。たとえば,点Aを作図した後,主画面上の点Aをインスペクタで点Dに変えた場合,副画面上に新たにDzができるが,以前のAzも残る。残ったAzは,選択しておいて作図ツールの消去ボタン \includegraphics[bb=0 0 27 21 , width=0.6cm]{Cindytool/delete.png}で消すことができる。\\ + optionに,除外点のリストを与えると,その点は空間点としない。(始点を移動しても位置は変わらない)\\ \begin{flushright} \hyperlink{functionlist3d}{$\Rightarrow$関数一覧}\end{flushright} \end{description} @@ -4732,10 +4967,14 @@ options として,中心点(vecの始点),線種を指定することが \item[関数] Sf3data(name,リスト,options) \item[機能] 陰線処理なしの曲面をワイヤーフレームモデルで描く \item[説明] リストは,関数式と定義域,境界指定をそれぞれ文字列にしたもののリスト。\\ -optionsは,解像度(各変数に対応する分割数)とメッシュの密度(縦横)。\\ +optionsは,解像度(各変数に対応する分割数)とメッシュの密度,境界指定。\\ 解像度は,"Num=[a,b]" で指定。初期値はa,bとも25\\ -メッシュ密度は,"Wire=[a,b]" で指定。初期値はa,bとも20\\ -境界の指定は"ewsn"で行う。\\ +メッシュ密度は,縦横で "Wire=[a,b]" で指定。初期値はa,bとも20\\ +境界指定は"ewsn"で行う。"ewsn" の意味は次のように考える。\\ + 変数が u,v のとき,u,v平面において,$a \leq u \leq b,c \leq v \leq d$ の矩形を考え,\\ + その東西南北(ewsn)の境界を示す。\\ + \input{Fig/ewsn}\\ + \\ 関数式のパターンはつぎの3通り。\\ \\ (1) $z=f(x,y)$\\ @@ -4774,7 +5013,7 @@ optionsは,解像度(各変数に対応する分割数)とメッシュの \item[関数] Sfbdparadata(name,式,options1,options2) \item[機能] 空間曲面の陰線処理 \item[説明] 曲面について陰線処理を行う。 - 曲面の式はSf3data()の場合と同じ。ただし,(2) と(3)のパターンでは式の最後に境界の指定 ewns を明示する必要がある。(3)では境界の指定を" "(中は半角スペース)とする。省略すると不要な境界線が表示されることがある。\\ + 曲面の式はSf3data()の場合と同じ。ただし,(2) と(3)のパターンでは式の最後に境界の指定 ewns を明示する必要がある。(3)では境界の指定を" "(中は半角スペース)とする。省略すると不要な境界線が表示されることがある。境界指定については,Sf3data()の項を参照のこと。\\ options1は,"Wait=n","r","m",線種。Wait の初期値は30。\\ "r","m"に関しては,オプションなしまたは,”” のとき\\ i) データファイルがなければ,新しく作る\\ @@ -4847,6 +5086,13 @@ options2は,陰線に関するoptionで,"nodisp" または 線種。"nodisp" \begin{flushright} \hyperlink{functionlist3d}{$\Rightarrow$関数一覧}\end{flushright} +\hypertarget{skeletondatacindy}{} +\item[関数] Skeletondatacindy(name,PDリスト,PDリスト,option) +\item[機能] 陰線処理(スケルトン処理)をCindyscriptでおこなう +\item[説明] 描画されている線と軸について陰線処理をおこなう。\\ + Scilabを呼ばず,Cindyscriptだけで行うので,多面体などでインタラクティブに図を動かすことができる。ただし,曲線では処理が遅くなる。\\ + + \hypertarget{spacecurve}{} \item[関数] Spacecurve(name,式,定義域,options) \item[機能] 空間曲線を描く @@ -4905,7 +5151,7 @@ options2は,陰線に関するoptionで,"nodisp" または 線種。"nodisp" \begin{flushright} \hyperlink{functionlist3d}{$\Rightarrow$関数一覧}\end{flushright} \hypertarget{vertexedgeface}{} -\item[関数] VertexEdgeFace(面データ,options) +\item[関数] VertexEdgeFace(name,面データ,options) \item[機能] 多面体の面データを用いて多面体を描く \item[説明] 面データは,頂点リストと,面リストからなる。面リストは,各面を構成する頂点を,外側から見て反時計回り(左回り)に並べたリストである。\\ たとえば,四面体ABCDの面データは,[[A,B,C,D],[[1,2,3],[1,2,4],[1,3,4],[2,3,4]]] となる。\\ @@ -5622,6 +5868,7 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 \hyperlink{setscaling}{Setscaling(数)} \>縦方向の倍率を設定する\\ \hyperlink{setunitlen}{Setunitlen(数)} \>単位長を設定する\\ \hyperlink{setwindow}{Setwindow()} \>描画領域を設定する\\ +\hyperlink{slider}{Slider()} \>スライダを作る\\ \\ 【描画】\\ \hyperlink{anglemark}{Anglemark(点リスト, options)} \>角の印を入れる\\ @@ -5663,6 +5910,7 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 \hyperlink{mkcircle}{Mkcircle()} \>幾何円のすべてのPD を作成する\\ \hyperlink{mksegments}{Mksegments()} \> 幾何線分のすべてのPD を作成する\\ \hyperlink{ovaldata}{Ovaldata(name, 点リスト,optionss)} \>角を丸くした矩形を描く\\ +\hyperlink{ospline}{Ospline(リスト,リスト,options )} \>大島のスプライン曲線を描く\\ \hyperlink{parabolaplot}{Parabolaplot(name,list,str,options)} \>放物線を描く\\ \hyperlink{parabolaplot}{Parabolaplot(name,点リスト,options)} \>楕円を描く\\ \hyperlink{paramark}{Paramark(点リスト,options)} \>角の印を入れる\\ @@ -5697,7 +5945,6 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 【作表】\\ \hyperlink{tabledata}{Tabledata("" , 縦横 ,除外 , options)} \>表の枠を作成する\\ \hyperlink{tabledatalight}{Tabledatalight("" , 縦横 ,除外 , options)} \>幾何点を持たない表の枠を作成する\\ -\hyperlink{tableseg}{Tableseg( 罫線リスト, 線種) } \>罫線の線種を指定する\\ \hyperlink{changetablestyle}{ChangeTablestyle(罫線リスト, options)} \>Table の罫線の描画オプションを変更する。\\ \hyperlink{findcell}{Findcell(列番号, 行番号)} \>セルの情報listを返す\\ \hyperlink{putcell}{Putcell (列番号, 行番号, 位置, 文字)} \>セルに文字列を入れる\\ @@ -5753,7 +6000,7 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 \hyperlink{help}{Help(str)} \>コマンドヘルプを表示する\\ \hyperlink{helpkey}{Helpkey(str)} \>キーワードで関数を検索する\\ \hyperlink{help}{Ketcindylogo()} \>\ketcindy のロゴを書き出す\\ -\hyperlink{indexall}{Indexofall(str1,str2)} \>文字列 str1 から str2 を検索しその位置をすべて返す\\ +\hyperlink{indexall}{Indexall(str1,str2)} \>文字列 str1 から str2 を検索しその位置をすべて返す\\ \hyperlink{op}{Op(n,list)} \> リストまたは文字列から要素を抜き出す\\ \hyperlink{texcom}{Texcom(コード)} \>\TeX のコードを書き出す\\ \hyperlink{windispg}{Windispg()} \>定義されたプロットデータを描画面に描く\\ @@ -5782,11 +6029,22 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 \hyperlink{calcbyF}{CalcbyF(name,リスト,option)} \>FriCASのスクリプトを実行する\\ \hyperlink{frfun}{Frfun(name,式,リスト,option)} \>FriCASの関数を実行する\\ \\ -【表計算ソフトとの連携】 +【MeshLabとの連携】\\ +\hyperlink{mkobjcmd}{Mkobjcmd(name,式,option)} \>厚みを持たない曲面のコマンドを作成\\ +\hyperlink{mkobjcrvcmd}{Mkobjcrvcmd(name,PD,option)} \>空間曲線のコマンドを作成\\ +\hyperlink{mkobjnrm}{Mkobjnrm(name,式)} \>法線ベクトルのデータを作成\\ +\hyperlink{mkobjplatecmd}{Mkobjplatecmd(name,面データ,options)} \>面を描く\\ +\hyperlink{mkobjpolycmd}{Mkobjpolycmd(name,PD,options)} \>多面体を描く\\ +\hyperlink{mkobjsymbcmd}{Mkobjsymbcmd(PD, 実数,実数,vec,vec)} \>文字等のコマンドを作成\\ +\hyperlink{mkobjthickcmd}{Mkobjthickcmd(name,式)} \>厚みを持つ曲面のコマンドを作成\\ +\hyperlink{mkviewobj}{Mkviewobj(name,PD, options)} \>obj ファイルを作成\\ + \\ +【表計算ソフトとの連携】\\ \hyperlink{tab2list}{Tab2list(str,option)} \>str の内容をリストに変換する\\ -\hyperlink{Dispmat}{Dispmat(lsit)} \>リストの内容を行列型にコンソールに表示する\\ - -\hypertarget{functionlist3d}{} +\hyperlink{dispmat}{Dispmat(list)} \>リストの内容を行列型にコンソールに表示する\\ +\hyperlink{writecsv}{Writecsv(namelist,data,option)} \>dataの内容をcsvファイルに書き出す\\ + \\ +%\hypertarget{functionlist3d}{} 【KeTCindy3D 設定・定義】\\ \hyperlink{ketinit3d}{Ketinit3d()} \>KeTCindy3Dの使用宣言\\ @@ -5823,7 +6081,8 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 \hyperlink{rotatedata3d}{Rotatedatat3d(name,PD,vec,角度,点)} \>プロットデータを回転\\ \hyperlink{sf3data}{Sf3data(name, リスト,options)} \>陰線処理なしの空間曲面を描く\\ \hyperlink{sfbdparadata}{Sfbdparadata(name, 式,options)} \>曲面を陰線処理して描く\\ -\hyperlink{skeletonparadata}{Skeletonparadata(name,options)} \>スケルトン処理のデータ作成\\ +\hyperlink{skeletondatacindy}{Skeletondatacindy(name,PD,PD,options)} \>スケルトン処理のデータ作成\\ +\hyperlink{skeletonparadata}{Skeletonparadata(name,PD,PD,options)} \>スケルトン処理のデータ作成\\ \hyperlink{spacecurve}{Spacecurve(name, 式, 定義域,options)} \>空間曲線のデータ作成\\ \hyperlink{spaceline}{Spaceline(リスト)} \>空間の折線データ作成\\ \hyperlink{translatedata3d}{Translatedata3d(name,PD, 平行移動量)} \>空間プロットデータを平行移動\\ @@ -5835,6 +6094,7 @@ arctan2(B.xy-A.xy) で角を取得することもできる。この場合の戻 \\ 【KeTCindymv】\\ \hyperlink{moviedata}{Moviedata(str1,str2,options)} \>動画データの作成\\ +\hyperlink{setpara}{Setpata(str)} \>パラパラ動画のタイトル指定\\ \end{tabbing} |