summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/Scriptkelib.txt8
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketcindyjs/Cindy.js (renamed from Master/texmf-dist/doc/support/ketcindy/CindyJS/Cindy.js)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketcindyjs/CindyJS.css (renamed from Master/texmf-dist/doc/support/ketcindy/CindyJS/CindyJS.css)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketcindyjs/ketcindylib.txt (renamed from Master/texmf-dist/doc/support/ketcindy/CindyJS/ketcindylib.txt)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figure.cdybin5314 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0102figure2.cdybin5255 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0103polygon.cdybin4731 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0104shade.cdybin5526 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0105vector.cdybin4886 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowhatch.cdybin5574 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0107hyperbolahatch.cdybin4219 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0108cycloid.cdybin4195 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0109epitrochoid.cdybin4449 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0110hypotrochoid.cdybin4445 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0201basic.cdybin4223 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0202graph1.cdybin4455 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0203graph2.cdybin4422 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0204graph3.cdybin4728 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0205coniccurve.cdybin4224 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0206defexp.cdybin5152 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0207envelope.cdybin4481 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0208intersecthatch.cdybin3907 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0209diffeq.cdybin4008 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0210diffeq2.cdybin5729 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0211plotdataS.cdybin3870 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0212implicit.cdybin3966 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0213implicithatch.cdybin3807 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0301table.cdybin5223 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2.cdybin3999 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2line.cdybin3975 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0303papersquared.cdybin4054 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0304graphforincanddec.cdybin3871 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0305incanddec.cdybin4066 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0402bezier2.cdybin5993 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0405dogwalk.cdybin72346 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501basic.cdybin5865 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0502spacecurve.cdybin5169 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0507polyhedron.cdybin6589 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0601cycloid.cdybin5147 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0602diffeq.cdybin5702 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0603envelope.cdybin4943 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0604diffeq2.cdybin5156 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0605cycloid2.cdybin5390 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0606epitrochoid.cdybin5501 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0607hypotrochoid.cdybin5485 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/slide0.tex11
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.cdybin5454 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.cdybin5464 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graph.cdybin5695 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.cdybin5463 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.txt19
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.cdybin5634 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.cdybin5535 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.cdybin4857 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705para.cdybin5782 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.cdybin5714 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.cdybin5856 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.cdybin5801 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0801plotR.cdybin3926 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0802plotR2.cdybin5238 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0803boxplot.cdybin4120 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0804histplot.cdybin4203 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0805random.cdybin3804 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0806dataframe.cdybin3915 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0807timecount.cdybin3906 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0808ttest.cdybin3859 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0901paraboloid.cdybin5474 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0902cone.cdybin5302 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0904mant.cdybin5246 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0905sphere.cdybin5208 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0907intersectcrvsf.cdybin5469 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0909wiredata.cdybin5259 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0910conecut.cdybin5253 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1000list.cdybin3813 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1001basic.cdybin4019 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1002equation.cdybin3847 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1003trig.cdybin3884 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1004calcby.cdybin4067 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1005diffint.cdybin3826 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1006calculus.cdybin3908 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1007linalg.cdybin4122 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1008idtable.cdybin4208 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1009diffeq.cdybin4078 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier.cdybin4600 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier2.cdybin4925 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier3.cdybin4750 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop.cdybin3846 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop2.cdybin5087 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1012fourierpw.cdybin4804 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1013for.cdybin3883 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1014incdec2.cdybin4418 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1015primenumber.cdybin3973 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1100list.cdybin3785 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1101calculator1.cdybin3858 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1102calculator2.cdybin3847 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1103calcby.cdybin3869 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1104diff.cdybin3881 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fint101.cdybin3913 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fzero109.cdybin3862 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1106fmmx110.cdybin3850 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1110integrate.cdybin3993 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1111grobner1.cdybin3022 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1112residue.cdybin4172 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate.cdybin4069 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate2.cdybin3805 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202calcby.cdybin3069 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202equations.cdybin3134 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1301basic.cdybin5346 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1303objparts.cdybin5561 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1304symbol.cdybin5381 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1305hyperpara.cdybin5415 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1308discont.cdybin5799 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1309discont2.cdybin5955 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1401csvprocessing.cdybin3934 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1402copypaste.cdybin4409 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1501mant.cdybin5558 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1502torus.cdybin5598 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1503parabola.cdybin5700 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdybin4683 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdybin6006 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdybin4674 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdybin0 -> 6914 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figurepdf.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figurepdf.cdy)bin5303 -> 6903 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdybin0 -> 6855 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdybin0 -> 6331 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdybin0 -> 7126 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdybin0 -> 6486 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowdotfill.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowdotfill.cdy)bin5567 -> 7167 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdybin0 -> 7174 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdybin0 -> 5819 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdybin0 -> 5801 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdybin0 -> 6055 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdybin0 -> 6051 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdybin0 -> 5823 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdybin0 -> 6057 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdybin0 -> 6024 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdybin0 -> 6328 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdybin0 -> 5830 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdybin0 -> 6758 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdybin0 -> 6081 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdybin0 -> 5507 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdybin0 -> 5608 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdybin0 -> 7329 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdybin0 -> 5470 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdybin0 -> 5566 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdybin0 -> 5407 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdybin0 -> 6823 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdybin0 -> 5599 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdybin0 -> 5575 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdybin0 -> 5654 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdybin0 -> 5477 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdybin0 -> 5672 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/dogwalk.png (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/dogwalk.png)bin118714 -> 118714 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/heart.png (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/heart.png)bin66003 -> 66003 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/mtfuji.png (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/mtfuji.png)bin9171 -> 9171 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0401bezierbasic.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0401bezierbasic.cdy)bin6397 -> 7997 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdybin0 -> 7593 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0403bezierspline.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0403bezierspline.cdy)bin7538 -> 9138 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0404heart.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0404heart.cdy)bin83622 -> 85558 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdybin0 -> 74200 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0406mtfuji.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0406mtfuji.cdy)bin9403 -> 11349 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdybin0 -> 7464 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501plane.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501plane.cdy)bin8166 -> 9765 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdybin0 -> 6768 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0503perp.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0503perp.cdy)bin6005 -> 7604 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0504embed.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0504embed.cdy)bin6060 -> 7660 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0505bezier3d.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0505bezier3d.cdy)bin6889 -> 8488 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0506embedhatch.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0506embedhatch.cdy)bin6109 -> 7708 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdybin0 -> 8188 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0508concatobj.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0508concatobj.cdy)bin8260 -> 9859 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0509cubiccut.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05092cubiccut.cdy)bin11115 -> 12714 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0510cubiccut2.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05093cubiccut2.cdy)bin8451 -> 10050 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0511tetra.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s05091tetra.cdy)bin6718 -> 8323 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0521totaldiffskeleton.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0921totaldiffskeleton.cdy)bin6136 -> 7735 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0522conecutmaxima.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0922conecutmaxima.cdy)bin7534 -> 9133 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdybin0 -> 5083 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdybin0 -> 5693 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdybin0 -> 4945 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdybin0 -> 5152 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdybin0 -> 5383 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdybin0 -> 5499 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdybin0 -> 5491 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/figwall/wallpaper.tex (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/fig/wallpaper.tex)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/howtouseslideE.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/howtouseslideE.txt)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/howtouseslideJ.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/howtouseslideJ.txt)10
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.cdybin0 -> 7046 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.txt)3
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.cdybin0 -> 7056 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.txt)3
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.cdybin0 -> 6734 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.txt28
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.cdybin0 -> 7252 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.txt23
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.cdybin0 -> 7247 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.txt)14
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.cdybin0 -> 6903 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.txt)17
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.cdybin0 -> 6445 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.txt)11
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.cdybin0 -> 7380 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.txt10
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.cdybin0 -> 7291 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.txt)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.cdybin0 -> 7443 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.txt)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.cdybin0 -> 7389 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.txt (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.txt)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0801plotR.cdybin0 -> 5526 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdybin0 -> 6839 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdybin0 -> 5720 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdybin0 -> 5803 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdybin0 -> 5404 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdybin0 -> 5515 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdybin0 -> 5506 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdybin0 -> 5459 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1501mant.cdybin0 -> 7157 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1502torus.cdybin0 -> 7197 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1503parabola.cdybin0 -> 7299 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1504conecut.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1504conecut.cdy)bin5667 -> 7266 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1505skeleton.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1505skeleton.cdy)bin5654 -> 7253 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdybin0 -> 6964 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdybin0 -> 6854 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdybin0 -> 6812 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdybin0 -> 6854 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdybin0 -> 6840 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdybin0 -> 6893 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdybin0 -> 6934 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdybin0 -> 6943 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdybin0 -> 6936 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdybin0 -> 6905 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdybin0 -> 6852 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdybin0 -> 7667 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdybin0 -> 8585 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdybin0 -> 5413 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdybin0 -> 5619 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdybin0 -> 5447 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdybin0 -> 5484 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdybin0 -> 5667 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdybin0 -> 5426 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdybin0 -> 5508 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdybin0 -> 5722 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdybin0 -> 5808 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdybin0 -> 5678 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdybin0 -> 6200 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdybin0 -> 6525 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdybin0 -> 6350 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdybin0 -> 5446 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdybin0 -> 6687 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdybin0 -> 6404 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdybin0 -> 5483 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdybin0 -> 6018 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdybin0 -> 5573 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdybin0 -> 5386 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdybin0 -> 5458 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdybin0 -> 5448 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdybin0 -> 5470 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdybin0 -> 5481 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdybin0 -> 5513 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdybin0 -> 5462 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdybin0 -> 5450 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdybin0 -> 5593 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdybin0 -> 4171 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdybin0 -> 5778 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdybin0 -> 5669 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdybin0 -> 5406 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdybin0 -> 4217 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdybin0 -> 4282 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdybin0 -> 6951 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdybin0 -> 7167 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdybin0 -> 6986 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdybin0 -> 7014 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1306poly.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1306poly.cdy)bin6958 -> 8557 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1307poly2.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1307poly2.cdy)bin8229 -> 9828 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdybin0 -> 7398 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdybin0 -> 7554 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1310totaldiff.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1310totaldiff.cdy)bin4613 -> 5760 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1311plate.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1311plate.cdy)bin6684 -> 8283 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1312plane.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1312plane.cdy)bin7332 -> 8931 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1313changescale.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1313changescale.cdy)bin8193 -> 9792 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdybin0 -> 5534 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdybin0 -> 6247 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1403maketableJ.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1403maketableJ.cdy)bin7508 -> 9346 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/sample1.csv (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/sample1.csv)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/sample2.csv (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/sample2.csv)0
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1501paraboloid.cdybin0 -> 7073 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdybin0 -> 6901 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1503saddle.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0903saddle.cdy)bin5204 -> 6803 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdybin0 -> 6845 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdybin0 -> 6807 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1506curveonsurf.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0906curveonsurf.cdy)bin5299 -> 6898 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdybin0 -> 7069 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1508multisurfaces.cdy (renamed from Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0908multisurfaces.cdy)bin5256 -> 6855 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdybin0 -> 6858 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdybin0 -> 6849 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdybin0 -> 6246 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdybin0 -> 7573 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.html229
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindy.html6639
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2ketcindyon.html6640
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1603gamow.cdybin0 -> 6577 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/KetCindyPlugin.iml31
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/build.xml67
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/config/META-INF/services/de.cinderella.api.cs.CindyScriptPlugin1
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/cindy2.jarbin0 -> 3133389 bytes
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/commons-math.jarbin0 -> 152709 bytes
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/src/KetCindyPlugin.java (renamed from Master/texmf-dist/doc/support/ketcindy/source/ketjava/KetCindyPlugin.java)78
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin150906.java150
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160515.java137
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160518.java154
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160530.java154
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160601.java154
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160604.java205
-rwxr-xr-xMaster/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160609.java259
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin160723.java269
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161019.java311
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161021.java330
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin161209.java372
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170605.java377
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin170906.java388
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/srcold/KetCindyPlugin171112.java399
-rw-r--r--Master/texmf-dist/doc/support/ketcindy/source/ketmanual/KeTCindyReferenceJ.tex566
-rw-r--r--Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdfbin0 -> 77577 bytes
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketcindy.ini (renamed from Master/texmf-dist/scripts/ketcindy/dirhead.txt)1
-rwxr-xr-xMaster/texmf-dist/scripts/ketcindy/ketcindy.sh13
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jarbin156502 -> 157275 bytes
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt0
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt1
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt41
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs584
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt45
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs531
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt31
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs446
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt0
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt0
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt0
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt0
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt19
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs362
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt75
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs1240
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r239
-rwxr-xr-x[-rw-r--r--]Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r0
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommon.h431
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommonhead.h23
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlibC/ketlibClog.txt18
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h1641
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlibC/surflibhead.h46
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketoutset.txt52
-rw-r--r--Master/texmf-dist/scripts/ketcindy/template1basic.cdybin4302 -> 5901 bytes
-rw-r--r--[-rwxr-xr-x]Master/texmf-dist/scripts/ketcindy/template2advanced.cdybin5778 -> 7354 bytes
351 files changed, 21673 insertions, 2233 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
deleted file mode 100644
index 23b2ec4aa50..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0101figure.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 7c5f4f7c67a..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0102figure2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index adb3f4523d1..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0103polygon.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 13c7b8a4147..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0104shade.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index d928672b4ca..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0105vector.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 459feeac48a..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0106bowhatch.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index cd2cb8e44d3..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0107hyperbolahatch.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 6c5668e54b8..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0108cycloid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 22995717144..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0109epitrochoid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index ce4cc21dda6..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s01figure/s0110hypotrochoid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 375e477f0ff..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0201basic.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index fb5f231c90b..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0202graph1.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 577cd958a8c..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0203graph2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 274c96637ac..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0204graph3.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index f07f094a49f..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0205coniccurve.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 3aabbc4844e..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0206defexp.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 4f3f48b0a93..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0207envelope.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 866e0cacbfb..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0208intersecthatch.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 5ef84953657..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0209diffeq.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index df2280441e0..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0210diffeq2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index dba596a3136..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0211plotdataS.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 3ad386c75b9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0212implicit.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index c118ca94b63..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s02graph/s0213implicithatch.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index edbd6159f57..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0301table.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index fb5f02d6f84..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 87cfe10f8c0..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0302table2line.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 1a127585329..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0303papersquared.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index f46a2a29657..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0304graphforincanddec.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index bc9c08cb2c2..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s03table/s0305incanddec.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 0a637398428..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0402bezier2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 06bb52f8058..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s04bezier/s0405dogwalk.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 3850f7e07ce..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0501basic.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 57cf43131fa..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0502spacecurve.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index beee239a562..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s05spacefigure/s0507polyhedron.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 13ee3cd04f2..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0601cycloid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 0bb3cb64ba7..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0602diffeq.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index e762e8dbf9d..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0603envelope.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 643743520f5..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0604diffeq2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 9e1d541c019..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0605cycloid2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index df32beb363a..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0606epitrochoid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index b49ee406be6..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s06animation/s0607hypotrochoid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 886b5bc01ce..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basic.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 0025ed37400..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0701basicE.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 6ce49ec73b7..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graph.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 4b59de6c9ad..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0702graphE.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index fa5099527fc..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeat.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 1da10768bd9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0703repeatE.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 012e8971df5..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0704thin.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index ffc2f5de4f9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705para.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 2b898539f33..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0705paraE.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index d87de868f3d..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animate.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 5cb1238a727..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s07slides/s0706animateE.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index b0040070ed3..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0801plotR.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 54148975b4f..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0802plotR2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index cc97d6e8163..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0803boxplot.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 06eb56d79b9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0804histplot.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index b6b701349ac..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0805random.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 70cc8213f1e..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0806dataframe.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 88f2cc3bcf1..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0807timecount.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index c6260d136fe..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s08R/s0808ttest.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 88fdaf1cb37..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0901paraboloid.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 17f96400435..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0902cone.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index e209bfa5068..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0904mant.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 3f4d4ca4cc2..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0905sphere.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 40b54a57ba3..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0907intersectcrvsf.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index f412eadc965..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0909wiredata.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 275819e94eb..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s09surface/s0910conecut.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index be193e2c2c9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1000list.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index c0b659d5521..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1001basic.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index a332c2a4ab5..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1002equation.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 5c2e8f1d9e4..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1003trig.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index f5bb31c8a82..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1004calcby.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 4b581c9a83e..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1005diffint.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 956678bee05..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1006calculus.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 44bcaa1d765..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1007linalg.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 8aeb42708d5..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1008idtable.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 691ff457506..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1009diffeq.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index e8cabe3e63b..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 3967749af0e..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index f096d6ed716..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1010fourier3.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 622b7e58f7a..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index ceee9ea0f42..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1011matrixop2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index f6e4420a127..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1012fourierpw.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 99d01ad91b6..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1013for.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 1a48ee9bae1..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1014incdec2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 564749b1c94..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s10maxima/s1015primenumber.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 575037fbdcc..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1100list.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 6d5ab14b9e1..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1101calculator1.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 996a293500c..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1102calculator2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 66e58f97d04..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1103calcby.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 43727b1f8a5..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1104diff.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index ed7d7dfa0db..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fint101.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 475b00188ab..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1105fzero109.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index c360a5cc7a2..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1106fmmx110.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 8151daf2677..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1110integrate.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 9ac5a504cde..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1111grobner1.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index b8db8601b6b..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s11asir/s1112residue.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 42fb8d3faf9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 13b0cdb330e..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1201integrate2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index d79f82f56b9..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202calcby.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index bbc19ef9968..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s12fricas/s1202equations.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 2489208ecaf..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1301basic.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 2675c4d996d..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1303objparts.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 8f5d0012254..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1304symbol.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 2768c455e6c..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1305hyperpara.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 01f65394d21..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1308discont.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 160b1fbad56..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s13meshlab/s1309discont2.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 8339f560622..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1401csvprocessing.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index acdc2d25ee2..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s14dataprocessing/s1402copypaste.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 59bfc5cfa8c..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1501mant.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index ec9a5966348..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1502torus.cdy
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 5b45f933ab1..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samples/s15C/s1503parabola.cdy
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdy
deleted file mode 100644
index ac2ecd2d8df..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js01basic.cdy
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdy
deleted file mode 100644
index 1bbe45a7d2e..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js02diffeq2.cdy
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdy b/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdy
deleted file mode 100644
index 1305329e437..00000000000
--- a/Master/texmf-dist/doc/support/ketcindy/ketsample/samplesJS/js03gamow.cdy
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdy
new file mode 100644
index 00000000000..1eeb8c32a42
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0101figure.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdy
new file mode 100644
index 00000000000..f1fd981e571
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0102figure2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdy
new file mode 100644
index 00000000000..e52af2ec813
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0103polygon.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdy
new file mode 100644
index 00000000000..07dd75aedb2
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0104shade.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdy
new file mode 100644
index 00000000000..10fd5a3f042
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0105vector.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdy
new file mode 100644
index 00000000000..0f6688dd002
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0106bowhatch.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdy
new file mode 100644
index 00000000000..1c24d989416
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0107hyperbolahatch.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdy
new file mode 100644
index 00000000000..477b251149c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0108cycloid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdy
new file mode 100644
index 00000000000..184cfff875c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0109epitrochoid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdy
new file mode 100644
index 00000000000..d216acdf030
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s01figure/s0110hypotrochoid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdy
new file mode 100644
index 00000000000..c96e2286b76
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0201basic.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdy
new file mode 100644
index 00000000000..8884df23cba
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0202graph1.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdy
new file mode 100644
index 00000000000..1720d6c0ef8
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0203graph2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdy
new file mode 100644
index 00000000000..4af50fdad7c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0204graph3.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdy
new file mode 100644
index 00000000000..89fe447023c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0205coniccurve.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdy
new file mode 100644
index 00000000000..4850eea641c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0206defexp.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdy
new file mode 100644
index 00000000000..a99645a07f6
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0207envelope.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdy
new file mode 100644
index 00000000000..b3b397fcef5
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0208intersecthatch.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdy
new file mode 100644
index 00000000000..d2c75f24b96
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0209diffeq.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdy
new file mode 100644
index 00000000000..773bb202869
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0210diffeq2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdy
new file mode 100644
index 00000000000..0eb5f4ac32c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0211plotdataS.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdy
new file mode 100644
index 00000000000..b93c78c22a0
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0212implicit.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdy
new file mode 100644
index 00000000000..7805e90cb57
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s02graph/s0213implicithatch.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdy
new file mode 100644
index 00000000000..1725d889493
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0301table.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdy
new file mode 100644
index 00000000000..5afc3327679
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdy
new file mode 100644
index 00000000000..d2dee489192
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0302table2line.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdy
new file mode 100644
index 00000000000..78fae48b3b4
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0303papersquared.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdy
new file mode 100644
index 00000000000..25e66b6c357
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0304graphforincanddec.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdy
new file mode 100644
index 00000000000..94b517bf64d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s03table/s0305incanddec.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdy
new file mode 100644
index 00000000000..80bcb1721fa
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0402bezier2.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdy
new file mode 100644
index 00000000000..0d6808ce912
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s04bezier/s0405dogwalk.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdy
new file mode 100644
index 00000000000..7d8f7a740ce
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0501basic.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdy
new file mode 100644
index 00000000000..b40c881ace0
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0502spacecurve.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdy
new file mode 100644
index 00000000000..38fd68d95a9
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s05spacefigure/s0507polyhedron.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdy
new file mode 100644
index 00000000000..37bc71a29a2
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0601cycloid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdy
new file mode 100644
index 00000000000..bd8bb17841a
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0602diffeq.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdy
new file mode 100644
index 00000000000..d5c8689b5af
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0603envelope.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdy
new file mode 100644
index 00000000000..30f5dacf0a1
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0604diffeq2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdy
new file mode 100644
index 00000000000..98b9baaf391
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0605cycloid2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdy
new file mode 100644
index 00000000000..2e819ba6f62
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0606epitrochoid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdy
new file mode 100644
index 00000000000..839f079d58d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s06animation/s0607hypotrochoid.cdy
Binary files differ
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
ï¼ï¼Žä½œæˆã®æµã‚Œ
@@ -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
new file mode 100644
index 00000000000..73149dccb3e
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basic.cdy
Binary files differ
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
new file mode 100644
index 00000000000..019c8ca16f1
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0701basicE.cdy
Binary files differ
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
new file mode 100644
index 00000000000..364cf572519
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graph.cdy
Binary files differ
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
new file mode 100644
index 00000000000..745c4087062
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0702graphE.cdy
Binary files differ
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
new file mode 100644
index 00000000000..cac282b325c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeat.cdy
Binary files differ
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
new file mode 100644
index 00000000000..7762575fc79
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0703repeatE.cdy
Binary files differ
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
new file mode 100644
index 00000000000..5ac9feddda0
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0704thin.cdy
Binary files differ
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
new file mode 100644
index 00000000000..623ff70d46a
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705para.cdy
Binary files differ
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
new file mode 100644
index 00000000000..380c28c8f69
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0705paraE.cdy
Binary files differ
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
new file mode 100644
index 00000000000..0e7f029d1dd
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animate.cdy
Binary files differ
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
new file mode 100644
index 00000000000..483cea9135a
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s07slides/s0706animateE.cdy
Binary files differ
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
new file mode 100644
index 00000000000..77a23481240
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0801plotR.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdy
new file mode 100644
index 00000000000..b708a8e3e7c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0802plotR2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdy
new file mode 100644
index 00000000000..1ca5da50591
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0803boxplot.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdy
new file mode 100644
index 00000000000..251e815522d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0804histplot.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdy
new file mode 100644
index 00000000000..c4ce13e642f
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0805random.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdy
new file mode 100644
index 00000000000..3ff7e341d7d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0806dataframe.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdy
new file mode 100644
index 00000000000..f34ea605bf6
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0807timecount.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdy
new file mode 100644
index 00000000000..39ce85fd6c1
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s08R/s0808ttest.cdy
Binary files differ
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
new file mode 100644
index 00000000000..d98388705ee
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1501mant.cdy
Binary files differ
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
new file mode 100644
index 00000000000..7b1719cea76
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1502torus.cdy
Binary files differ
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
new file mode 100644
index 00000000000..e7bf918b186
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/old/s1503parabola.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdy
new file mode 100644
index 00000000000..c0a627326c3
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0901paraboloid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdy
new file mode 100644
index 00000000000..ccb6114845d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0902cone.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdy
new file mode 100644
index 00000000000..13cd1dd4ffb
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0903saddle.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdy
new file mode 100644
index 00000000000..477db07018b
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0904mant.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdy
new file mode 100644
index 00000000000..bc5fe0d9806
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0905sphere.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdy
new file mode 100644
index 00000000000..5a0dc0cddcf
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0906curveonsurf.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdy
new file mode 100644
index 00000000000..809581a524f
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0907intersectcrvsf.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdy
new file mode 100644
index 00000000000..ef9c9410409
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0908wiredata.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdy
new file mode 100644
index 00000000000..6c1ae540720
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0909conecut.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdy
new file mode 100644
index 00000000000..aef27dd2167
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0910multisurfaces.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdy
new file mode 100644
index 00000000000..9f26f43a268
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0911saddleskeleton.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdy
new file mode 100644
index 00000000000..4aa04fe367e
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0912animesaddle.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdy
new file mode 100644
index 00000000000..cc7ab2d2a3c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s09surfaceC/s0913animeparaboloid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdy
new file mode 100644
index 00000000000..0d47da0281e
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1000list.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdy
new file mode 100644
index 00000000000..d1e60697e68
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1001basic.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdy
new file mode 100644
index 00000000000..2ccbe7156e0
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1002equation.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdy
new file mode 100644
index 00000000000..4b8e42e7b4e
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1003trig.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdy
new file mode 100644
index 00000000000..f1d38f17616
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1004calcby.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdy
new file mode 100644
index 00000000000..a8b08ff6ac4
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1005diffint.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdy
new file mode 100644
index 00000000000..bfb23dc436b
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1006calculus.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdy
new file mode 100644
index 00000000000..a01f3343bd9
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1007linalg.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdy
new file mode 100644
index 00000000000..27f893b8a6d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1008idtable.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdy
new file mode 100644
index 00000000000..1cb429f23c4
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1009diffeq.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdy
new file mode 100644
index 00000000000..797aad90622
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdy
new file mode 100644
index 00000000000..bcf2086dd1e
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdy
new file mode 100644
index 00000000000..e598705e9bc
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1010fourier3.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdy
new file mode 100644
index 00000000000..4c746b03a39
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdy
new file mode 100644
index 00000000000..0b4da7e4820
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1011matrixop2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdy
new file mode 100644
index 00000000000..9f5fa021f90
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1012fourierpw.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdy
new file mode 100644
index 00000000000..c137e6f7632
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1013for.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdy
new file mode 100644
index 00000000000..541bcea8878
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1014incdec2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdy
new file mode 100644
index 00000000000..3cdf29aa625
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s10maxima/s1015primenumber.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdy
new file mode 100644
index 00000000000..be024649c31
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1100list.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdy
new file mode 100644
index 00000000000..776d3c0d46c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1101calculator1.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdy
new file mode 100644
index 00000000000..96d661c1ed6
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1102calculator2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdy
new file mode 100644
index 00000000000..47f0b20cf59
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1103calcby.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdy
new file mode 100644
index 00000000000..fff2939ee33
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1104diff.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdy
new file mode 100644
index 00000000000..c07f0ed0498
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fint101.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdy
new file mode 100644
index 00000000000..7d51533f519
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1105fzero109.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdy
new file mode 100644
index 00000000000..6ceb10fe84f
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1106fmmx110.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdy
new file mode 100644
index 00000000000..f5def33c897
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1110integrate.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdy
new file mode 100644
index 00000000000..d8e397d839c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1111grobner1.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdy
new file mode 100644
index 00000000000..1f177c97ee4
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s11asir/s1112residue.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdy
new file mode 100644
index 00000000000..95516f75e18
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdy
new file mode 100644
index 00000000000..d89a8f10fcc
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1201integrate2.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdy
new file mode 100644
index 00000000000..94b57a047a7
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202calcby.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdy
new file mode 100644
index 00000000000..18c0f84a57f
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s12fricas/s1202equations.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdy
new file mode 100644
index 00000000000..3bc01af4486
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1301basic.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdy
new file mode 100644
index 00000000000..1f96b01b252
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1303objparts.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdy
new file mode 100644
index 00000000000..4b8d719a410
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1304symbol.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdy
new file mode 100644
index 00000000000..695c714ffab
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1305hyperpara.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdy
new file mode 100644
index 00000000000..099e6e9d24a
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1308discont.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdy
new file mode 100644
index 00000000000..1c2dd0b6cd8
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s13meshlab/s1309discont2.cdy
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdy
new file mode 100644
index 00000000000..a5a6ccaa5ec
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1401csvprocessing.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdy
new file mode 100644
index 00000000000..b8ff97f3e29
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s14dataprocessing/s1402copypaste.cdy
Binary files differ
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
index 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
Binary files differ
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
new file mode 100644
index 00000000000..1f7718dd3c6
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1501paraboloid.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdy
new file mode 100644
index 00000000000..3a4b6e8efec
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1502cone.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdy
new file mode 100644
index 00000000000..ac94f28f73c
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1504mant.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdy
new file mode 100644
index 00000000000..cc18ebdd421
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1505sphere.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdy
new file mode 100644
index 00000000000..cb86ef9210d
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1507intersectcrvsf.cdy
Binary files differ
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
index 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
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdy
new file mode 100644
index 00000000000..33a66a806b5
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1509wiredata.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdy
new file mode 100644
index 00000000000..2c4a4398813
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s15surfaceR/s1510conecut.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdy
new file mode 100644
index 00000000000..5f706e9b863
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1601basic.cdy
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdy b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdy
new file mode 100644
index 00000000000..7aced3612cc
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1602diffeq2.cdy
Binary files differ
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
new file mode 100644
index 00000000000..2c300fa3051
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/samples/s16ketcindyJS/s1603gamow.cdy
Binary files differ
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
new file mode 100755
index 00000000000..fe2f87e7194
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/cindy2.jar
Binary files differ
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
new file mode 100755
index 00000000000..1dc2517c210
--- /dev/null
+++ b/Master/texmf-dist/doc/support/ketcindy/source/KetCindyPlugin/lib/commons-math.jar
Binary files differ
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()| :å€çŽ‡ï¼‘,æ画領域 $-5 \leqq x \leqq 5 , -5 \leqq y \leqq 5$(デフォルト)\\
-   \verb|Ketinit(2)| : å€çŽ‡ï¼’,æ画領域 $-5 \leqq x \leqq 5 , -5 \leqq y \leqq 5$\\
-   \verb|Ketinit(2,[-2,3],[-2,4])| : å€çŽ‡ï¼’,æ画領域 $-2 \leqq x \leqq 3 , -2 \leqq y \leqq 4$\\
+ 例:\verb|Ketinit()| :å€çŽ‡ï¼‘,æ画領域 $-5 \leq x \leq 5 , -5 \leq y \leq 5$(デフォルト)\\
+   \verb|Ketinit(2)| : å€çŽ‡ï¼’,æ画領域 $-5 \leq x \leq 5 , -5 \leq y \leq 5$\\
+   \verb|Ketinit(2,[-2,3],[-2,4])| : å€çŽ‡ï¼’,æ画領域 $-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ã‚’æã。太ã•ï¼’\\
-  \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ã‚’æã。太ã•ï¼’\\
+  \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ã«ã‚ˆã‚‹å‡ºåŠ›é ˜åŸŸæŒ‡å®šãŒæœ‰åŠ¹ã«ãªã‚‹ã€‚ã¤ã‘ãªã„å ´åˆã¯ï¼Œè¡¨ã®éƒ¨åˆ†ã ã‘ãŒå‡ºåŠ›ã•ã‚Œã‚‹ã€‚\\
 縦横データã«ã¯ï¼Œæ¬¡ã®ï¼’通りã®æ›¸å¼ãŒã‚る。\\
 \\
(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ã¯ï¼Œãƒžãƒ¼ã‚¸ãƒ³ï¼ˆä½™ç™½ï¼‰ã¨å¹³è¡Œç§»å‹•é‡ã€‚指定ã—ãªã„å ´åˆã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤ã€‚\\
-引数ãŒï¼‘ã¤ã®å®Ÿæ•°ã®å ´åˆã¯ï¼Œå·¦å³ä¸Šä¸‹åŒä¸€ã®æŒ‡å®šã—ãŸä½™ç™½ã¨ãªã‚‹ã€‚\\
-引数ãŒï¼”ã¤ã®æ•°ã‚’コンマã§åŒºåˆ‡ã£ãŸæ–‡å­—列をè¦ç´ ã¨ã™ã‚‹ãƒªã‚¹ãƒˆã®å ´åˆï¼Œå·¦å³ä¸Šä¸‹ã®ä½™ç™½æŒ‡å®šã¨ãªã‚‹ã€‚\\
-引数ãŒï¼’ã¤ã®æ•°ã‚’コンマã§åŒºåˆ‡ã£ãŸæ–‡å­—列をè¦ç´ ã¨ã™ã‚‹ãƒªã‚¹ãƒˆã®å ´åˆï¼Œå³ï¼Œä¸‹æ–¹å‘ã¸ã®å¹³è¡Œç§»å‹•æŒ‡å®šã¨ãªã‚‹ã€‚\\
+余白ã¯ï¼Œå·¦å³ä¸Šä¸‹ã®é †ã«ï¼”ã¤ã®æ•°ã‚’コンマã§åŒºåˆ‡ã‚‹ã€‚。\\
+平行移動é‡ã¯ï¼Œå³æ–¹å‘,下方å‘をリストã§ä¸Žãˆã‚‹ã€‚\\
余白指定ã¨å¹³è¡Œç§»å‹•æŒ‡å®šã¯åŒæ™‚ã«è¡Œã†ã“ã¨ãŒã§ãる。\\
-例: \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"\\
+ã¾ãŸï¼Œï¼²ã‚’使ã‚ãš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 ã«ãƒœã‚¿ãƒ³ã‚’ã¤ã‘ãŸã‚‚ã®ãŒã‚る。\\
+ ãªãŠï¼Œï¼“Dã§ã‚ã‚‹ã®ã§ï¼Œ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引数ã¯å¤§ãã•ï¼Œç¬¬ï¼“引数ã¯å›žè»¢è§’,第4引数ã¯æ­£é¢æ–¹å‘ã®ãƒ™ã‚¯ãƒˆãƒ«ï¼Œç¬¬ï¼•å¼•æ•°ã¯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() ã«ã‚ˆã‚Šï¼‘ã¤ã«ã¾ã¨ã‚る。
+オプションã¯
+\begin{tabbing}
+12345678901234567890\=\kill
+ "m"ã¾ãŸã¯"make" \> データを作る(指定ã—ãªã„å ´åˆã‚‚データãŒãªã‘ã‚Œã°ä½œã‚‹ï¼‰\\
+ "v"ã¾ãŸã¯"view"  \>MeshLabã‚’ç«‹ã¡ä¸Šã’ã¦è¡¨ç¤ºã™ã‚‹\\
+ "W=n"      \>作æˆã™ã‚‹ãŸã‚ã®å¾…ã¡æ™‚間。n秒。ã“れをéŽãŽã‚‹ã¨çµ‚了ã™ã‚‹\\
+ "Unit=mm"    \>Setunitlen()ã¨é€£å‹•ã—ã¦ï¼“Dプリンタã®æ•°å€¤ã®å˜ä½ã‚’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)ãŒå«ã¾ã‚Œã‚‹å ´åˆï¼Œãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§ã¯ãã®ã¾ã¾ç©ºæ–‡å­—ã«ãªã‚‹ãŒï¼Œã‚¢ãƒ³ã‚±ãƒ¼ãƒˆå‡¦ç†ãªã©ã§ç„¡å›žç­”ã‚’ï¼ã«ã—ãŸã„よã†ãªå ´åˆã¯\\
 \\
-\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座標をï¼ã¨ã™ã‚‹ã€‚点ã®åå‰ãŒ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}
diff --git a/Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf b/Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf
new file mode 100644
index 00000000000..e2b52ddd5ee
--- /dev/null
+++ b/Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf
Binary files differ
diff --git a/Master/texmf-dist/scripts/ketcindy/dirhead.txt b/Master/texmf-dist/scripts/ketcindy/ketcindy.ini
index e87a8005629..10b9a05fc01 100644
--- a/Master/texmf-dist/scripts/ketcindy/dirhead.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketcindy.ini
@@ -1,6 +1,7 @@
Dirhead=Dircdy;
Dirwork=gethome()+pathsep()+"ketcindy";
Dircdy=Dirwork;
+Dirhead=gettexmfdist()+pathsep()+"scripts"+pathsep()+"ketcindy";
setdirectory(Dirhead);
import("setketcindy.txt");
import("ketoutset.txt");
diff --git a/Master/texmf-dist/scripts/ketcindy/ketcindy.sh b/Master/texmf-dist/scripts/ketcindy/ketcindy.sh
index 23465f4b927..7fecac2ff68 100755
--- a/Master/texmf-dist/scripts/ketcindy/ketcindy.sh
+++ b/Master/texmf-dist/scripts/ketcindy/ketcindy.sh
@@ -2,13 +2,14 @@
#
# KETCindy starter script
#
-# (C) 2017 Norbert Preining
+# (C) 2017-2018 Norbert Preining
# Licensed under the same license terms as ketpic itself, that is GPLv3+
#
BinaryName=Cinderella2
TemplateFile=template1basic.cdy
systype=`uname`
+workdir="$HOME/ketcindy"
if [ "$1" = "-c" ]
then
@@ -52,11 +53,13 @@ case $systype in
esac
plugin="$plugindir/KetCindyPlugin.jar"
+dirheadplugin="$plugindir/dirhead.txt"
# find Jar
KetCdyJar=`kpsewhich -format=texmfscripts KetCindyPlugin.jar`
# search for template.cdy
TempCdy=`kpsewhich -format=texmfscripts $TemplateFile`
+DirHead=`kpsewhich -format=texmfscripts dirhead.txt`
if [ -z "$TempCdy" -o -z "$KetCdyJar" ]
then
@@ -65,10 +68,11 @@ then
fi
-if [ ! -r "$plugin" ] ; then
+if [ ! -r "$plugin" -o ! -r "$dirheadplugin" ] ; then
echo "Cinderella is *NOT* set up for KETCindy!"
echo "You need to copy"
echo " $KetCdyJar"
+ echo " $DirHead"
echo "into"
echo " $plugindir"
echo ""
@@ -94,7 +98,8 @@ then
fi
-mkdir -p ~/ketcindy
+mkdir -p "$workdir"
+cp "$TempCdy" "$workdir"
-exec "$cinderella" "$TempCdy"
+exec "$cinderella" "$workdir/$TemplateFile"
diff --git a/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar b/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar
index 2ae7ceda3f5..3c150e58ddb 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar
+++ b/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar
Binary files differ
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt
index 27b40955e62..27b40955e62 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt
index bd29d25ff24..2d33176d4e7 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt
@@ -36,7 +36,6 @@
//help:Concatobj*(ã„ãã¤ã‹ã®objデータをçµåˆ);
//help:Crvsfparadata*(曲線ã®æ›²é¢ã«ã‚ˆã‚‹é™°ç·šå‡¦ç†);
//help:Intersectcrvsf*(曲線ã¨æ›²é¢ã®äº¤ç‚¹ã‚’求ã‚ã‚‹);
-//help:Intersectcrvsf*(曲線ã¨æ›²é¢ã®äº¤ç‚¹ã‚’求ã‚ã‚‹);
//help:Sfbdparaparadata*(空間曲é¢ã®é™°ç·šå‡¦ç†);
//help:Wireparadata*(曲é¢ã®ãƒ¯ã‚¤ãƒ¤ãƒ•ãƒ¬ãƒ¼ãƒ ã‚’陰線処ç†);
//help:Dist3d*(空間ã®ï¼’点ã®è·é›¢);
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt
index 55b2fc71c23..7dcdd198e91 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt
@@ -1,3 +1,44 @@
+// 20180614
+// Setangle changed (for angle list)
+// 20180613
+// Getangle changed ("Disp=y" options added )
+// 20180608
+// Xyzaxparaname changed ( former names deleted )
+// Projpara changed (default: Msg=no )
+// Start3d changed ( Setfiles(Namecdy) added )
+// 20180607
+// Getangle debugged (output)
+// 20180606
+// Start3d changed (ADDPACK )
+// 20180603
+// Projpara,... changed (KCOLOR)
+// 20180602
+// divoptions ( 8,9 ->length(tmp)-1,length(tmp))
+// Projara,... changed (color supported )
+// Rotatedata3d,Translatedatad3 changed ( Level of RSform to 1)
+// Changestyle3d changed ( for case where name not found)
+// 20180601
+// Start3d changed (CutFunList, EraseList added)
+// 20180531
+// Start3d changed (CommandListC added)
+// ExeccmdC added
+// SfbdparadataC,CrvsfparadataC,... changed ( for "c" option)
+// 20180522
+// Sfbdparadata debugged ( "Proj" )
+// 20180517
+// Isangle(isAngle),Getangle added
+// kcC changed ( "resultC" => "end")
+// 20180510
+// Wireparadata,Sfcutparadata debugged
+// 20180509
+// Sfbdparadata,... changed ( name2,name2h removed)
+// Crvsfparadata renamed to Crv3sfparadata
+// Crvs3fparadata, changed ( Proj from GLIST removed)
+// 20180508
+// Sfbdparadata,... changed ( to Projpara(name3) )
+// 20180426
+// Sfbdparadata,... changed (.dat => .Rdata )
+// WriteCdata,ReadCdata => WritedataC,ReaddataC
// 2018.03.27
// Start3d changed (for C)
// 2018.02.27
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs
index ce7a65f1074..ffb4798b846 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs
@@ -14,7 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindylib3d(20180327) loaded");
+println("ketcindylib3d(20180614) loaded");
//help:start();
@@ -85,9 +85,13 @@ Start3d(ptexception):=(
//help:Start3d(execptionptlist);
regional(xmn,xMx,ymn,yMx,pt,pt3,pt2,
xPos,yTh,yPh,Eps,tmp,tmp1,tmp2,tmp3,tmp4);
+ Setfiles(Namecdy); //180608
ConstantListC=[[50,50],[5000,1500,500,200],[0.00001,0.01,0.1]];
FuncListC=[];
- CommandListC=[];
+ CommandListC=[]; //180531
+ CutFunList=[];//180601
+ EraseList=[];//180601
+ ADDPACK=[]; //180606
GCLIST=[];
GLIST=[];
FUNLIST=[];
@@ -206,6 +210,7 @@ Start3d(ptexception):=(
Ptseg3data(ptexception); //16.08.23
);
+Setangle(angL):=Setangle(ang_1,ang_2);//180614
Setangle(theta,phi):=( //16.12.24
//help:Setangle(60,30);
regional(xmn,xMx,ymn,yMx,pt,pt3,pt2,
@@ -278,6 +283,28 @@ Setangle(theta,phi):=( //16.12.24
Ptseg3data(ptexception);
);
+Getangle():=getangle(["Disp=y"]); //180613from
+Getangle(option):=(
+ regional(tmp,tmp1,dispflg,eqL);
+ tmp=divoptions(option);
+ dispflg="N";
+ eqL=tmp_7;
+ forall(eqL,
+ if(Toupper(#_1)=="DISP",
+ dispflg=Toupper(#_1);
+ dispflg=substring(dispflg,0,1);
+ );
+ );
+ tmp=[THETA*180/pi, PHI*180/pi];
+ if(dispflg=="Y",
+ println(textformat(tmp,6));
+ );
+ tmp; //180607
+); //180613to
+
+isAngle():=Isangle(); //180517
+Isangle():=isselected(TH)%isselected(FI); //180517
+
Changestyle3d(nameL,style):=(
//help:Changestyle3d(["geoseg3d","ax3d"],["notex"]);
regional(nmL,name,tmp,tmp1,tmp2);
@@ -285,15 +312,17 @@ Changestyle3d(nameL,style):=(
tmp1=[];
forall(nmL,name,
tmp=parse(name);
- if(isstring(tmp_1),
- tmp1=concat(tmp1,tmp);
- ,
- tmp1=append(tmp1,name);
+ if(islist(tmp),
+ if(isstring(tmp_1),
+ tmp1=concat(tmp1,tmp);
+ ,
+ tmp1=append(tmp1,name);
+ );
+ tmp=apply(tmp1,replace(#,"3d","2d"));
+ Changestyle(tmp,style);
+ tmp=apply(tmp,"sub"+#); // 15.05.24
+ Changestyle(tmp,style);
);
- tmp=apply(tmp1,replace(#,"3d","2d"));
- Changestyle(tmp,style);
- tmp=apply(tmp,"sub"+#); // 15.05.24
- Changestyle(tmp,style);
);
);
@@ -421,16 +450,30 @@ ProjCurve(crv):=(
);
Projpara(ptdata):=Projpara(ptdata,[]);
-Projpara(ptdata,options):=(
- regional(name2,name3,Ltype,Noflg,opcindy,dtL,ptL,tmp,Out);
+Projpara(ptdata,optionsorg):=(
+//help:Projpara("sf3d1");
+//help:Projpara(options=["Msg=no"]);
+ regional(options,name2,name3,Ltype,Noflg,eqL,opcindy,
+ dtL,ptL,tmp,tmp1,Out,color,msgflg);
+ options=optionsorg;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
- if(islist(ptdata),dtL=ptdata,dtL=[ptdata]);
+ msgflg=0; //180602from
+ forall(eqL,
+ tmp=Strsplit(#,"=");
+ if(Toupper(tmp_1)=="MSG",
+ tmp=substring(tmp_2,0,1);
+ if(Toupper(tmp)=="Y", msgflg=1);
+ options=remove(options,[#]);
+ );
+ );//180602to
Out=[];
+ if(islist(ptdata),dtL=ptdata,dtL=[ptdata]);
forall(dtL,name3,
-// name3=#;
if(indexof(name3,"3d")>0, //17.05.24
name2=replace(name3,"3d","2d");
,
@@ -443,7 +486,9 @@ Projpara(ptdata,options):=(
);
Out=append(Out,ptL);
if(Noflg<3,
- println("generate projparadata "+name2);
+ if(msgflg==1,//180602from
+ println("generate projparadata "+name2);
+ );//180602to
tmp=name2+"="+textformat(ptL,5);
parse(tmp);
tmp=name2+"=Projpara("+name3+")";
@@ -451,15 +496,16 @@ Projpara(ptdata,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
- GCLIST=append(GCLIST,[name2,Ltype,opcindy]);
+ GCLIST=append(GCLIST,[name2,Ltype,opcindy]);
);
);
if(length(Out)==1,Out=Out_1);
-// Out=Flattenlist(Out);
if(length(Out)==1,Out=Out_1); // 15.02.24
tmp=[];
forall(Out,
@@ -562,7 +608,7 @@ Spaceline(nm,ptlistorg,optionorg):=(
//help:Spaceline("1",[[2,5,1],[4,2,3]]);
//help:Spaceline([A,B]);
regional(name2,name3,options,Out,tmp,tmp1,tmp2,
- opstr,opcindy,Ltype,Noflg,eqL,ptlist, Msg);
+ opstr,opcindy,Ltype,Noflg,eqL,ptlist, Msg,color);
ptlist=apply(ptlistorg,if(ispoint(#),parse(text(#)+"3d"),#)); // 16.02.10
if(substring(nm,0,2)=="bz",
name2=replace(nm,"bz","bz2d");
@@ -582,6 +628,7 @@ Spaceline(nm,ptlistorg,optionorg):=(
Ltype=tmp_1;
Noflg=tmp_2;
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Msg=1;
forall(eqL,
@@ -620,7 +667,9 @@ Spaceline(nm,ptlistorg,optionorg):=(
);
if(Noflg<2,
if(isstring(Ltype),
- Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
+ Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -636,7 +685,7 @@ Spacecurve(nm,funstr,variable):=Spacecurve(nm,funstr,variable,[]);
Spacecurve(nm,funstr,variable,optionorg):=(
//help:Spacecurve("1","[cos(t),sin(t),0.5*t]","t=[0,4*pi]",["Num=200"]);
regional(name2,name3,options,Out,tmp,tmp1,tmp2,vname,tmpfn,str,Rng,Num,Msg,
- Ec,Exfun,Dc,opstr,opcindy,Fntmp,Vatmp,Ltype,Noflg,eqL,t1,t2,dt,tt,pa,ke);
+ Ec,Exfun,Dc,opstr,opcindy,Fntmp,Vatmp,Ltype,Noflg,eqL,t1,t2,dt,tt,pa,ke,color);
if(substring(nm,0,2)=="bz",
name2=replace(nm,"bz","bz2d");
name3=replace(nm,"bz","bz3d");
@@ -654,6 +703,7 @@ Spacecurve(nm,funstr,variable,optionorg):=(
Ltype=tmp_1;
Noflg=tmp_2;
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Msg=1;
@@ -778,7 +828,9 @@ Spacecurve(nm,funstr,variable,optionorg):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -826,7 +878,7 @@ Partcrv3d(nm,pA,pB,PkLstr,options):=(
dt1=partcrv("",p1,p2,tmp,["nodata"]);
dts=partcrv("",q1,q2,"sub"+tmp,["nodata"]);
dt=apply(1..length(dt1),
- Xyzcoord(dt1_#_1,dt1_#_2,dts_#_2));
+ Xyzcoord(dt1_#_1,dt1_#_2,dts_#_2));
Spaceline("-part3d"+nm,dt,options);
);
@@ -834,7 +886,7 @@ Joincrvs3d(nm,plotstrL):=Joincrvs3d(nm,plotstrL,[]);//16.10.06
Joincrvs3d(nm,plotstrL,options):=(
//help:Joincrvs3d("1",["bz3da1","bz3da1"]);
regional(PtL,Eps,QdL,Flg,Ni,Qd,pP,pS,pQ,pR,rMN,
- opcindy,tmp,tmp1,tmp2,str,name2,name3,Ltype,Noflg);
+ opcindy,tmp,tmp1,tmp2,str,name2,name3,Ltype,Noflg,color);
name2="join2d"+nm;
name3="join3d"+nm;
QdL=[];
@@ -850,6 +902,7 @@ Joincrvs3d(nm,plotstrL,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
if(length(tmp1)>0,Eps=tmp1_1);
@@ -905,7 +958,9 @@ Joincrvs3d(nm,plotstrL,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -926,7 +981,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=(
//help:Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]");
//help:Xyzax3data(Options2=["a1","Osw"]);
regional(name2,name3,Out,tmp,tmp1,tmp2,eqL,reL,strL,
- opstr,opcindy,Ltype,Noflg,Axname,Arrow,Origin);
+ opstr,opcindy,Ltype,Noflg,Axname,Arrow,Origin,color);
name2="ax2d"+nm;
name3="ax3d"+nm;
tmp=Divoptions(options);
@@ -935,6 +990,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=(
eqL=tmp_5;
reL=tmp_6;
strL=tmp_7;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Axname=1;
Arrow=0; // 16.08.14
@@ -994,7 +1050,9 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -1022,6 +1080,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=(
Xyzaxparaname(Xrange,Yrange,Zrange):=
Xyzaxparaname(Xrange,Yrange,Zrange,[]);
Xyzaxparaname(Xrange,Yrange,Zrange,options):=(
+//help:Xyzaxparaname("x=[-5,5]","y=[-5,5]","z=[-5,5]");
regional(tmp,tmp1,tmp2,Eps,Dr,Noflg,Xname,Yname,Zname,
px,qx,py,qy,pz,qz,ph,qh,rr,ch);
Eps=10.0^(-6);
@@ -1030,18 +1089,21 @@ Xyzaxparaname(Xrange,Yrange,Zrange,options):=(
forall(options,
if(isreal(#),Dr=Dr*#);
);
- tmp=indexof(Xrange,"=");
- Xname=substring(Xrange,0,tmp-1);
- tmp=parse(substring(Xrange,tmp,length(Xrange)));
+ tmp1=Strsplit(Xrange,"=");
+ Xname=tmp1_1;
+ tmp=parse(tmp1_2);
px=[tmp_1,0,0]; qx=[tmp_2,0,0];
- tmp=indexof(Yrange,"=");
- Yname=substring(Yrange,0,tmp-1);
- tmp=parse(substring(Yrange,tmp,length(Yrange)));
+ tmp1=Strsplit(Yrange,"=");
+ Yname=tmp1_1;
+ tmp=parse(tmp1_2);
py=[0,tmp_1,0]; qy=[0,tmp_2,0];
- tmp=indexof(Zrange,"=");
- Zname=substring(Zrange,0,tmp-1);
- tmp=parse(substring(Zrange,tmp,length(Zrange)));
+ tmp1=Strsplit(Zrange,"=");
+ Zname=tmp1_1;
+ tmp=parse(tmp1_2);
pz=[0,0,tmp_1]; qz=[0,0,tmp_2];
+ COM2ndlist=select(COM2ndlist,indexof(#,Dqq("$"+Xname+"$"))==0);//180608(3lines)
+ COM2ndlist=select(COM2ndlist,indexof(#,Dqq("$"+Yname+"$"))==0);
+ COM2ndlist=select(COM2ndlist,indexof(#,Dqq("$"+Zname+"$"))==0);
ph=Parapt(px); qh=Parapt(qx); rr=|ph-qh|;
if(rr>Eps,
ch=qh+Dr/rr*(qh-ph);
@@ -1084,7 +1146,7 @@ Embed(nm,Pd2str,funstr,varstr):=
Embed(nm,Pd2str,funstr,varstr,options):=(
//help:Embed("1",["gr1"],"A3d+x*(B3d-A3d)+y*(C3d-A3d)","[x,y]");
regional(name2,name3,Pd2L,Pd2,tmp,tmp1,xstr,ystr,
- Ltype,Noflg,opstr,opcindy,Out);
+ Ltype,Noflg,opstr,opcindy,Out,color);
name2="em2d"+nm;
name3="em3d"+nm;
if(!islist(Pd2str),Pd2L=[Pd2str],Pd2L=Pd2str); // 15.03.06
@@ -1111,6 +1173,7 @@ Embed(nm,Pd2str,funstr,varstr,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Out=[];
forall(Pd2L,Pd2,
@@ -1148,7 +1211,9 @@ Embed(nm,Pd2str,funstr,varstr,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -1259,13 +1324,14 @@ Rotatedata3d(nm,P3data,w1,w2,options):=
Rotate3data(nm,P3data,w1,w2):=Rotate3data(nm,P3data,w1,w2,[]);
Rotate3data(nm,P3data,w1,w2,options):=(
regional(name3,name2,center,pdata,Pd3,Pd,Out,tmp,tmp1,
- Ltype,Noflg,opcindy,opstr);
+ Ltype,Noflg,opcindy,opstr,color);
name3="rot3d"+nm;
name2="rot2d"+nm;
center=[0,0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
@@ -1294,7 +1360,7 @@ Rotate3data(nm,P3data,w1,w2,options):=(
tmp=name2+"="+textformat(tmp1,5);
parse(tmp);
tmp=textformat(P3data,5); // 17.12.23
- tmp=RSform(tmp); // 17.12.23
+ tmp=RSform(tmp,1); //180602
// tmp=replace(tmp,"[","list(");
// tmp=replace(tmp,"]",")");
tmp=name3+"=Rotate3data("+tmp+","
@@ -1305,7 +1371,9 @@ Rotate3data(nm,P3data,w1,w2,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -1353,12 +1421,13 @@ Translatedata3d(nm,P3data,w1,options):=
Translate3data(nm,P3data,w1):=Translate3data(nm,P3data,w1,[]);
Translate3data(nm,P3data,w1,options):=(
regional(name3,name2,pdata,Pd3,Pd,Out,tmp,tmp1,
- Ltype,Noflg,opcindy);
+ Ltype,Noflg,opcindy,color);
name3="tra3d"+nm;
name2="tra2d"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
if(islist(P3data) & isstring(P3data_1),Pd3=P3data,Pd3=[P3data]);
Out=[];
@@ -1382,7 +1451,7 @@ Translate3data(nm,P3data,w1,options):=(
tmp=name2+"="+textformat(tmp1,5);
parse(tmp);
tmp=textformat(P3data,5); // 17.12.23
- tmp=RSform(tmp); // 17.12.23
+ tmp=RSform(tmp,1); // 180602
// tmp=text(P3data);
// tmp=replace(tmp,"[","list(");
// tmp=replace(tmp,"]",")");
@@ -1393,7 +1462,9 @@ Translate3data(nm,P3data,w1,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -2001,7 +2072,7 @@ Bezier3(nm,Ag1,Ag2):=(
);
Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed
regional(name,name3,name2,tmp,tmp1,tmp2,
- Ltype,Noflg,opstr,eqL,Num,ii,knt,ctr,out);
+ Ltype,Noflg,opstr,eqL,Num,ii,knt,ctr,out,color);
name="bz"+nm;
name3="bz3d"+nm;
name2="bz2d"+nm;
@@ -2009,6 +2080,7 @@ Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed
Ltype=tmp_1;
Noflg=tmp_2;
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Num=20;
forall(eqL,
@@ -2062,7 +2134,9 @@ Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -2550,7 +2624,7 @@ Phparadata(nm,nmvf,Arg1):=(
Phparadata(nm,nmvf,vfL,options):=(
//help:Phparadata("1","1",["do"]);
regional(name2,name3,nameh2,nameh3,Ltype,Noflg,eqL,Hidden,
- opstr,opcindy,Outflg,Inflg,pdata1,tmp,tmp1,tmp2);
+ opstr,opcindy,Outflg,Inflg,pdata1,tmp,tmp1,tmp2,color);
name2="php2d"+nm;
name3="php3d"+nm;
nameh2="phh2d"+nm;
@@ -2562,6 +2636,7 @@ Phparadata(nm,nmvf,vfL,options):=(
Outflg=tmp_4;
if(Inflg==0 & Outflg==0, Inflg=1;Outflg=1); // 15.05.15
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Hidden="";
@@ -2606,7 +2681,9 @@ Phparadata(nm,nmvf,vfL,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -2950,7 +3027,7 @@ Nohiddenbyfaces(nm,segstr,facestr,optionorg,optionsh):=(
Faceremovaldata(nm,vfdata,crvdata):=Faceremovaldata(nm,vfdata,crvdata,[]);
Faceremovaldata(nm,vfdata,crvdata,options):=(
regional(name2,name3,nameh2,nameh3,Ltype,Noflg,eqL,Hidden,
- opstr,opcindy,Outflg,Inflg,tmp,tmp1,tmp2);
+ opstr,opcindy,Outflg,Inflg,tmp,tmp1,tmp2,color);
name2="frc2d"+nm;
name3="frc3d"+nm;
nameh2="frch2d"+nm;
@@ -2962,6 +3039,7 @@ Faceremovaldata(nm,vfdata,crvdata,options):=(
Outflg=tmp_4;
if(Inflg==0 & Outflg==0, Inflg=1;Outflg=1); // 15.05.15
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Hidden="";
@@ -2999,7 +3077,9 @@ Faceremovaldata(nm,vfdata,crvdata,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3223,12 +3303,12 @@ Sfbdparadata(nm,fd,options):=
Sfbdparadata(nm,fd,options,["nodisp"]);
Sfbdparadata(nm,fdorg,optionorg,optionsh):=(
//help:Sfbdparadata("1",Fd);
-//help:Sfbdparadata(options2=["Wait=60",division(c(50,50)),Eps1(c(0.01,1)), Eps2(0.05)]);
- regional(fd,options,name2,name3,name2h,name3h,waiting,
+//help:Sfbdparadata(options2=["Wait=60",division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
+ regional(fd,options,name3,name3h,waiting,
eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg);
- name2="sfbd2d"+nm;
+ tmp=ConvertFdtoC(fdorg);//180430(2lines)
+ FuncListC=append(FuncListC,tmp);
name3="sfbd3d"+nm;
- name2h="sfbdh2d"+nm;
name3h="sfbdh3d"+nm;
fname=Fhead+"sfbd"+nm+".txt";
tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#));
@@ -3262,32 +3342,31 @@ Sfbdparadata(nm,fdorg,optionorg,optionsh):=(
options=remove(options,[#]);
);
);
+ cmdL=[]; //180509from
+ tmp=Select(GLIST,indexof(#,"Proj")==0);
+ cmdL=MkprecommandR(tmp);//180509to
tmp=["fd"+nm];
if(length(reL)>0,
reL=textformat(reL,4);
reL=substring(reL,1,length(reL)-1);
- reL=Rsform(reL);
+ reL=RSform(reL);
tmp=append(tmp,reL);
);
- tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2];
- tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]);
-// tmp1=concat(tmp1,[Dqq("CUSPPT"),"CUSPPT"]);
-// tmp1=concat(tmp1,[Dqq("OTHERPARTITION"),"OTHERPARTITION"]);
- tmp2=replace(fname,".txt",".dat"); //18.02.18
- cmdL=[
+ tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h];//180509
+ tmp2=replace(fname,".txt",".Rdata"); //18.02.18
+ cmdL=concat(cmdL,[
"print",[Dqq("fd"+nm)], //18.02.22
"fd"+nm+"="+fd,[],
name3+"=Sfbdparadata",tmp,
- name2+"=Projpara",[name3],
name3h+"=HIDDENDATA",[],
- name2h+"=Projpara",[name3h],
"WriteOutData",tmp1,
"save",["CUSPPT","OTHERPARTITION","file='"+tmp2+"'"]
- ];
+ ]);
tmp=replace(fname,".txt","end.txt");
options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]);
if(wflg==1,options=append(options,"m"));
if(wflg==-1,options=append(options,"r"));
+ options=append(options,"Pre=!G"); //180509
if(ErrFlag==0,
CalcbyR("sfbd"+nm,cmdL,options);
);
@@ -3295,10 +3374,11 @@ Sfbdparadata(nm,fdorg,optionorg,optionsh):=(
err("Sfbdparadata not completed");
,
ReadOutData(fname);
- if(islist(parse(name2)),
- Extractdata(name2,options);
+ if(islist(parse(name3)), //180508(2lines)
+ Extractdata(name3,["nodisp"]);
+ Projpara(name3,options);
if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]);
- Extractdata(name2h,tmp);
+ Projpara(name3h,tmp); //180508
,
ErrFlag=1;
);
@@ -3317,25 +3397,25 @@ Addpoints(ptlist):=(
if(length(ptlist)==0,
ADDPOINT="list()";
,
- ADDPOINT=Rsform(textformat(ptlist,6),2);
+ ADDPOINT=RSform(textformat(ptlist,6),2);
);
ADDPOINT;
);
-Wireparadata(nm,sf,wr1,wr2,fd):=
- Wireparadata(nm,sf,fd,wr1,wr2,[],["nodisp"]);
-Wireparadata(nm,sf,fd,wr1,wr2,options):=
- Wireparadata(nm,sf,fd,wr1,wr2,options,["nodisp"]);
-Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=(
-//help:Wireparadata("1","sfbd3d1",fd,5,5);
-//help:Wireparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
- regional(fd,options,name2,name3,name2h,name3h,outreg,
- eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,flg,wflg);
- name2="wire2d"+nm;
- name3="wiref3d"+nm;
- name2h="wireh2d"+nm;
- name3h="wireh3d"+nm;
- fname=Fhead+"wire"+nm+".txt";
+Crvsfparadata(nm,crv,sf,fd):=
+ Crvsfparadata(nm,crv,sf,fd,[],["nodisp"]);
+Crvsfparadata(nm,crv,sf,fd,options):=
+ Crvsfparadata(nm,crv,sf,fd,options,["nodisp"]);
+Crvsfparadata(nm,crvstr,sfstr,fdorg,optionorg,optionsh):=(
+//help:Crvsfparadata("1","ax3d","sfbd3d1",fd);
+//help:Crvsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
+ regional(gd,out,fd,options,name3,name3h,
+ eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg);
+ tmp=replace(crvstr,"3d","2d");
+ Changestyle(tmp,["nodisp"]);
+ name3="crvsf3d"+nm;
+ name3h="crvsfh3d"+nm;
+ fname=Fhead+"crvsf"+nm+".txt";
rfname=Fhead+sfstr+".txt";
rfname=replace(rfname,"3d","");
tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#));
@@ -3346,7 +3426,7 @@ Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=(
eqL=tmp_5;
reL=tmp_6;
strL=tmp_7;
- waiting=600;
+ waiting=120;
forall(eqL,
tmp=indexof(#,"=");
tmp1=Toupper(substring(#,0,1));
@@ -3369,74 +3449,84 @@ Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=(
options=remove(options,[#]);
);
);
- tmp1=textformat(wr1,6);
- tmp1=Rsform(tmp1,1);
- tmp2=textformat(wr2,6);
- tmp2=Rsform(tmp2,1);
- tmp=[sfstr,"fd"+nm,tmp1,tmp2];
reL=RSform(text(reL),2);
reL=substring(reL,5,length(reL)-1);
+ cmdL=[]; //180509from
+ tmp=Select(GLIST,indexof(#,"Proj")==0);
+ cmdL=MkprecommandR(tmp);//180509to
+ tmp2=replace(rfname,".txt",".Rdata");
+ cmdL=concat(cmdL,[
+ "print",[Dqq("crv"+nm)], //18.02.22
+ "fd"+nm+"="+fd,[],
+ "ReadOutData",[Dqq(rfname)],
+ "load",[Dqq(tmp2)],
+ "Addpoints",[Addpoints()]
+ ]);
+ tmp3=select(GLIST,indexof(#,crvstr+"=")>0); //18.02.22from
+ if(length(tmp3)==0,
+ tmp3=Fhead+crvstr+".txt";
+ tmp3=replace(tmp3,"3d","");
+ cmdL=concat(cmdL,[
+ "ReadOutData",[Dqq(tmp3)]
+ ]);
+ ); //18.02.22to
+ tmp=[crvstr,sfstr,"fd"+nm];
if(length(reL)>0,
reL=textformat(reL,4);
reL=substring(reL,1,length(reL)-1);
reL=Rsform(reL);
tmp=append(tmp,reL);
);
- tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2];
- tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]);
- tmp2=replace(rfname,".txt",".dat");
- cmdL=[
- "print",[Dqq("wire"+nm)], //18.02.22
- "fd"+nm+"="+fd,[],
- "ReadOutData",[Dqq(rfname)],
- "load",[Dqq(tmp2)],
- "Addpoints",[Addpoints()],
- name3+"=Wireparadata",tmp,
- name2+"=Projpara",[name3],
- name3h+"=WIREHIDDENDATA",[],
- name2h+"=Projpara",[name3h],
+ tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name3h),name3h];
+ cmdL=concat(cmdL,[
+ name3+"=Crvsfparadata",tmp,
+ name3h+"=CRVSFHIDDENDATA",[],
"WriteOutData",tmp1
- ];
+ ]);
tmp=replace(fname,".txt","end.txt");
options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]);
- if(wflg==1,options=concat(options,["m"]));
- if(wflg==-1,options=concat(options,["r"]));
+ if(wflg==1,options=append(options,"m"));
+ if(wflg==-1,options=append(options,"r"));
+ options=append(options,"Pre=!G");//180509
if(ErrFlag==0,
- CalcbyR("wire"+nm,cmdL,options);
+ CalcbyR("crvsf"+nm,cmdL,options);
);
if(ErrFlag==1,
- err("Wireparadata not completed");
+ err("Crvsfparadata not completed");
,
ReadOutData(fname);
- if(islist(parse(name2)),
- Extractdata(name2,options);
+ if(islist(parse(name3)), //180507(2lines)
+ Extractdata(name3,["nodisp"]);
+ Projpara(name3,options);
if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]);
- Extractdata(name2h,tmp);
+ Projpara(name3h,tmp);//180507
,
ErrFlag=1;
);
);
);
-Crvsfparadata(nm,crv,sf,fd):=
- Crvsfparadata(nm,crv,sf,fd,[],["nodisp"]);
-Crvsfparadata(nm,crv,sf,fd,options):=
- Crvsfparadata(nm,crv,sf,fd,options,["nodisp"]);
-Crvsfparadata(nm,crvstr,sfstr,fdorg,optionorg,optionsh):=(
-//help:Crvsfparadata("1","ax3d","sfbd3d1",fd);
-//help:Crvsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
- regional(gd,out,fd,options,name2,name3,name2h,name3h,
+Crv3onsfparadata(nm,crv3d,sf,fd):=
+ Crvs3onfparadata(nm,crv3d,sf,fd,[],["nodisp"]);
+Crv3onsfparadata(nm,crv3d,sf,fd,options):=
+ Crv3onsfparadata(nm,crv3d,sf,fd,options,["nodisp"]);
+Crv3onsfparadata(nm,crv3dstr,sfstr,fdorg,optionorg,optionsh):=(
+//help:Crv3onsfparadata("1","sc1","sfbd3d1",fd);
+//help:Crv3onsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
+ regional(gd,out,fd,options,name3,name3h,
eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg);
- tmp=replace(crvstr,"3d","2d");
+ tmp1=replace(crv3dstr,"3d","2d");
+ tmp=apply(GCLIST,#_1);
+ if(contains(tmp,tmp1),
+ Changestyle3d(tmp1,["nodisp"]);//180428
+ );
Changestyle(tmp,["nodisp"]);
- name2="crvsf2d"+nm;
- name3="crvsf3d"+nm;
- name2h="crvsfh2d"+nm;
- name3h="crvsfh3d"+nm;
- fname=Fhead+"crvsf"+nm+".txt";
+ name3="crv3onsf3d"+nm;
+ name3h="crv3onsfh3d"+nm;
+ fname=Fhead+"crv3onsf"+nm+".txt";
rfname=Fhead+sfstr+".txt";
rfname=replace(rfname,"3d","");
- tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#));
+ tmp=apply(fdorg,if(isstring(#),Dqq(#),#));
tmp=text(tmp);
fd=RSform(tmp,2);
options=optionorg;
@@ -3469,73 +3559,68 @@ Crvsfparadata(nm,crvstr,sfstr,fdorg,optionorg,optionsh):=(
);
reL=RSform(text(reL),2);
reL=substring(reL,5,length(reL)-1);
- tmp=[crvstr,sfstr,"fd"+nm];
+ cmdL=[]; //180509from
+ tmp=Select(GLIST,indexof(#,"Proj")==0);
+ cmdL=MkprecommandR(tmp);//180509to
+ tmp=["crv",sfstr,"fd"+nm];
if(length(reL)>0,
reL=textformat(reL,4);
reL=substring(reL,1,length(reL)-1);
reL=Rsform(reL);
tmp=append(tmp,reL);
);
- tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name2),name2];
- tmp1=concat(tmp1,[DqDq(name3h),name3h,DqDq(name2h),name2h]);
- tmp2=replace(rfname,".txt",".dat");
- cmdL=[
- "print",[Dqq("crv"+nm)], //18.02.22
+ tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h];
+ tmp2=replace(rfname,".txt",".Rdata");
+ cmdL=concat(cmdL,[
+ "print",[Dqq("crv3onsf"+nm)], //180222
"fd"+nm+"="+fd,[],
"ReadOutData",[Dqq(rfname)],
- "load",[Dqq(tmp2)],
- "Addpoints",[Addpoints()]
- ];
- tmp3=select(GLIST,indexof(#,crvstr+"=")>0); //18.02.22from
- if(length(tmp3)==0,
- tmp3=Fhead+crvstr+".txt";
- tmp3=replace(tmp3,"3d","");
- cmdL=concat(cmdL,[
- "ReadOutData",[Dqq(tmp3)]
- ]);
- ); //18.02.22until
- cmdL=concat(cmdL,[
- name3+"=Crvsfparadata",tmp,
- name2+"=Projpara",[name3],
- name3h+"=CRVSFHIDDENDATA",[],
- name2h+"=Projpara",[name3h],
+ "load",[Dqq(tmp2)]
+ ]);
+ cmdL=concat(cmdL,[
+ "Addpoints",[Addpoints()],
+ "crv="+crv3dstr,[],
+ name3+"=Crv3onsfparadata",tmp,
+ name3h+"=HIDDENDATA",[],
"WriteOutData",tmp1
]);
tmp=replace(fname,".txt","end.txt");
options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]);
if(wflg==1,options=append(options,"m"));
if(wflg==-1,options=append(options,"r"));
+ options=append(options,"Pre=!G"); //180508
if(ErrFlag==0,
- CalcbyR("crvsf"+nm,cmdL,options);
+ CalcbyR("crv3onsf"+nm,cmdL,options);
);
if(ErrFlag==1,
- err("Crvsfparadata not completed");
+ err("Crv3onsfparadata not completed");
,
ReadOutData(fname);
- if(islist(parse(name2)),
- Extractdata(name2,options);
+ if(islist(parse(name3)),
+ Extractdata(name3,["nodisp"]);
+ Projpara(name3,options); //180507
if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]);
- Extractdata(name2h,tmp);
+ Extractdata(name3h,["nodisp"]);
+ Projpara(name3h,tmp);
,
ErrFlag=1;
);
);
);
-Crvonsfparadata(nm,crv2d,sf,fd):=
- Crvsonfparadata(nm,crv2d,sf,fd,[],["nodisp"]);
-Crvonsfparadata(nm,crv2d,sf,fd,options):=
- Crvonsfparadata(nm,crv2d,sf,fd,options,["nodisp"]);
-Crvonsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=(
-//help:Crvonsfparadata("1",["[1,t]","t=[0,2*pi]","Num=50"],"sfbd3d1",fd);
-//help:Crvonsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
- regional(gd,out,fd,options,name2,name3,name2h,name3h,
+Crv2onsfparadata(nm,crv2d,sf,fd):=
+ Crvs2onfparadata(nm,crv2d,sf,fd,[],["nodisp"]);
+Crv2onsfparadata(nm,crv2d,sf,fd,options):=
+ Crv2onsfparadata(nm,crv2d,sf,fd,options,["nodisp"]);
+Crv2onsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=(
+//help:Crv2onsfparadata("1","pa1","sfbd3d1",fd);
+//help:Crv2onsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
+ regional(gd,out,fd,options,name3,name3h,
eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg);
- name2="crvonsf2d"+nm;
- name3="crvonsf3d"+nm;
- name2h="crvonsfh2d"+nm;
- name3h="crvonsfh3d"+nm;
- fname=Fhead+"crvonsf"+nm+".txt";
+ Changestyle(crv2dstr,["nodisp"]);
+ name3="crv2onsf3d"+nm;
+ name3h="crv2onsfh3d"+nm;
+ fname=Fhead+"crv2onsf"+nm+".txt";
rfname=Fhead+sfstr+".txt";
rfname=replace(rfname,"3d","");
tmp=apply(fdorg,if(isstring(#),Dqq(#),#));
@@ -3578,6 +3663,9 @@ Crvonsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=(
);
reL=RSform(text(reL),2);
reL=substring(reL,5,length(reL)-1);
+ cmdL=[]; //180509from
+ tmp=Select(GLIST,indexof(#,"Proj")==0);
+ cmdL=MkprecommandR(tmp);//180509to
tmp=["crv",sfstr,"fd"+nm];
if(length(reL)>0,
reL=textformat(reL,4);
@@ -3585,37 +3673,141 @@ Crvonsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=(
reL=Rsform(reL);
tmp=append(tmp,reL);
);
- tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2];
- tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]);
- tmp2=replace(rfname,".txt",".dat");
- cmdL=[
- "print",[Dqq("crvonsf"+nm)], //18.02.22
+ tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h];
+ tmp2=replace(rfname,".txt",".Rdata");
+ cmdL=concat(cmdL,[
+ "print",[Dqq("crv2onsf"+nm)], //18.02.22
"fd"+nm+"="+fd,[],
"ReadOutData",[Dqq(rfname)],
- "load",[Dqq(tmp2)],
+ "load",[Dqq(tmp2)]
+ ]);
+ cmdL=concat(cmdL,[
"Addpoints",[Addpoints()],
- "crv="+crv,[],
- name3+"=Crvonsfparadata",tmp,
- name2+"=Projpara",[name3],
+ "crv="+crv2dstr,[],
+ name3+"=Crv2onsfparadata",tmp,
name3h+"=HIDDENDATA",[],
- name2h+"=Projpara",[name3h],
"WriteOutData",tmp1
- ];
+ ]);
tmp=replace(fname,".txt","end.txt");
options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]);
if(wflg==1,options=append(options,"m"));
if(wflg==-1,options=append(options,"r"));
+ options=append(options,"Pre=!G"); //180508
+ if(ErrFlag==0,
+ CalcbyR("crv2onsf"+nm,cmdL,options);
+ );
+ if(ErrFlag==1,
+ err("Crv2onsfparadata not completed");
+ ,
+ ReadOutData(fname);
+ if(islist(parse(name3)),
+ Extractdata(name3,["nodisp"]);
+ Projpara(name3,options); //180507
+ if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]);
+ Projpara(name3h,tmp);
+ ,
+ ErrFlag=1;
+ );
+ );
+);
+
+Wireparadata(nm,sf,wr1,wr2,fd):=
+ Wireparadata(nm,sf,fd,wr1,wr2,[],["nodisp"]);
+Wireparadata(nm,sf,fd,wr1,wr2,options):=
+ Wireparadata(nm,sf,fd,wr1,wr2,options,["nodisp"]);
+Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=(
+//help:Wireparadata("1","sfbd3d1",fd,5,5);
+//help:Wireparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
+ regional(fd,options,name3,name3h,outreg,
+ eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,flg,wflg);
+ name3="wire3d"+nm;
+ name3h="wireh3d"+nm;
+ fname=Fhead+"wire"+nm+".txt";
+ rfname=Fhead+sfstr+".txt";
+ rfname=replace(rfname,"3d","");
+ tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#));
+ tmp=text(tmp);
+ fd=RSform(tmp,2);
+ options=optionorg;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ reL=tmp_6;
+ strL=tmp_7;
+ waiting=600;
+ forall(eqL,
+ tmp=indexof(#,"=");
+ tmp1=Toupper(substring(#,0,1));
+ tmp2=substring(#,tmp,length(#));
+ if(tmp1=="W",
+ waiting=parse(tmp2);
+ options=remove(options,[#]);
+ );
+ );
+ options=remove(options,reL);
+ wflg=0;
+ forall(strL,
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="M",
+ wflg=1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="R",
+ wflg=-1;
+ options=remove(options,[#]);
+ );
+ );
+ tmp1=textformat(wr1,6);
+ tmp1=Rsform(tmp1,1);
+ tmp2=textformat(wr2,6);
+ tmp2=Rsform(tmp2,1);
+ tmp=[sfstr,"fd"+nm,tmp1,tmp2];
+ reL=RSform(text(reL),2);
+ reL=substring(reL,5,length(reL)-1);
+ cmdL=[]; //180509from
+ tmp=Select(GLIST,indexof(#,"Proj")==0);
+ cmdL=MkprecommandR(tmp);//180509to
+ tmp1=textformat(wr1,6);
+ tmp1=Rsform(tmp1,1);
+ tmp2=textformat(wr2,6);
+ tmp2=Rsform(tmp2,1);
+ tmp=[sfstr,"fd"+nm,tmp1,tmp2];
+ reL=RSform(text(reL),2);
+ reL=substring(reL,5,length(reL)-1);
+ if(length(reL)>0,
+ reL=textformat(reL,4);
+ reL=substring(reL,1,length(reL)-1);
+ reL=Rsform(reL);
+ tmp=append(tmp,reL);
+ );
+ tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h];
+ tmp2=replace(rfname,".txt",".Rdata");
+ cmdL=concat(cmdL,[
+ "print",[Dqq("wire"+nm)], //18.02.22
+ "fd"+nm+"="+fd,[],
+ "ReadOutData",[Dqq(rfname)],
+ "load",[Dqq(tmp2)],
+ "Addpoints",[Addpoints()],
+ name3+"=Wireparadata",tmp,
+ name3h+"=WIREHIDDENDATA",[],
+ "WriteOutData",tmp1
+ ]);
+ tmp=replace(fname,".txt","end.txt");
+ options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]);
+ if(wflg==1,options=concat(options,["m"]));
+ if(wflg==-1,options=concat(options,["r"]));
+ options=append(options,"Pre=!G"); //180508
if(ErrFlag==0,
- CalcbyR("crvonsf"+nm,cmdL,options);
+ CalcbyR("wire"+nm,cmdL,options);
);
if(ErrFlag==1,
- err("Crvonsfparadata not completed");
+ err("Wireparadata not completed");
,
ReadOutData(fname);
- if(islist(parse(name2)),
- Extractdata(name2,options);
+ if(islist(parse(name3)),
+ Extractdata(name3,["nodisp"]);
+ Projpara(name3,options);
if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]);
- Extractdata(name2h,tmp);
+ Projpara(name3h,tmp);
,
ErrFlag=1;
);
@@ -3716,16 +3908,20 @@ Sfcutparadata(nm,eqstr,sf,fd):=
Sfcutparadata(nm,eqstr,sf,fd,[]);
Sfcutparadata(nm,eqstr,sf,fd,options):=
Sfcutparadata(nm,eqstr,sf,fd,options,["nodisp"]);
-Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=(
-//help:Sfcutparadata("1","x+y+z=1","sfbd3d1",fd,"x+y+z=1");
-//help:Sfcutparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
- regional(gd,out,fd,options,name2,name3,name2h,name3h,
+Sfcutparadata(nm,eqstrorg,sf,fdorg,optionorg,optionsh):=(
+//help:Sfcutparadata("1","x+y+z=1","sfbd3d1",fd);
+//help:Sfcutparadata(options2=[Division(c(50,50)),Eps1(0.01), Eps2(0.05)]);
+ regional(gd,out,fd,options,name3,name3h,eqstr,
eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg);
+ tmp=Strsplit(eqstrorg,"=");
+ if(length(tmp)==1,
+ eqstr=tmp_1;
+ ,
+ eqstr=tmp_1+"-("+tmp_2+")";
+ );
tmp=replace(sfcut,"3d","2d");
Changestyle(tmp,["nodisp"]);
- name2="sfcut2d"+nm;
name3="sfcut3d"+nm;
- name2h="sfcuth2d"+nm;
name3h="sfcuth3d"+nm;
fname=Fhead+"sfcut"+nm+".txt";
rfname=Fhead+sf+".txt";
@@ -3763,6 +3959,9 @@ Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=(
);
reL=RSform(text(reL),2);
reL=substring(reL,5,length(reL)-1);
+ cmdL=[]; //180509from
+ tmp=Select(GLIST,indexof(#,"Proj")==0);
+ cmdL=MkprecommandR(tmp);//180509to
tmp=[Dqq(eqstr),sf,"fd"+nm];
if(length(reL)>0,
reL=textformat(reL,4);
@@ -3770,24 +3969,22 @@ Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=(
reL=Rsform(reL);
tmp=append(tmp,reL);
);
- tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name2),name2];
- tmp1=concat(tmp1,[DqDq(name3h),name3h,DqDq(name2h),name2h]);
- tmp2=replace(rfname,".txt",".dat");
- cmdL=[
+ tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name3h),name3h];
+ tmp2=replace(rfname,".txt",".Rdata");
+ cmdL=concat(cmdL,[
"print",[Dqq("sfcut"+nm)], //18.02.22
"fd"+nm+"="+fd,[],
"ReadOutData",[Dqq(rfname)],
"load",[Dqq(tmp2)],
name3+"=Sfcutparadata",tmp,
- name2+"=Projpara",[name3],
name3h+"=CRVONSFHIDDENDATA",[],
- name2h+"=Projpara",[name3h],
"WriteOutData",tmp1
- ];
+ ]);
tmp=replace(fname,".txt","end.txt");
options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]);
if(wflg==1,options=append(options,"m"));
if(wflg==-1,options=append(options,"r"));
+ options=append(options,"Pre=!G"); //180508
if(ErrFlag==0,
CalcbyR("sfcut"+nm,cmdL,options);
);
@@ -3795,10 +3992,11 @@ Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=(
err("Sfcutparadata not completed");
,
ReadOutData(fname);
- if(islist(parse(name2)),
- Extractdata(name2,options);
+ if(islist(parse(name3)),
+ Extractdata(name3,["nodisp"]);
+ Projpara(name3,options);
if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]);
- Extractdata(name2h,tmp);
+ Projpara(name3h,tmp);
,
ErrFlag=1;
);
@@ -3826,7 +4024,7 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=(
//help:Skeletonparadata("1");
//help:Skeletonparadata("1",[pdata1,pdata2],[pdata3]);
//help:Skeletondata(options2=[1(width)]);
- regional(Eps,Eps2,name2,name3,Ltype,Noflg,reL,opcindy,
+ regional(Eps,Eps2,name2,name3,Ltype,Noflg,reL,opcindy,color,
Data,Out,ObjL,Plt3L,Rr,pltdata1,pltdata2,Plt2L,ObjL,ii,Data,
Obj3,jj,Gd,PtD,size,tmp,tmp1,tmp2);
name2="sk2d"+nm;
@@ -3845,7 +4043,8 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=(
Ltype=tmp_1;
Noflg=tmp_2;
reL=tmp_6; //16.02.28
- opcindy=tmp_9;
+ color=tmp_(length(tmp)-2);
+ opcindy=tmp_(length(tmp));
Rr=0.15*1000/2.54/MilliIn;
size=1;
Eps2=0.05;
@@ -3880,7 +4079,9 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4020,7 +4221,7 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=(
//help:Skeletondatacindy(options2=[1(width)]);
regional(Eps,Eps2,name2,name3,Ltype,Noflg,reL,opcindy,
Out,ObjL,Plt3L,Rr,pltdata1,pltdata2,Plt2L,ObjL,ii,Data,
- Obj3,jj,Gd,PtD,size,tmp,tmp1,tmp2);
+ Obj3,jj,Gd,PtD,size,tmp,tmp1,tmp2,color);
name2="sk2d"+nm;
name3="sk3d"+nm;
pltdata1=[];// 16.01.31
@@ -4037,7 +4238,8 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=(
Ltype=tmp_1;
Noflg=tmp_2;
reL=tmp_6; //16.02.28
- opcindy=tmp_9;
+ color=tmp_(length(tmp)-2);
+ opcindy=tmp_(length(tmp));
Rr=0.075*1000/2.54/MilliIn;
size=1;
Eps2=0.05;
@@ -4092,7 +4294,9 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name2);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt
index d815618a97a..4f23caa52b0 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt
@@ -1,3 +1,48 @@
+//20180613
+// Shade changed ( name, pointlist supported, Com2nd("before"))
+// Shade debugged (color,opcindy)
+// WritetoRS changed (for COM2ndlistb)
+//20180612
+// Com2nd changed ("before" options added )
+//20180609
+// Ketinit changed (CommonMake added )
+//20180608
+// Ketinit changed (Namecdy defined )
+//20180606
+// Changework debugged ( case where "Sub=n" )
+//20180605
+// Changework changed ( "Sub=n" option supported )
+//20180603
+// Shade changed ( option density supported )
+// Addcolor removed
+// Setcolor(color,option),Setcolorrgb removed
+// Setcolor renewed
+// Divoptions degugged (KCOLOR)
+// Listplot,... changed (KCOLOR)
+// Pointdata changed (color)
+//20180602
+// Divoptions changed ( "Color=" supported )
+// Changestyle,.... changed ("Color=" supported)
+// Changetyle changed (case in which name not found)
+// Shade debugged ( color )
+// Rotatedata,... degugged ( for list of plotdata )
+//20180530
+// Anglemark changed (opstr,Brat=1.2)
+// Pointdata degugged (for single point)
+//20180527
+// Deqplot changed ( ' as default )
+//20180513
+// Setunitlen debugged ( string => UI )
+//20180506
+// Anglemark changed ( [A,B,angle] supported )
+//20180505
+// Strsplit added
+//20180501
+// MeasureDepth debugged ( for blank list )
+//20180420
+// Ketinit changed ( Changesetting moved to ketoutset.txt )
+//20180413
+// Ketinit changed ( utf for windows removed )
//20180408
// Divoptions changed ( to remove null string )
// Changework changed (nkfwin)
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs
index f45ffee8d7a..024f9df129b 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs
@@ -14,9 +14,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("KETCindy V.3.2.0(20180409)");
-println(ketjavaversion());//17.06.05
-println("ketcindylibbasic1(20180408) loaded");
+println("KeTCindy V.3.2.1(20180614)");
+println(ketjavaversion());
+println("ketcindylibbasic1(20180613) loaded");
//help:start();
@@ -48,7 +48,7 @@ Ketinit(sy,rangex,rangey):=(
MEMORIInit=MEMORI;
MEMORINow=MEMORI;
MARKLEN=0.05;
- MARKLENInit=MARKLEN:
+ MARKLENInit=MARKLEN; //180504
MARKLENNow= MARKLEN;
GENTEN=[0,0];//18.01.15until
KETPICLAYER=20;
@@ -72,10 +72,12 @@ Ketinit(sy,rangex,rangey):=(
COM0thlist=[];
COM1stlist=[];
COM2ndlist=[];
+ COM2ndlistb=[]; //180612
ADDAXES="1";
LFmark=unicode("000a");
CRmark=unicode("000d");//16.12.13
Dq=unicode("0022");
+ CommonMake=0;//180610
WaitUnit=10;
CONTINUED=0;
OutComList=[];
@@ -90,6 +92,7 @@ Ketinit(sy,rangex,rangey):=(
Slidename=Fhead; //17.10.24
);//17.11.12
Dircdy=replace(Dircdy,"%E3%80%80"," ");//180405
+ Namecdy=Cindyname();//180608
tmp1=Indexall(Dircdy,"%"); //180329from
if(length(tmp1)>0,
tmp1=append(tmp1,length(Dircdy));
@@ -106,9 +109,9 @@ Ketinit(sy,rangex,rangey):=(
if(substring(Dircdy,0,1)==pathsep(),
Dircdy=substring(Dircdy,1,length(Dircdy));
);
- Changesetting([gethome(), gethome()+"\Desktop","C:"]); //180405
+// Changesetting([gethome(), gethome()+"\Desktop","C:"]); //180405
,
- Changesetting([gethome(),gethome()+"/Desktop"]);
+// Changesetting([gethome(),gethome()+"/Desktop"]);
);
Changework(Dircdy+pathsep()+"fig"); //180329to
Fnametex=Fhead+".tex";
@@ -186,7 +189,7 @@ Changesetting(dirL):=( //180329
Cindyname():=Getcdyname();
Cdyname():=Getcdyname();
Getcdyname():=( //17.12.27
-//help:Cdyname();
+//help:Cindyname();
regional(out);
out=text(curkernel());
out=replace(out,".cdy","");
@@ -436,6 +439,18 @@ Indexall(str,key):=(
out;
);
+Strsplit(str,key):=( //180505
+ regional(start,out,tmp1,tmp2);
+ tmp1=Indexall(str,key);
+ out=[]; start=0;
+ forall(tmp1,
+ out=append(out,substring(str,start,#-1));
+ start=#;
+ );
+ out=append(out,substring(str,start,length(str)));
+ out;
+);
+
Parlevel(str):=Bracket(str); // 16.05.22from
Bracket(str):=Bracket(str,"()");
Bracket(str,br):=(
@@ -559,9 +574,24 @@ Pardiagram(str,options):=(
out;
);
-Changework(dirorg):=( //16.10.21
+Changework(dirorg):=Changework(dirorg,["Sub=y"]);
+Changework(dirorg,options):=( //16.10.21
//help:Changework(directory);
- regional(dir,subdir,tmp);
+//help:Changework(Dircdy+"fig");
+//help:Changework(options=["Sub=y"]);
+ regional(dir,subdir,tmp,,eqL,makesub);
+ tmp=Divoptions(options);
+ eqL=tmp_5; //180605from
+ makesub=1;
+ forall(eqL,
+ tmp=Strsplit(#,"=");
+ if(Toupper(tmp_1)=="SUB",
+ tmp=Toupper(tmp_2);
+ if(substring(tmp,0,1)=="N",
+ makesub=0;
+ );
+ );
+ ); //180605to
dir=replace(dirorg,"/",pathsep());//17.11.20from
dir=replace(dir,"\",pathsep());
dir=replace(dir,pathsep()+pathsep(),pathsep());//17.11.24
@@ -577,11 +607,14 @@ Changework(dirorg):=( //16.10.21
dir=substring(dir,0,tmp-1);
); //17.11.24until
if(dir=="" % !isexists(dir,""),
- println("Directory "+dir+" not exist, so set to "+Dirwork);
+ println("Directory "+dir+" not exist, so set to "+Dircdy);//180604(2lines)
+ Dirwork=Dircdy;
ErrFlag=-1;
,
- if(length(subdir)>0, //17.11.24from
- println(makedir(dir,subdir));
+ if(length(subdir)>0, //180605
+ if(makesub==1,//180606from
+ println(makedir(dir,subdir));
+ );//180606
Dirwork=dir+pathsep()+subdir;
,
Dirwork=dir;
@@ -593,37 +626,36 @@ Changework(dirorg):=( //16.10.21
closefile(SCEOUTPUT);
println(setexec(Dirwork,"/kc.sh"));
);
- ,
- if(isincludefull(Dirwork),//180408from
- SCEOUTPUT = openfile("utf8.txt");
- println(SCEOUTPUT,"tmp="+Dqq(Dirwork)+";");
- closefile(SCEOUTPUT);
- nkfwin("C:",Dirwork,"utf8.txt","sjis.txt");//180408to
- );
);
);
);
Changestyle(nameL,style):=(
//help:Changestyle(["sgAB"],["da"]);
- regional(nmL,name,Ltype,Ltypeorg,Noflg,opcindy,tmp);
+ regional(nmL,name,Ltype,Ltypeorg,Noflg,color,opcindy,tmp);
tmp=Divoptions(style);
Ltypeorg=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(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)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13
- if(Noflg<2,
- if(isstring(Ltype),
- Ltype=GetLinestyle(text(Noflg)+Ltype,name);
- ,
- if(Noflg==1,Ltype=0);
+ tmp=select(GCLIST,#_1==name);
+ if(length(tmp)>0,
+ Ltype=Ltypeorg;
+ GCLIST=select(GCLIST,#_1!=name);
+ COM2ndlist=select(COM2ndlist,
+ (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13
+ if(Noflg<2,
+ if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
+ Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
+ ,
+ if(Noflg==1,Ltype=0);
+ );
+ GCLIST=append(GCLIST,[name,Ltype,opcindy]);
);
- GCLIST=append(GCLIST,[name,Ltype,opcindy]);
);
);
);
@@ -908,24 +940,26 @@ MeasureDepth(list):=(
regional(tmp,tmp1,Depth,Flg);
Flg=0;
Depth=0;
- if(ispoint(list), // 15.01.22
- Depth=0;
- Flg=1;
- ,
- tmp1=select(1..(length(list)),length(list_#)>0);//17.05.21from
- tmp=list_(tmp1_1);//17.05.21until
- );
- repeat(4,
- if(Flg==0,
- if(islist(tmp),
- tmp=tmp_1;
- Depth=Depth+1;
- ,
- if(ispoint(tmp),Depth=Depth+1);
- Flg=1;
+ if(length(list)>0, //180501
+ if(ispoint(list),
+ Depth=0;
+ Flg=1;
+ ,
+ tmp1=select(1..(length(list)),length(list_#)>0);//17.05.21from
+ tmp=list_(tmp1_1);//17.05.21until
+ );
+ repeat(4,
+ if(Flg==0,
+ if(islist(tmp),
+ tmp=tmp_1;
+ Depth=Depth+1;
+ ,
+ if(ispoint(tmp),Depth=Depth+1);
+ Flg=1;
+ );
);
);
- );
+ );//180501
Depth;
);
@@ -953,7 +987,7 @@ Flattenlist(pltlist):=(
Divoptions(options):=(
//help:Divoptions(options);
- regional(Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy,flg,tmp,tmp1);
+ regional(Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,color,opstr,opcindy,flg,tmp,tmp1,tmp2);
Ltype="dr"; // 2015.01.13
Noflg=0;
Inflg=0;
@@ -961,6 +995,7 @@ Divoptions(options):=(
eqL=[];
realL=[];
strL=[];
+ color=KCOLOR; //180603
opstr="";
opcindy="";
forall(options,
@@ -974,7 +1009,31 @@ Divoptions(options):=(
);
if(flg==0,
if(indexof(#,"=")>0,
- eqL=append(eqL,#);
+ tmp=Strsplit(#,"="); //180602from
+ tmp1=Toupper(tmp_1);
+ tmp2=tmp_2;
+ if(tmp1=="COLOR",
+ if(substring(tmp2,0,1)=="[",
+ tmp1=parse(tmp2);
+ color=tmp1;
+ if(length(tmp1)==4,
+ tmp1=colorCmyk2Rgb(tmp1);
+ );
+ ,
+ if(tmp2=="red",tmp1=[1,0,0];color=tmp1);
+ if(tmp2=="green",tmp1=[0,1,0];color=tmp1);
+ if(tmp2=="blue",tmp1=[0,0,1];color=tmp1);
+ if(tmp2=="black",tmp1=[0,0,0];color=tmp1);
+ if(tmp2=="white",tmp1=[1,1,1];color=tmp1);
+ if(tmp2=="cyan",tmp1=[0,1,1];color=tmp1);
+ if(tmp2=="magenta",tmp1=[1,0,1];color=tmp1);
+ if(tmp2=="yellow",tmp1=[1,1,0];color=tmp1);
+ );
+ tmp="color->"+text(tmp1);
+ opcindy=opcindy+","+tmp;
+ ,
+ eqL=append(eqL,#);
+ );//180602to
flg=1;
);
);
@@ -1032,9 +1091,9 @@ Divoptions(options):=(
);
);
if(indexof(opcindy,"color->")==0,// 16.10.07from
- opcindy=opcindy+",color->[0,0,0]";
+ opcindy=opcindy+",color->"+text(KCOLOR);
);
- [Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy];
+ [Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,color,opstr,opcindy];
);
Dotprod(vec1,vec2):=(
@@ -2229,11 +2288,17 @@ Com1st(String):=(
// COM1stlist=append(COM1stlist,str);
);
-Com2nd(String):=(
-// help:Com2nd("");
- regional(str);
- str=replace(String,LFmark,"");
+Com2nd(String):=Com2nd(String,["a"]);//180612
+Com2nd(String,option):=(
+// help:Com2nd(str,["before"]);
+ regional(str,tmp);
+ str=replace(String,LFmark,"");
+ tmp=substring(option_1,0,1);//180612from
+ if(Toupper(tmp)=="B",
+ COM2ndlistb=append(COM2ndlistb,str);
+ ,
COM2ndlist=append(COM2ndlist,str);
+ );//180612to
);
Com2ndpre(String):=(
@@ -2306,6 +2371,7 @@ Setunitlen():=(
println(ULEN);
);
Setunitlen(UI):=(
+//help:Setunitlen("1.5cm");
regional(Dx,Dy,Sym,SL,OL,Is,VL,Ucode,ii,cha,
str,Unit,Valu,flg,tmp);
Dx=XMAX-XMIN;
@@ -2315,7 +2381,7 @@ Setunitlen(UI):=(
OL="+-*/";
if(length(UI)>0,
ULEN=UI;
- GLIST=append(GLIST,"Setunitlen("+Dq+string+Dq+")");
+ GLIST=append(GLIST,"Setunitlen("+Dq+UI+Dq+")");//180513
);
Is=1;
VL="";
@@ -2484,46 +2550,33 @@ Definecolor(name,data):=(
Texcom(tmp);
);
-Setcolor(Par):=(
+Setcolor(parorg):=( //180603renew
//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);
- Texcom("\color[cmyk]{"+tmp+"}"); //17.09.22
- );
-);
-
-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+")"; //17.10.07
- Com2nd(tmp);
+ regional(par,cstr,tmp,tmp1);
+ par=parorg;
+ if(isstring(par),
+ if(par=="black",par=[0,0,0]);
+ if(par=="white",par=[1,1,1]);
+ if(par=="red",par=[1,0,0]);
+ if(par=="green",par=[0,1,0]);
+ if(par=="blue",par=[0,0,1]);
+ if(par=="cyan",par=[0,1,1]);
+ if(par=="magenta",par=[1,0,1]);
+ if(par=="yellow",par=[1,1,0]);
+ );
+ cstr=text(par);
+ cstr=substring(cstr,1,length(cstr)-1);
+ if(length(par)==3,
+ cstr="Texcom('\\color[rgb]{"+cstr+"}')";
+ KCOLOR=par;
+ );
+ if(length(par)==4,
+ cstr="Texcom('\\color[cmyk]{"+cstr+"}')";
+ tmp=ColorCmyk2Rgb(par);
+ KCOLOR=tmp;
+ );
+ Com2nd(cstr);
);
ColorRgb2Cmyk(clr):=(
@@ -2815,30 +2868,6 @@ Colorcode(src,dest,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,
@@ -2974,23 +3003,12 @@ Chunderscore(str):=(
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);
+ tmp,tmp1,tmp2,tmp3,color);
if(substring(nm,0,1)=="-",
name=substring(nm,1,length(nm));
,
@@ -2999,7 +3017,8 @@ AddGraph(nm,pltdata,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
- opcindy=tmp_9;
+ color=tmp_(length(tmp)-2);
+ opcindy=tmp_(length(tmp));
if(isstring(pltdata),
pdata=parse(pltdata)
,
@@ -3072,7 +3091,9 @@ AddGraph(nm,pltdata,options):=(
); // 16.04.04 until
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3084,7 +3105,7 @@ 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);
+ opcindy,tmp,tmp1,tmp2,str,name,Ltype,Noflg,color);
name="join"+nm;
plotlist=[];
forall(plotstrL,str,
@@ -3100,6 +3121,7 @@ Joincrvs(nm,plotstrL,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
if(length(tmp1)>0,Eps=tmp1_1);
@@ -3162,7 +3184,9 @@ Joincrvs(nm,plotstrL,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3176,7 +3200,7 @@ 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);
+ opcindy,Ta,Tb,name,Ltype,Noflg,DepthFlg,color);
name="part"+nm;
if(isstring(PkLstr),PkL=parse(PkLstr),PkL=PkLstr);
DepthFlg=0;
@@ -3188,6 +3212,7 @@ Partcrv(nm,pA,pB,PkLstr,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Eps=10^(-3);
Flg=0;
@@ -3246,7 +3271,9 @@ Partcrv(nm,pA,pB,PkLstr,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3271,17 +3298,18 @@ Pointdata(nm,listorg,options):=(
//help:Pointdata("1",[2,4],["Size=5"]);
//help:Pointdata("2",[[2,3],[4,1]]);
regional(list,name,nameL,ptlist,opstr,opcindy,
- eqL,size,thick,tmp,tmp1,tmp2,tmp3,Ltype,Noflg);
+ eqL,size,thick,tmp,tmp1,tmp2,tmp3,Ltype,Noflg,color);
name="pt"+nm;
nameL=name+"L";
println("generate pointdata "+name);
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ eqL=tmp_5;
opcindy=tmp_(length(tmp));
opstr=tmp_(length(tmp)-1);
+ color=tmp_(length(tmp)-2);
size="";
- eqL=tmp_5;
if(length(eqL)>0,
forall(eqL,
tmp=substring(#,0,1);
@@ -3292,6 +3320,7 @@ Pointdata(nm,listorg,options):=(
);
);
if(isstring(listorg),list=parse(listorg),list=listorg); //17.10.23
+ if(MeasureDepth(list)==0,list=[list]);//180530
tmp=MeasureDepth(list);
if(tmp>0, // 2015.02.21
if(tmp==1,ptlist=list,ptlist=list_1);
@@ -3337,7 +3366,9 @@ Pointdata(nm,listorg,options):=(
if(length(size)>0,tmp1=parse(size),tmp1=1);
tmp1=max(tmp1,1)/8;
Setpen(tmp1); // 16.04.09 until
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Drwpt(list("+name+")"+opstr+")");
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
Setpen(thick); // 16.04.09
if(length(size)>0,
Com2nd("Setpt("+textformat(TenSize/TenSizeInit,1)+")");
@@ -3352,7 +3383,7 @@ Listplot(nm,list,options):=(
// 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);
+ regional(name,tmp,tmp1,ptlist,Ltype,opcindy,Noflg,eqL,Msg,color);
if(substring(nm,0,1)=="-", // 16.01.27 from
name=substring(nm,1,length(nm));
,
@@ -3362,6 +3393,7 @@ Listplot(nm,list,options):=(
Ltype=tmp_1;
Noflg=tmp_2;
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Msg=1; // 15.09.17
forall(eqL,
@@ -3386,7 +3418,9 @@ Listplot(nm,list,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3417,13 +3451,14 @@ 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);
+ Vec,pA,pB,Ltype,Noflg,color);
name="ln"+nm;
Mag=100;
Semi="";
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
opstr=tmp_(length(tmp)-1);
tmp1=tmp_6;
@@ -3450,7 +3485,9 @@ Lineplot(nm,list,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3483,7 +3520,7 @@ Plotdata(name1,func,variable,options):=(
//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);
+ Ltype,Noflg,Inflg,Outflg,opstr,opcindy,color);
name="gr"+name1;
tmp=Divoptions(options);
Ltype=tmp_1;
@@ -3491,6 +3528,7 @@ Plotdata(name1,func,variable,options):=(
Inflg=tmp_3;
Outflg=tmp_4;
opstr=tmp_(length(tmp)-1);
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
eqL=tmp_5;
Num=50;
@@ -3617,8 +3655,10 @@ Plotdata(name1,func,variable,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
- ,
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
+ ,
if(Noflg==1,Ltype=0);
);
GCLIST=append(GCLIST,[name,Ltype,opcindy]);
@@ -3627,7 +3667,9 @@ Plotdata(name1,func,variable,options):=(
,
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3643,7 +3685,7 @@ 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);
+ Ltype,Noflg,Inflg,Outflg,opstr,opcindy,color);
name="gp"+name1;
Eps=10^(-4);
tmp=Divoptions(options);
@@ -3651,6 +3693,7 @@ Paramplot(name1,funstr,variable,options):=(
Noflg=tmp_2;
Inflg=tmp_3;
Outflg=tmp_4;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
eqL=tmp_5;
@@ -3760,7 +3803,9 @@ Paramplot(name1,funstr,variable,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3770,7 +3815,9 @@ Paramplot(name1,funstr,variable,options):=(
,
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3850,7 +3897,7 @@ Implicitplot(name1,func,xrng,yrng,options):=(
//help:Implicitplot("1","x^2+x*y+y^2=1","x=[-3,3]","y=[-3,3]");
//help:Implicitplot(options=["Num=[50,50]"]);
regional(name,Fn,varx,vary,rngx,rngy,Mdv,Ndv,tmp,tmp1,tmp2,
- Eps,Ltype,Noflg,eqL,opsr,opcindy,dx,dy,out,jj,ii,kk,
+ Eps,Ltype,Noflg,eqL,color,opsr,opcindy,dx,dy,out,jj,ii,kk,
yval1,yval2,xval1,xval2,eval11,eva12,eval21,eval22,pL,vL,qL);
name="imp"+name1;
Eps=10^(-4);
@@ -3858,6 +3905,7 @@ Implicitplot(name1,func,xrng,yrng,options):=(
Ltype=tmp_1;
Noflg=tmp_2;
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Mdv=50;Ndv=50;
@@ -3961,7 +4009,9 @@ Implicitplot(name1,func,xrng,yrng,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3990,15 +4040,16 @@ Circledata(para1,para2):=(
Circledata(name,cenrad,options);
);
Circledata(nm,cenrad,options):=(
- regional(name,Out,Ctr,Ptcir,ra,Num,Rg,opstr,opcindy,
+ regional(name,Out,Ctr,Ptcir,ra,Num,Rg,opstr,opcindy,color,
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;
+ eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
- eqL=tmp_5;
Num=50;
Rg=[0,2*pi];
forall(eqL,
@@ -4065,7 +4116,9 @@ Circledata(nm,cenrad,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4107,11 +4160,12 @@ Framedata(nm,list,options):=(
//help:Framedata("1",[C,A]);
//help:Framedata("1",[C,dx,dy]);
regional(name,Out,tmp,tmp1,pB,x1,x2,y1,y2,dx,dy,
- opcindy,Ltype,Noflg,cent,dx,dy);
+ opcindy,Ltype,Noflg,cent,dx,dy,color);
name="fr"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
if(length(list)==2, // 15.05.12
pA=Lcrd(list_1); pB=Lcrd(list_2);
@@ -4132,7 +4186,9 @@ Framedata(nm,list,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4142,11 +4198,12 @@ Framedata(nm,list,options):=(
);
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);
+ regional(name,Out,tmp,tmp1,x1,y1,x2,y2,Ltype,opcindy,Noflg,color);
name="fr"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
x1=cent.x-dx; x2=cent.x+dx;
y1=cent.y-dy; y2=cent.y+dy;
@@ -4160,7 +4217,9 @@ Framedata(nm,cent,dx,dy,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4183,11 +4242,12 @@ 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);
+ opstr,opcindy,tmp,tmp1,tmp2,tmp3,Ltype,Noflg,color);
name="ov"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
opstr=tmp_(length(tmp)-1);
Rc=0.2;
@@ -4226,7 +4286,9 @@ Ovaldata(nm,Pdata,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4240,7 +4302,7 @@ Ovaldata(nm,Pdata,options):=(
);
Segmark(nm,ptlist):=Segmark(nm,ptlist,[]);
-Segmark(nm,ptlist,options):=Drawsegmark(nm,ptlist,options);
+Segmark(nm,ptlist,options):=Drawsegmark(nm,ptlist,options,color);
Drawsegmark(nm,ptlist):=Drawsegmark(nm,ptlist,[]);
Drawsegmark(nm,ptlist,options):=(
//help:Segmark("1",[A,B]);
@@ -4255,6 +4317,7 @@ Drawsegmark(nm,ptlist,options):=(
tp=1;
tmp1=Divoptions(options);
eqL=tmp1_5;
+ color=tmp_(length(tmp)-2);
forall(eqL,
tmp=indexof(#,"=");
tmp1=substring(#,tmp,length(#));
@@ -4516,7 +4579,7 @@ Putintersect(nm,pdata1,pdata2,ptno):=(
Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]);
Arrowheaddata(point,direction,options):=(
-//help:Arrowheaddata(A,B);
+// 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);
@@ -4609,7 +4672,8 @@ 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);
+ regional(name,Ltype,Noflg,reL,opstr,opcindy,color,
+ ptstr,hostr,tmp,tmp1,list);
name="arh"+text(ArrowheadNumber);
ArrowheadNumber=ArrowheadNumber+1;
ptstr=textformat(point,5);
@@ -4631,6 +4695,7 @@ Arrowhead(point,Houkou,options):=(
Ltype=tmp_1;
Noflg=tmp_2;
reL=tmp_6;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
list=Arrowheaddata(point,Houkou,options);
@@ -4643,7 +4708,9 @@ Arrowhead(point,Houkou,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(1)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
// if(Noflg==1,Ltype=0);
Ltype=0;
@@ -4691,7 +4758,7 @@ Arrowdata(Arg1,Arg2,options):=(
//help:Arrowdata([A,B],[2,10]);
//help:Arrowdata("1",[p1,p2]);
regional(Retflg,nm,ptlist,name,opstr,opcindy,realL,strL,size,
- flg,Ltype,Noflg,lineflg,tmp,tmp1,tmp2,pA,pB,segpos);
+ flg,Ltype,Noflg,lineflg,tmp,tmp1,tmp2,pA,pB,segpos,color);
Retflg=0;
Noflg=0;
Ltype=0;
@@ -4711,6 +4778,7 @@ Arrowdata(Arg1,Arg2,options):=(
Noflg=tmp_2;
realL=tmp_6;
strL=tmp_7;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
size=1; // 15.06.11
@@ -4741,7 +4809,9 @@ Arrowdata(Arg1,Arg2,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4811,12 +4881,13 @@ Anglemark(Arg1,Arg2):=( // 2015.04.28 from
nm=substring(tmp,1,length(tmp)-1);
Anglemark(nm,plist,options);
);
-); // until
+); // to
Anglemark(nm,plist,options):=(
-//help:Anglemark([A,B,C],["E=\theta",2]);
+//help([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,
+//help:Anglemark("1",[A,B,2*pi]);
+//help:Anglemark(options=[size,"E/L=(sep,)letter"]);
+ regional(name,Out,pB,pA,pC,Ctr,ra,sab,sac,ratio,opstr,Bname,Bpos,color,
Brat,tmp,tmp1,tmp2,Num,opcindy,Ltype,eqL,realL,Rg,Th,Noflg);
name="ag"+nm;
Bpos="md"+name;
@@ -4824,16 +4895,18 @@ Anglemark(nm,plist,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
- opstr=tmp_(length(tmp)-1);
+// opstr=tmp_(length(tmp)-1);//180530
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
eqL=tmp_5;
realL=tmp_6;
Bname="";
- Brat=1.5;
+ Brat=1.2; //180530
Num=20;
+ opstr="";
if(length(realL)>0,
ra=realL_1*ra;
- opstr=opstr+","+text(realL_1);
+ opstr=","+text(realL_1);//180530
);
forall(eqL,
if(substring(#,0,1)=="L",Bname="Letter(");
@@ -4846,11 +4919,16 @@ Anglemark(nm,plist,options):=(
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];
+ pB=Lcrd(plist_1); pA=Lcrd(plist_2); sab=pB-pA;
+ Ctr=pA;
+ if((length(plist_3)>1)%(ispoint(plist_3)), //180506from
+ pC=Lcrd(plist_3);
+ sac=pC-pA;
+ Rg=[arctan2(sab)+0,arctan2(sac)+0];
+ ,
+ sac=pB-pA;
+ Rg=[arctan2(sab)+0,arctan2(sab)+plist_3];
+ ); //180506to
if(Rg_2<Rg_1,Rg_2=Rg_2+2*pi);
Out=[];
if(ra>min(|sab|,|sac|), // 16.12.29
@@ -4880,7 +4958,9 @@ Anglemark(nm,plist,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -4910,11 +4990,12 @@ Paramark(nm,plist,options):=(
//help:Paramark([A,B,C],["E=\theta"]);
//help:Paramark("1",[p1,p2,p3],["E=\theta"]);
regional(name,Out,pB,pA,pC,ra,sab,sac,ratio,opstr,Bname,Bpos,
- Brat,tmp,tmp1,tmp2,Ltype,Noflg,eqL,realL,opcindy);
+ Brat,tmp,tmp1,tmp2,Ltype,Noflg,eqL,realL,opcindy,color);
name="pm"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
eqL=tmp_5;
@@ -4962,7 +5043,9 @@ Paramark(nm,plist,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -5006,11 +5089,12 @@ Bowdata(nm,plist,options):=(
//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);
+ Th1,Th2,Noflg,Bops,Bmov,Tmov,Nmov,rev,color);
name="bw"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
eqL=tmp_5;
@@ -5138,7 +5222,9 @@ Bowdata(nm,plist,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -5242,16 +5328,17 @@ Deqplot(nm,deq,rng,Arg1,Arg2):=(
Deqplot(nm,deq,rng,initt,initf,options);
);
Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06
-//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]",0,[1,0.5]);
+//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]",0,[1,0.5]);
regional(deq,rng,Ltype,Noflg,eqL,opcindy,Num,name,nn,pdL,phase,
- sel,tmp,tmp1,tmp2);
+ sel,tmp,tmp1,tmp2,color);
name="de"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
eqL=tmp_5;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
Num=50;
forall(eqL,
@@ -5268,6 +5355,7 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06
rng=rng+"="+textformat([XMIN,XMAX],6);
);
deq=deqorg;
+ deq=replace(deq,"'","`"); //180527
tmp=indexof(deq,"=");
tmp1=substring(deq,0,tmp-1);
if(indexof(tmp1,"[")==0,
@@ -5338,7 +5426,9 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -5353,7 +5443,7 @@ 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,
+ regional(name,AnsL,Start,Eps,EEps,S,Flg,Fdata,Gdata,KL,pt,qt,color
t1,t2,t3,ii,nn,tmp,tmp1,tmp2,Ltype,Noflg,realL,eqL,opstr,opcindy);
name="en"+nm;
tmp=Divoptions(options);
@@ -5361,6 +5451,7 @@ EnclosingS(nm,plist,options):=(
Noflg=tmp_2;
eqL=tmp_5;
realL=tmp_6;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Eps=10^(-5); // 16.12.05
@@ -5488,25 +5579,12 @@ EnclosingS(nm,plist,options):=(
);
tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")";
GLIST=append(GLIST,tmp);//16.11.07until
- // GLIST=append(GLIST,"Tmp=[]"); // 16.11.05from
-// nn=floor(length(AnsL)/20);
-// forall(1..nn,ii,
-// tmp=AnsL_(((ii-1)*20+1)..(ii*20));
-// tmp=apply(tmp,LLcrd(#));
-// tmp="Tmp=[Tmp,"+textformat(tmp,5)+"]";
-// GLIST=append(GLIST,tmp);
-// );
-// if(length(AnsL)>nn*20,
-// tmp=AnsL_((nn*20+1)..(length(AnsL)));
-// tmp=apply(tmp,LLcrd(#));
-// tmp="Tmp=[Tmp,"+textformat(tmp,5)+"]";
-// GLIST=append(GLIST,tmp);
-// );
-// GLIST=append(GLIST,name+"=Listplot(Tmp)"); // 16.11.05until
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -5524,7 +5602,7 @@ Enclosing2(nm,plistorg,options):=(
//help:Enclosing2(options=[Eps1(0.01),Eps2(0.1)]);
regional(name,plist,AnsL,Start,Eps,Eps1,Eps2,flg,Fdata,Gdata,KL,
t1,t2,tst,ss,ii,nn,nxtno,Ltype,Noflg,realL,eqL,opstr,opcindy,
- tmp,tmp1,tmp2);
+ tmp,tmp1,tmp2,color);
name="en"+nm;
plist=plistorg;
tmp=Divoptions(options);
@@ -5532,6 +5610,7 @@ Enclosing2(nm,plistorg,options):=(
Noflg=tmp_2;
eqL=tmp_5;
realL=tmp_6;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Eps=10^(-5); // 16.12.05
@@ -5654,7 +5733,9 @@ Enclosing2(nm,plistorg,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -5746,11 +5827,12 @@ Makehatch(iolistorg,pt,vec,bdylist):=(
);
Hatchdatacindy(nm,iostr,bdylist):=Hatchdatacindy(nm,iostr,bdylist,[]);
+Hatchdata(nm,iostr,bdylist,options):=Hatchdatacindy(nm,iostr,bdylist,options);
Hatchdatacindy(nm,iostr,bdylistorg,options):=(
-//help:Hatchdatacindy("1",["ii"],[["ln1","Invert(gr1)"],["gr2","n"]]);
-//help:Hatchdatacindy(options=[angle,width]);
+//help:Hatchdata("1",["ii"],[["ln1","Invert(gr1)"],["gr2","n"]]);
+//help:Hatchdata(options=[angle,width]);
regional(name,bdylist,bdynameL,bname,Ltype,Noflg,opstr,opcindy,reL,startP,angle,
- interval,vec,nvec,flg,pt,kk,delta,sha,AnsL,tmp,tmp1,tmp2);
+ interval,vec,nvec,flg,pt,kk,delta,sha,AnsL,tmp,tmp1,tmp2,color);
name="ha"+nm;
bdylist=[];
bdynameL=[];
@@ -5797,6 +5879,7 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
reL=tmp_6;
@@ -5863,7 +5946,9 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -5877,34 +5962,65 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
tmp2;
);
-/////////// end of new Hatchdata(cindy) ///////////
-
-Shade(plist):=Shade(plist,[]);
-Shade(plist,options):=(
-//help:Shade(["gr2","sg1"],[0.5]);
-//help:Shade(["gr2","sg1"],["red" /pict2e]);
-//help:Shade(["gr2","sg1"],[[0,0,0,0.5] /pict2e]);
-//help:Shade(["gr2","sg1"],[[1,0,0] /pict2e]);
-//help:Shade([pointlist]);
- regional(tmp,tmp1,tmp2,opstr,opcindy,Str,G2,flg);
+Shade(plist):=Shade("",plist,[]); //180613from
+Shade(Arg1,Arg2):=(
+ if(isstring(Arg1),
+ Shade(Arg1,Arg2,[]);
+ ,
+ Shade("",Arg1,Arg2);
+ );
+);
+Shade(nm,plistorg,options):=( //180613to
+//help:Shade(["gr"],[0.5]);
+//help:Shade(["gr"],["Color=red"]);
+//help:Shade(["gr2","sg1"],["Color=[0,0,0,0.5]"]);
+//help:Shade(["gr2","sg1"],["Color=[1,0,0]"]);
+// help:Shade([[A,B,C,A]]);
+ regional(name,plist,jj,tmp,tmp1,tmp2,opstr,opcindy,reL,Str,G2,flg,color,ctr);
+ name="shade"+nm;
+ plist=plistorg;
if(isstring(plist_1), // 16.01.24
println("output Shade of "+plist);
,
println("output Shade of lists");
);
tmp=Divoptions(options);
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
- flg=0;
- forall(plist,
+ reL=tmp_6; //180603from
+ if(length(reL)>0,
+ color=reL_1*color;
+ );//180603to
+ if(length(color)==4, //180602from
+ tmp=colorCmyk2rgb(color);
+ );
+ flg=0; ctr=1;
+ forall(1..(length(plist)),jj, //180613from
if(flg==0,
- if(isstring(#),tmp=parse(#),tmp=#); // from 16.01.24
- if(!islist(tmp),flg=1); until
+ tmp1=plist_jj;
+ if(isstring(tmp1),tmp=parse(tmp1),tmp=tmp1);
+ if(!islist(tmp),
+ flg=1;
+ ,
+ if(!isstring(tmp1),
+ tmp2=[];
+ forall(tmp1,if(ispoint(#),tmp=#.xy,tmp=#);
+ tmp2=append(tmp2,tmp);
+ );
+ tmp1=Dqq("-"+name+text(ctr));
+ tmp2=textformat(tmp2,6)+",["+Dqq("nodisp")+"]";
+ tmp=name+text(ctr)+"=Listplot("+tmp1+","+tmp2+")";
+ parse(tmp);
+ plist_jj=name+text(ctr);
+ ctr=ctr+1;
+ );
+ );
);
- );
+ );//180613to
if(flg==1,
-// err("some data not defined yet");
+ println(" some data not defined properly");
,
G2=Joincrvs("1",plist,["nodata"]);
G2=apply(G2,Pcrd(#));
@@ -5925,8 +6041,15 @@ Shade(plist,options):=(
); // until 16.01.24
);
Str=Str+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")";
- Com2nd(Str);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")",["before"]));
+ Com2nd(Str,["before"]);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")",["before"]));
);
+/////////// end of new Hatchdata(cindy) ///////////
+
+
+
+
//help:end();
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt
index 6510040a896..afbbbad15a7 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt
@@ -1,3 +1,34 @@
+// 20180610
+// WritetoRS changed ( \\ => /)
+// 20180608
+// Setslide changed ( old style of setting title resupported )
+// 20180604
+// Mkslides,Mkslidesummary debugged ( to make kc.sh executable )
+// Changework changed (set to Dircdy if dir not found )
+// 20180603
+// Rotatedata,... changed (KCOLOR)
+// Letter,Letterrot,Exprrot changed (color)
+// Scaledata changed ( case where x,y is the same ratio)
+// 20180602
+// divoptions ( 8,9 ->length(tmp)-1,length(tmp))
+// Rotatedata,... changed (color supported )
+// Rotataedata,... debugged ( level RSform =>1 )
+// Settitle debugged ( color option batted )
+//20180529
+// Presentation debugged (for repeat=1)
+//20180526
+// Repeatsameslide debugged (for minipage with thin)
+// Presentation changed ( page jump button )
+//20180524
+// Presentation changed ( pageend, \slidepage, pagestyle{empty})
+//20180515
+// Setpara changed ( "m" as default)
+//20180514
+// WritetoRS,Makebat changed ( to execsrc.r)
+//20180513
+// WritetoRS,Makebat changed ( UTF-8)
+//20180412
+// Mksummary changed ( calcbyR, quit )
//20180409
// WritetoRS,Makebat changed ( "shell" used )
//20180408
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
index ae40d147f9b..859b46f749f 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs
@@ -14,7 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindybasic2(20180409) loaded");
+println("ketcindybasic2(20180610) loaded");
//help:start();
@@ -103,14 +103,16 @@ Reflectpoint(point,symL):=(
Rotatedata(nm,plist,Theta):=Rotatedata(nm,plist,Theta,[]);
Rotatedata(nm,plist,angle,options):=(
-//help:Rotatedata("1","crAB",pi/3,[[1,5],"dr,2"]);
+//help:Rotatedata("1",["crAB","pt1"],pi/3,[[1,5],"dr,2"]);
+//help:Rotatedata("1",[[A.xy],[B.xy]],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);
+ opcindy,Nj,Njj,Kj,Mj,X1,Y1,X2,Y2,Ltype,Noflg,name,color);
name="rt"+nm;
Pt=[0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
if(length(tmp1)>0,Pt=Lcrd(tmp1_1));
@@ -152,14 +154,16 @@ Rotatedata(nm,plist,angle,options):=(
tmp=name+"="+textformat(tmp1,5);
parse(tmp);
tmp1=text(plist);
- tmp1=RSform(tmp1);// 17.12.23(2lines)
+ tmp1=RSform(tmp1,1);// 180602
tmp=name+"=Rotatedata("+tmp1+","
+textformat(angle,5)+","+RSform(textformat(Pt,5))+")"; //17.12.23
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -170,13 +174,14 @@ Rotatedata(nm,plist,angle,options):=(
Translatedata(nm,plist,mov):=Translatedata(nm,plist,mov,[]);
Translatedata(nm,plist,mov,options):=(
-//help:Translatedata("1",["gr1"],[1,2]);
+//help:Translatedata("1",["gr1","pt1"],[1,2]);
regional(tmp,tmp1,tmp2,pdata,Cx,Cy,PdL,Nj,Njj,Kj,
- opcindy,X2,Y2,Ltype,Noflg,name);
+ opcindy,X2,Y2,Ltype,Noflg,name,color,leveL);
name="tr"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
pdata=plist;
if(isstring(pdata),pdata=[pdata]);
@@ -212,14 +217,16 @@ Translatedata(nm,plist,mov,options):=(
if(length(tmp1)==1,tmp1=tmp1_1);
tmp=name+"="+textformat(tmp1,5);
parse(tmp);
- tmp1=text(plist);
- tmp1=RSform(tmp1);// 17.12.23
+ tmp1=text(plist);
+ tmp1=RSform(tmp1,1);// 180602
tmp=name+"=Translatedata("+tmp1+","+RSform(textformat(mov,5))+")";
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -230,14 +237,19 @@ Translatedata(nm,plist,mov,options):=(
Scaledata(nm,plist,ratioV):=(
regional(tmp);
- tmp=Lcrd(ratioV);
+ tmp=ratioV; //180603from
+ if(!islist(tmp),tmp=[tmp,tmp]);
+ tmp=Lcrd(tmp);//180603to
Scaledata(nm,plist,tmp_1,tmp_2,[]);
);
Scaledata(nm,plist,Arg1,Arg2):=(
-//help:Scaledata("1","crAB",3,2,[[0,0]]);
+//help:Scaledata("1",["crAB","pt1"],3,2,[[0,0]]);
+//help:Scaledata("1",["crAB","pt1"],2,[[0,0]]);
regional(tmp,options);
if(islist(Arg2),
- tmp=Lcrd(Arg1);
+ tmp=Arg1;//180603(2lines)
+ if(!islist(tmp),tmp=[tmp,tmp]);
+ tmp=Lcrd(tmp);
options=Arg2;
Scaledata(nm,plist,tmp_1,tmp_2,options);
,
@@ -246,12 +258,13 @@ 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);
+ opcindy,Nj,Njj,Kj,X2,Y2,Ltype,Noflg,name,color);
name="sc"+nm;
Pt=[0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
if(length(tmp1)>0,
@@ -291,14 +304,16 @@ Scaledata(nm,plist,rx,ry,options):=(
tmp=name+"="+textformat(tmp1,5);
parse(tmp);
tmp1=text(plist);
- tmp1=RSform(tmp1); // 17.12.23
+ tmp1=RSform(tmp1,1); // 180602
tmp=name+"=Scaledata("+tmp1+","
+textformat(rx,5)+","+textformat(ry,5)+","+RSform(textformat(Pt,5))+")";
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -309,14 +324,15 @@ Scaledata(nm,plist,rx,ry,options):=(
Reflectdata(nm,plist,symL):=Reflectdata(nm,plist,symL,[]);
Reflectdata(nm,plist,symL,options):=(
-//help:Reflectdata("1","crAB",[C]);
+//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);
+ opcindy,Nj,Njj,Kj,X1,Y1,X2,Y2,Ltype,Noflg,name,color);
name="re"+nm;
Pt=[0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
pdata=plist;
if(isstring(pdata),pdata=[pdata]);
@@ -368,13 +384,15 @@ Reflectdata(nm,plist,symL,options):=(
tmp=name+"="+textformat(tmp1,5);
parse(tmp);
tmp1=text(plist);
- tmp1=RSform(tmp1);// 17.12.23
+ tmp1=RSform(tmp1,1);// 180602
tmp=name+"=Reflectdata("+tmp1+","+RSform(textformat(symL,5))+")";//17.12.23
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -538,6 +556,7 @@ 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"]);
+//help:Expr([A,"e","f(x)=x^2"],["size->24"]);
regional(list,str,tmp,tmp1,tmp2);
list=listorg;
forall(1..round(length(list)/3),
@@ -552,15 +571,16 @@ Expr(listorg,options):=( //16.10.09
Letter(Pt,Dr,St):=Letter([Pt,Dr,St]);
Letter(list):=Letter(list,[]);
Letter(list,options):=(
-//help:Letter([C,"c","Graph of f(x)"]);
+//help:Letter([C,"c","Graph of $f(x)$"]);
+//help:Letter([C,"c","xy"],["size->30"]);
regional(Nj,Pos,Dir,Str,Off,Dmv,Xmv,Ymv,Noflg,opcindy,
- opL,aln,sz,clr,bld,ita,tmp,tmp1,tmp2);
+ opL,aln,sz,clr,bld,ita,tmp,tmp1,tmp2,color);
tmp=Divoptions(options);
Noflg=tmp_2;
+ color=tmp_(length(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";
@@ -596,7 +616,9 @@ Letter(list,options):=(
Str=replace(Str,"`","'");//180303
tmp=Dq+","+Dq+Str+Dq+")";
if(Noflg==0,
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
);
if(Noflg<2,
Xmv=0;//16.10.13
@@ -625,18 +647,25 @@ Letter(list,options):=(
);
Str=list_(Nj+2); //17.10.17
drawtext(Pcrd(Pos),Str,offset->[Off+Xmv,Off+Ymv],
- size->sz,color->clr,align->aln,bold->bld,italics->ita);//16.10.09
+ size->sz,color->color,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):=(
+Letterrot(pt,dir,str):=Letterrot(pt,dir,0,0,str,[]);
+Letterrot(pt,dir,Arg1,Arg2):=(
+ if(islist(Arg2),
+ Letterrot(pt,dir,"t0n0",Arg1,Arg2);
+ ,
+ Letterrot(pt,dir,Arg1,Arg2,[]);
+ );
+);
+Letterrot(pt,dir,movstr,str,options):=(
//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);
+ regional(tmov,nmov,tmp,tmp1,tmp2,color);
tmp1=indexof(movstr,"t");
tmp2=indexof(movstr,"n");
if(tmp1>0,
@@ -650,21 +679,32 @@ Letterrot(pt,dir,movstr,str):=(
,
nmov=0;
);
- Letterrot(pt,dir,tmov,nmov,str);
+ Letterrot(pt,dir,tmov,nmov,str,options);
);
-Letterrot(pt,dir,tmov,nmov,str):=(
- regional(tmp);
- Letter([pt,"c",str],["notex"]);
+Letterrot(pt,dir,tmov,nmov,str,options):=(
+ regional(tmp,color);
+ tmp=Divoptions(options);
+ color=tmp_(length(tmp)-2);
+ Letter([pt,"c",str],append(options,"notex"));
tmp=replace(str,"\","\\"); //17.10.18
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Letterrot("+pt+","+dir+","+tmov+","+nmov+",'"+tmp+"')");
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
);
-Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str);
-Exprrot(pt,dir,movstr,str):=(
+Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str,[]);
+Exprrot(pt,dir,Arg1,Arg2):=(
+ if(islist(Arg2),
+ Exprrot(pt,dir,"t0n0",Arg1,Arg2);
+ ,
+ Exprrot(pt,dir,Arg1,Arg2,[]);
+ );
+);
+Exprrot(pt,dir,movstr,str,options):=(
//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);
+ regional(tmov,nmov,tmp,tmp1,tmp2,color);
tmp1=indexof(movstr,"t");
tmp2=indexof(movstr,"n");
if(tmp1>0,
@@ -678,13 +718,17 @@ Exprrot(pt,dir,movstr,str):=(
,
nmov=0;
);
- Exprrot(pt,dir,tmov,nmov,str);
+ Exprrot(pt,dir,tmov,nmov,str,options);
);
-Exprrot(pt,dir,tmov,nmov,str):=(
- regional(tmp);
- Expr([pt,"c",str],["notex"]);
+Exprrot(pt,dir,tmov,nmov,str,options):=(
+ regional(tmp,color);
+ tmp=Divoptions(options);
+ color=tmp_(length(tmp)-2);
+ Expr([pt,"c",str],append(options,"notex"));
tmp=replace(str,"\","\\"); //17.10.18
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Exprrot("+pt+","+dir+","+tmov+","+nmov+",'"+tmp+"')");
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
);
Putslider(ptstr,p1,p2):=Slider(ptstr,p1,p2);
@@ -765,11 +809,12 @@ 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);
+ ptlist,ctrlist,tmp,tmp1,tmp2,ii,st,out,list,color);
name="bz"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Num=10;
@@ -822,7 +867,9 @@ BezierCurve(nm,ptlistorg,ctrlistorg,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -1731,7 +1778,6 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=(
Tabledata(nm,n,m,xsize,ysize,rmvL):=
Tabledata(nm,n,m,xsize,ysize,rmvL,[]);
Tabledata(nm,n,m,xsize,ysize,rmvL,options):=(
-//help:Tabledata("",xLst,yLst,rmvL,[2,"Rng=y"]);
regional(Tb,name,tmp,xLst,yLst);
name="tb"+nm;
xLst=apply(1..n,xsize/n);
@@ -2578,6 +2624,7 @@ WritetoRS(Arg):=(
);
WritetoRS(filename,shchoice):=(
regional(Plist,Pos,GrL,str,tmp,tmp1,tmp2,cmd);
+ //help:WritetoRS(2);
println("Write to R "+filename);
Plist=[];
Pnamelist=[];
@@ -2592,7 +2639,7 @@ WritetoRS(filename,shchoice):=(
SCEOUTPUT = openfile(filename);
tmp=Datetime();
println(SCEOUTPUT,"# date time="+tmp_1+" "+tmp_2);
- if(isstring(CindyPathName), // 16.12.25from
+ if(isstring(CindyName), // 16.12.25from
if(length(CindyPathName)>0,
println(SCEOUTPUT,
"# path file="+CindyPathName+" "+CindyFileName+".cdy");
@@ -2602,6 +2649,9 @@ WritetoRS(filename,shchoice):=(
,
println(SCEOUTPUT,"");
);
+ if(iswindows(),
+ println(SCEOUTPUT,"options(encoding='UTF-8')"); //180513
+ );
tmp1=replace(Dirwork,"\","/");
if((iswindows())&(indexof(tmp1,"Users")>0),
tmp=Indexall(tmp1,"/");
@@ -2613,6 +2663,7 @@ WritetoRS(filename,shchoice):=(
println(SCEOUTPUT,"Hpath=Hpath[length(Hpath)]");
println(SCEOUTPUT,"Rest="+Dqq(tmp2));
println(SCEOUTPUT,"Path=paste(Drv,Hpath,Rest,sep='')");
+ println(SCEOUTPUT,"Path=gsub('\\','/',Path,fixed=TRUE)"); //180610
println(SCEOUTPUT,"setwd(Path)");
,
println(SCEOUTPUT,"setwd('"+tmp1+"')");
@@ -2705,6 +2756,13 @@ WritetoRS(filename,shchoice):=(
tmp=tmp+",'Cdy="+Cindyname()+".cdy"; //180404
tmp=replace(tmp,"\","\\");
println(SCEOUTPUT,tmp+"')");
+ forall(COM2ndlistb, //180613from
+ if(indexof(#,"Texcom")==0,
+ println(SCEOUTPUT,RSform(#));
+ ,
+ println(SCEOUTPUT,#);
+ );
+ );//180613to
forall(COM2ndlist,
if(indexof(#,"Texcom")==0, //17.09.22
println(SCEOUTPUT,RSform(#));
@@ -2726,7 +2784,25 @@ WritetoRS(filename,shchoice):=(
println(SCEOUTPUT,"#quit()");
);
closefile(SCEOUTPUT);
-); //17.09.17to
+ if(iswindows(), //180513from
+ SCEOUTPUT = openfile("execsrc.r");//180514
+ tmp1=replace(Dirwork,"\","/");
+ if(indexof(tmp1,"Users")>0,
+ tmp=Indexall(tmp1,"/");
+ tmp2=substring(tmp1,tmp_3-1,length(tmp1));
+ tmp1=substring(tmp1,0,tmp_3-1);
+ println(SCEOUTPUT,"Drv=shell('echo %HOMEDRIVE%',intern=TRUE)");
+ println(SCEOUTPUT,"Drv=Drv[length(Drv)]");
+ println(SCEOUTPUT,"Hpath=shell('echo %HOMEPATH%',intern=TRUE)");
+ println(SCEOUTPUT,"Hpath=Hpath[length(Hpath)]");
+ println(SCEOUTPUT,"Rest="+Dqq(tmp2));
+ println(SCEOUTPUT,"Path=paste(Drv,Hpath,Rest,sep='')");
+ println(SCEOUTPUT,"setwd(Path)");
+ println(SCEOUTPUT,"source('"+filename+"',encoding='UTF-8')");
+ );
+ closefile(SCEOUTPUT);
+ ); //180513to
+);
Extractdata(name):=Extractdata(1,name,[]);
Extractdata(Arg1,Arg2):=(
@@ -2739,10 +2815,11 @@ Extractdata(Arg1,Arg2):=(
Extractdata(number,name,options):=(
//help:ExtractData("ha1");
//help:ExtractData(1,"ha1");
- regional(dlist,tmp,tmp1,tmp2,tmp3,File,Ltype,Noflg,opstr,opcindy);
+ regional(dlist,tmp,tmp1,tmp2,tmp3,File,Ltype,Noflg,opstr,opcindy,color);
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
tmp1=[];
@@ -2770,7 +2847,9 @@ Extractdata(number,name,options):=(
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3168,7 +3247,7 @@ Makebat(texmainfile,flow):=(
path="";
);
if(indexof(flow,"r")>0,
- tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < "+Fhead+".r";
+ tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < execsrc.r";//180514
// 17.09.14
println(SCEOUTPUT,tmp);
);
@@ -3235,7 +3314,7 @@ Addpackage(packorg):=(
packL_#="{"+tmp+"}";
);
);
- ADDPACK=concat(ADDPACK,packL); //17.06.25until
+ ADDPACK=concat(ADDPACK,packL); //17.06.25to
);
Viewtex():=(
@@ -3847,7 +3926,7 @@ Setslidehyper(Arg):=(
);
Setslidehyper(driverorg,options):=(
//help:Setslidehyper();
-//help:Setslidehyper("dvipdfmx",["cl=true,lc=blue,fc=blue","Pos=[125,70]","Size=1"]);
+//help:Setslidehyper("dvipdfmx",["cl=true,lc=blue,fc=blue","Pos=[125,73]","Size=1"]);
regional(driver,eqL,reL,stL,,str,tmp,tmp1,tmp2);
driver=driverorg;
if(length(driver)==0,
@@ -3879,41 +3958,52 @@ Setslidehyper(driverorg,options):=(
ADDPACK=select(ADDPACK,indexof(#,"hyperref")==0);
Addpackage(tmp1+"{hyperref}");
LinkPosH=125;
- LinkPosV=70;
+ LinkPosV=73;//180524
LinkSize=1;
- if(length(reL)>0,
- LinkPosH=reL_1;
- if(length(reL)>1,LinkPosV=reL_2);
- if(length(reL)>2,LinkSize=max(reL_3,0.1));
- );
+// if(length(reL)>0,
+// LinkPosH=reL_1;
+// if(length(reL)>1,LinkPosV=reL_2);
+// if(length(reL)>2,LinkSize=max(reL_3,0.1));
+// );
forall(eqL,
- tmp=indexof(#,"=");
- tmp1=Toupper(substring(#,0,1));
- tmp2=substring(#,tmp,length(#));
- tmp2=parse(tmp2);
- if(tmp1=="P",
- LinkPosH=tmp2_1;
- LinkPosV=tmp2_2;
- );
- if(tmp1=="S",
- LinkSize=max(tmp2,0.1);
- );
+ tmp=Indexall(#,"=");//180524from
+ if(length(tmp)==1,
+ tmp1=Toupper(substring(#,0,1));
+ tmp2=substring(#,tmp_1,length(#));
+ tmp2=parse(tmp2);
+ if(tmp1=="P",
+ LinkPosH=tmp2_1;
+ LinkPosV=tmp2_2;
+ );
+ if(tmp1=="S",
+ LinkSize=max(tmp2,0.1);
+ );
+ );//180524to
);
-); //17.12.16until
+); //17.12.16to
-Settitle(cmdL):=Settitle(cmdL,[]); // 180330changed
-Settitle(cmdL,options):=(
+Settitle(cmdL):=Settitle("",cmdL,[]); // 180608from
+Settitle(Arg1,Arg2):=(
+ if(isstring(Arg1),
+ Settitle(Arg1,Arg2,[]);
+ ,
+ Settitle("",Arg1,Arg2);
+ );
+); // 180608to
+Settitle(titleold,cmdL,options):=(
//help:Settitle(cmdL);
//help:Settitle(name,cmdL);
//help:Settitle(options=["Title=slide0","Layery=0","Color=blue"]);
regional(tmp,tmp1,tmp2,eqL,layery,color,size,font);
TitleName="slide0"; //180330
+ if(length(titleold)>0,TitleName=titleold);//180608
layery="0";
color="blue";
size="\Large";
font="\bf";
- tmp=Divoptions(options);
- eqL=tmp_5;
+// tmp=Divoptions(options);
+// eqL=tmp_5;
+ eqL=options; //180602
forall(eqL,
tmp1=Toupper(substring(#,0,1));
tmp=indexof(#,"=");
@@ -4039,7 +4129,7 @@ Maketitle(name):=(
Repeatsameslide(repeatflg,sestr,addedL):=(
regional(seL,flg1,ss,nn,nrep,tmp,tmp1,tmp2,tmp3,str,j,k);
- // global RepeatList, SCEOUTPUT
+ // global RepeatList, SCEOUTPUT, NonThinFlg
nrep=length(RepeatList);
flg1=0;
forall(addedL,ss,
@@ -4081,6 +4171,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=(
if(flg1==1,seL=append(seL,1));
seL=remove(1..nrep,seL);
str=ss; // 17.05.28from
+ if(substring(str,0,16)=="\begin{minipage}",MiniFlg=1);//180526
repeat(10,
tmp1=Indexall(str,"{\color");
if(length(tmp1)>0,
@@ -4090,28 +4181,50 @@ Repeatsameslide(repeatflg,sestr,addedL):=(
str=replace(str,tmp+" ","");
str=replace(str,tmp,"");
);
- );//17.05.28until
+ );//17.05.28to
if(contains(seL,1),
if(substring(str,0,1)!="%",
if(NonThinFlg==0,
if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
- println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23
- println(SCEOUTPUT,str);
- println(SCEOUTPUT,"}%");
+ if(MiniFlg==0, //180526from
+ println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23
+ println(SCEOUTPUT,str);
+ println(SCEOUTPUT,"}%");
+ ,
+ println(SCEOUTPUT,str);
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ println(SCEOUTPUT,"}%");
+ );
+ ); //180526to
,
println(SCEOUTPUT,str);
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ println(SCEOUTPUT,"}%");
+ MiniFlg=0;
+ );
);
);
if(NonThinFlg==1,
if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23
+ println(SCEOUTPUT,str);
+ ,
+ println(SCEOUTPUT,str);
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ println(SCEOUTPUT,"}%");
+ MiniFlg=0;
+ );
);
- println(SCEOUTPUT,str);
);
if(NonThinFlg==2,
println(SCEOUTPUT,str);
if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
println(SCEOUTPUT,"}%");
+ , //180526from
+ if(indexof(str,"\end{minipage}")>0,
+ println(SCEOUTPUT,"}%");
+ MiniFlg=0;
+ ); //180526from
);
);
seL=remove(seL,[1]);
@@ -4119,24 +4232,56 @@ Repeatsameslide(repeatflg,sestr,addedL):=(
);
if(substring(ss,0,1)!="%", //16.01.04
forall(1..(length(seL)),nn,
+ if(substring(str,0,16)=="\begin{minipage}",MiniFlg=1);//180526
tmp=seL_nn;
if(NonThinFlg==0,
- tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
- tmp1=[tmp1,str,"}%"];
+ if(!contains(["\begi","\end{"],substring(str,0,5)),//180526from
+ if(MiniFlg==0,
+ tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
+ tmp1=[tmp1,str,"}%"];
+ ,
+ tmp1=[str];
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ tmp1=append(tmp1,"}%");
+ );
+ );
+ ,
+ tmp1=[str];
+ if(indexof(str,"\end{minipage}")>0,
+ tmp1=append(tmp1,"}%");
+ MiniFlg=0;
+ );
+ );
);
if(NonThinFlg==1,
- tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
- tmp1=[tmp1,str];//17.01.08until
+ if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
+ tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
+ tmp1=[tmp1,str];
+ ,
+ tmp1=[str];
+ if(indexof(str,"\end{minipage}")>0,
+ tmp1=append(tmp1,"}%");
+ MiniFlg=0;
+ );
+ );
);
if(NonThinFlg==2,
- tmp1=[str,"}%"];
+ tmp1=[str];
+ if(!contains(["\begi","\end{"],substring(str,0,5)),
+ tmp1=append(tmp1,"}%");
+ ,
+ if(indexof(str,"\end{minipage}")>0,
+ tmp1=append(tmp1,"}%");
+ MiniFlg=0;
+ );
+ );
);
RepeatList_tmp=concat( RepeatList_tmp,tmp1);
);
);
- );//16.01.05until
+ );//16.01.05to
);
- );//16.12.05until
+ );//16.12.05to
);
Presentation(texfile):=Presentation(texfile,texfile);
@@ -4146,6 +4291,7 @@ Presentation(texfile,txtfile):=(
tmp2,tmp3,tmp4,tmp5,newoption,top,repeatflg,nrep,nrepprev,,repstr,
sestr,npara,paradt,parafiles,hyperflg,paractr,
letterc,boxc,shadowc,mboxc,sep);
+ MiniFlg=0;//180526
slidecmd=["\ketcletter","\ketcbox","\ketdbox","\ketcframe",
"\ketcshadow","\ketdshadow","\slidetitlex","\slidetitlesize",
"\mketcletter","\mketcbox","\mketdbox","\mketcframe",
@@ -4259,15 +4405,9 @@ Presentation(texfile,txtfile):=(
,
println(SCEOUTPUT,"\usepackage[dvipdfmx]{graphicx}");
);
-// println(SCEOUTPUT,"\usepackage[usenames]{color}");
-// println(SCEOUTPUT,"\usepackage{color}");//17.06.14
println(SCEOUTPUT,"\usepackage{xcolor}");//17.07.31
letterc=[0.98,0.13,0,0.43]; boxc=[0,0.32,0.52,0];
shadowc=[0,0,0,0.5]; mboxc="yellow";
-// if(!islist(SlideColorList), //17.03.02from
-// SlideColorList=[letterc,boxc,boxc,boxc,shadowc,shadowc,6,1.3,
-// letterc,mboxc,mboxc,mboxc,62,2,letterc];
-// , //17.03.02until
tmp4="abcdefghijklmno";
forall(1..15,
tmp=SlideColorList_#;
@@ -4283,16 +4423,18 @@ Presentation(texfile,txtfile):=(
SlideColorList_#="slidecolor"+tmp4_#;
);
);
-// ); //17.03.02
println(SCEOUTPUT,"\def\setthin#1{\def\thin{#1}}");//17.08.23
println(SCEOUTPUT,"\setthin{"+text(ThinDense)+"}");//17.08.23
+ println(SCEOUTPUT,"\newcommand{\slidepage}[1][s]{%");//180524from
+ println(SCEOUTPUT,"\setcounter{ketpicctra}{18}%");
+ println(SCEOUTPUT,"\if#1m \setcounter{ketpicctra}{1}\fi");
+ println(SCEOUTPUT,"\hypersetup{linkcolor=black}%");
+ println(SCEOUTPUT,"\begin{layer}{118}{0}");
+ println(SCEOUTPUT,"\putnotee{122}{-\theketpicctra.05}{\small\thepage/\pageref{pageend}}");
+ println(SCEOUTPUT,"\end{layer}\hypersetup{linkcolor=blue}}");//189524to
forall(ADDPACK,// 16.06.09from
-// if(indexof(#,"[")==0, // 16.09.05from
-// println(SCEOUTPUT,"\usepackage{"+#+"}");
-// ,
- println(SCEOUTPUT,"\usepackage"+#); //17.07.10
-// );
- );// 16.06.09until
+ println(SCEOUTPUT,"\usepackage"+#);
+ );// 16.06.09to
tmp=select(ADDPACK,indexof(#,"{hyperref}")>0);//16.12.31from
if(length(tmp)>0,
hyperflg=1;
@@ -4309,8 +4451,9 @@ Presentation(texfile,txtfile):=(
forall(tmp, // 15.07.21
if(substring(#,0,1)=="\", println(SCEOUTPUT,#));
);
- if(!isstring(PageStyle),PageStyle="headings");//17.04.09
- println(SCEOUTPUT,"\pagestyle{"+PageStyle+"}");//17.04.09
+// if(!isstring(PageStyle),PageStyle="headings");//180524from
+// println(SCEOUTPUT,"\pagestyle{"+PageStyle+"}");
+ println(SCEOUTPUT,"\pagestyle{empty}");//180524to
println(SCEOUTPUT,"");
println(SCEOUTPUT,"\begin{document}");
println(SCEOUTPUT,"");
@@ -4351,7 +4494,7 @@ Presentation(texfile,txtfile):=(
println(SCEOUTPUT,"");
println(SCEOUTPUT,"\color{"+SlideColorList_(15)+"}");
println(SCEOUTPUT,BodyStyle);//17.01.07
- println(SCEOUTPUT,"\thispagestyle{empty}");//17.01.29
+// println(SCEOUTPUT,"\thispagestyle{empty}");//180524
println(SCEOUTPUT,"\addtocounter{page}{-1}");//17.01.29
println(SCEOUTPUT,"");
verbflg=0; //16.06.28
@@ -4374,7 +4517,9 @@ Presentation(texfile,txtfile):=(
tmp=indexof(sld,"]::");
if(tmp>0,
if(substring(sld,1,2)!="%",//17.05.31
- if(substring(sld,1,5)=="thin", ThinFlg=1); // 17.05.28
+ if(substring(sld,1,5)=="thin",
+ ThinFlg=1;
+ );
sestr=substring(sld,1,tmp);
sld=substring(sld,tmp+2,length(sld));
tmp=indexof(sestr,"[");
@@ -4396,7 +4541,8 @@ Presentation(texfile,txtfile):=(
if(length(wall)>0,
tmp=["","\input{fig/"+wall+".tex}"];
);
- tmp=concat(tmp,["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);
+ tmp=concat(tmp,
+ ["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);//180524
RepeatList=apply(1..nrep,if(#==1,[],tmp));
);
if(sestr=="",flg=1);
@@ -4441,7 +4587,8 @@ Presentation(texfile,txtfile):=(
if(length(wall)>0,
tmp=["","\input{fig/"+wall+".tex}"];
);
- tmp=concat(tmp,["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);
+ tmp=concat(tmp,
+ ["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);//180524
RepeatList=apply(1..nrep,if(#==1,[],tmp));
);
);
@@ -4449,7 +4596,7 @@ Presentation(texfile,txtfile):=(
tmp4=[]; //16.12.31from
if(hyperflg>0,
tmp4=["\hypertarget{para"+text(paractr)+"pg"+text(#)+"}{}"];
- );//16.12.31until
+ );//16.12.31to
if(npara>0, //17.01.03
tmp4=concat(tmp4,["","\begin{layer}{120}"+paradt_2]);
if(#<=npara, //16.12.28from
@@ -4474,43 +4621,47 @@ Presentation(texfile,txtfile):=(
tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; // 17.01.12from
tmp1=tmp+text(paractr)+"pg";
tmp2=tmp+text(paractr-1)+"pg"+text(nrepprev);
- if(#>1,tmp=tmp1+text(1),tmp=tmp2);
+ tmp=tmp2; //180526from
tmp3=[text(LinkPosH-29*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut|\!\lhd$}}}}}"];
- if(#>1,tmp=tmp1+text(max(#-3,1)),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-24*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
- +text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\! \lhd\!\!\lhd\!$}}}}}");
- if(#>1,tmp=tmp1+text(#-1),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-17*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
- +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\!\lhd\!\!$}}}}}");
- tmp="{"+text(LinkPosV)+"}{\hyperlink{para";
- tmp2=tmp+text(paractr+1)+"pg"+text(1);
- if(#<nrep,tmp=tmp1+text(#+1),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-10*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
- +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\rhd\!$}}}}}");
- if(#<nrep,tmp=tmp1+text(min(#+3,nrep)),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-5*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +"}{\scriptsize $\mathstrut||\!\lhd$}}}}}"];
+ if(nrep>1,//180526
+ tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; // 17.01.12from
+ tmp1=tmp+text(paractr)+"pg";
+ tmp2=tmp+text(paractr-1)+"pg"+text(nrepprev);
+ tmp=tmp1+text(1);
+ tmp3=append(tmp3,
+ text(LinkPosH-24*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
+ +"}{\scriptsize $\mathstrut|\!\lhd$}}}}}"); //180526to
+ if(#>1,tmp=tmp1+text(#-1),tmp=tmp2);
+ tmp3=append(tmp3,
+ text(LinkPosH-17*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
+ +"}{\scriptsize $\mathstrut\!\!\lhd\!\!$}}}}}");
+ if(#<nrep,tmp=tmp1+text(#+1),tmp=tmp1+text(nrep));
+ tmp3=append(tmp3,
+ text(LinkPosH-10*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
+ +"}{\scriptsize $\mathstrut\!\rhd\!$}}}}}");
+ tmp=tmp1+text(nrep); //180526from
+ tmp3=append(tmp3,
+ text(LinkPosH-5*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{" // 17.01.19
+text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\!\rhd\!\!\rhd\!$}}}}}");
- if(#<nrep,tmp=tmp1+text(nrep),tmp=tmp2);
+ +"}{\scriptsize $\mathstrut \!\rhd\!\!|$}}}}}");
+ );
+ tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; //180529(2lines)
+ tmp=tmp+text(paractr+1)+"pg"+text(1);
tmp3=append(tmp3,
text(LinkPosH)+"}"+tmp+"}{\fbox{\Ctab{" // 17.01.19
+text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut \!\rhd\!\!|$}}}}}");
- tmp3=apply(tmp3,tmp,"\putnotew{"+tmp);
- tmp4=concat(tmp4,tmp3);// 17.01.12untilr
- tmp="\putnotew{"+text(LinkPosH)+"}{"+text(LinkPosV+6)+"}";//17.10.21from
- tmp=tmp+"{\scriptsize\color{black} "+text(#)+"/"+text(nrep)+"}";
- tmp4=append(tmp4,tmp);//17.10.21until
+ +"}{\scriptsize $\mathstrut \!\rhd\!\!||$}}}}}"); //180526to
);
+ tmp3=apply(tmp3,tmp,"\putnotew{"+tmp);
+ tmp4=concat(tmp4,tmp3);// 17.01.12to
+ tmp="\putnotee{"+text(LinkPosH+1)+"}{"+text(LinkPosV)+"}";//180524
+ tmp=tmp+"{\scriptsize\color{blue} "+text(#)+"/"+text(nrep)+"}"; //180524(blue)
+ tmp4=append(tmp4,tmp);
tmp4=concat(tmp4,["\end{layer}",""]);//16.12.31until
Repeatsameslide(repeatflg,text([#]),tmp4);
);
@@ -4519,7 +4670,7 @@ Presentation(texfile,txtfile):=(
if(substring(sld,0,2)=="%%", //17.06.23from
println(SCEOUTPUT,sld);
flg=1;
- ); //17.06.23until
+ ); //17.06.23to
if(flg==0,
if(indexof(sld,"\begin{verbatim}")==1, // 16.06.28from
Repeatsameslide(repeatflg,sestr,[slideL_ns]);
@@ -4573,6 +4724,7 @@ Presentation(texfile,txtfile):=(
);
println(SCEOUTPUT,"\mainslide{"+tmp2+"}");
println(SCEOUTPUT,"");
+ println(SCEOUTPUT,"");
tmp2="";
flg=1;
);
@@ -4605,7 +4757,7 @@ Presentation(texfile,txtfile):=(
tmp4=tmp5;
);
tmp=tmp+"{"+tmp2+"}";
- Repeatsameslide(repeatflg,sestr,[tmp,"","\vspace*{18mm}",""]);
+ Repeatsameslide(repeatflg,sestr,[tmp,"","\vspace*{18mm}",""]);//180524
tmp2="";
flg=1;
);
@@ -4635,7 +4787,7 @@ Presentation(texfile,txtfile):=(
// tmp3=tmp4;
// );
println(SCEOUTPUT,tmp);
- println(SCEOUTPUT,"");
+ println(SCEOUTPUT,""); //180524
println(SCEOUTPUT,"\vspace*{18mm}");
println(SCEOUTPUT,"");
tmp4=tmp3;
@@ -4707,9 +4859,9 @@ Presentation(texfile,txtfile):=(
tmp3="";
flg=1;
);
- if(flg==0&tmp1=="end",
+ if(flg==0&tmp1=="end"&(length(flgL)>0), //180526
tmp=flgL_(length(flgL));
- if(tmp=="i",
+ if(tmp=="i",
Repeatsameslide(repeatflg,sestr,["\end{itemize}"]);
);
if(tmp=="e",
@@ -4771,8 +4923,9 @@ Presentation(texfile,txtfile):=(
);
);
);
- println(SCEOUTPUT,"");
+// println(SCEOUTPUT,"");
);
+ println(SCEOUTPUT,"\label{pageend}\mbox{}"); //180529
println(SCEOUTPUT,"");
println(SCEOUTPUT,"\end{document}");
closefile(SCEOUTPUT);
@@ -4789,8 +4942,12 @@ Mkslides():=(
Dirwork=replace(Dirwork,"/",pathsep());
parent=replace(Dirwork+Batparent,"/",pathsep());// 16.05.29
);
- Dirwork=replace(Dirwork,pathsep()+"fig","");
+ tmp=replace(Dirwork,pathsep()+"fig","");//180604(2lines)
+ Changework(tmp);
Setdirectory(Dirwork);
+ if(!iswindows(), //180604from
+ println(setexec(Dirwork,Shellparent));
+ ); //180604to
if(length(Texmain)>0, // 15.08.14 from
Texparent=Texmain;
);
@@ -4802,7 +4959,7 @@ Mkslides():=(
drawtext(mouse().xy,Texparent+".txt not exist in "+Dirwork,
size->24,color->[1,0,0]);
, // 17.04.12until
- Presentation(Texparent); // 15.08.14 until
+ Presentation(Texparent); // 15.08.14to
if(iswindows(),
tmp2=Batparent;
parent=replace(Dirwork+Batparent,sep+"fig","");// 16.05.29
@@ -4855,21 +5012,24 @@ Mkslidesummary(inputfile,outputfile,options):=(
dirworkorg=Dirwork;//17.04.10from
dirtop=replace(Dirwork,pathsep()+"fig","");
Changework(dirtop);//17.04.10uptp
+ if(ismacosx(), //180604from
+ println(setexec(Dirwork,Shellparent));
+ ); //180604to
fin=inputfile;
if(indexof(fin,".")==0,fin=fin+".tex");
fout=outputfile;
if(indexof(fout,".")==0,fout=fout+".tex");
cmdL=[
- "Dt=readLines('"+fin+"')",[],
- "num=grep('\\hypertarget',Dt,fixed=TRUE)",[],
+ "Dt=readLines('"+fin+"',encoding='UTF-8')",[],
+ "num=grep('hypertarget',Dt,fixed=TRUE)",[], //180412
"Dt=Dt[setdiff(1:length(Dt),num)]",[],
"Smain=c();Snew=c();Ssame=c()",[],
"for(J in 1:length(Dt)){",[],
- " Tmp=length(grep('\\mainslide{',Dt[J],fixed=TRUE))",[],
+ " Tmp=length(grep('mainslide{',Dt[J],fixed=TRUE))",[], //180412
" if(Tmp>0){Smain=c(Smain,1)}else{Smain=c(Smain,0)}",[],
- " Tmp=length(grep('\\newslide{',Dt[J],fixed=TRUE))",[],
+ " Tmp=length(grep('newslide{',Dt[J],fixed=TRUE))",[], //180412
" if(Tmp>0){Snew=c(Snew,1)}else{Snew=c(Snew,0)}",[],
- " Tmp=length(grep('\\sameslide',Dt[J],fixed=TRUE))",[],
+ " Tmp=length(grep('sameslide',Dt[J],fixed=TRUE))",[], //180412
" if(Tmp>0){Ssame=c(Ssame,1)}else{Ssame=c(Ssame,0)}",[],
"}",[],
"Nnew=c();Nsame=c()",[],
@@ -4885,11 +5045,9 @@ Mkslidesummary(inputfile,outputfile,options):=(
"}",[],
"Tmp=max(c(Nsame[-1],Nnew[-1]))+1",[],
"Out=c(Out,Dt[Tmp:length(Dt)])",[],
- "writeLines(Out,'"+fout+"',sep='\n')",[],
- "cat('////',file='resultR.txt',sep='')",[],
- "quit()",[]
+ "writeLines(Out,'"+fout+"',sep='\n')",[] //180412(2lines removed)
];
- CalcbyR("out",cmdL,append(options,"Cat=n"));
+ CalcbyR("",cmdL,append(options,"Cat=n"));//180412
wait(1000);
Changework(dirtop);//17.04.10
tmp=replace(fout,".tex","");
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt
index 0c89e3e75ed..0c89e3e75ed 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt
index 93e5e323add..93e5e323add 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt
index 9a7edb2e99f..9a7edb2e99f 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt
index 354d6596a77..354d6596a77 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt
index 70b42e5ad65..e79262aa42c 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt
@@ -1,3 +1,22 @@
+// 20180614
+// Setpara changed (ReadOutData&Projpara removed fromGLISTbkup)
+// Setpara changed (the above also removed from COM2ndlist)
+// 20180611
+// Parafolder changed (path removed, Dirworkbkup&Dirworksubbkup used)
+// 20180610
+// Parafolder debugged (files not removed, waiting time for R)
+// Parafolder changed ( pause option adde )
+// 20180609
+// Parafolder changed (CommonMake)
+// Mkflipanime,Animationfile changed ( length(ParaSL) )
+// 20180608
+// Parafolder changed (to "all.r", to delete file)
+// 20180607
+// Parafolder debugged ( FnameR,.. => Setfiles)
+// 20180606
+// Setpara,Parafolder renewed
+// 20180602
+// divoptions ( 8,9 ->length(tmp)-1,length(tmp))
//2017.12.09
// Parafolder debugged (Viewtex ->WritetoRS)
// Mkanimation debugged ( \ -> / for windows )
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs
index e9978e7b653..a538afd1330 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs
@@ -14,12 +14,12 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindymv(20171124) loaded");
+println("ketcindymv(20180614) loaded");
//help:start();
-Setpara(path,fstr,sL):=Setpara(path,fstr,sL,[],[]); // 16.12.27added
-Setpara(pathorg,fstr,sL,options):= //17.11.25(3lines)
+Setpara(path,fstr,sL):=Setpara(path,fstr,sL,[],[]);
+Setpara(pathorg,fstr,sL,options):=
Setpara(pathorg,fstr,sL,options,[]);
Setpara(pathorg,fstr,sL,options,optionsanim):=(
//help:Setpara("folder name","funstr","range",options,optionsanim);
@@ -29,13 +29,31 @@ Setpara(pathorg,fstr,sL,options,optionsanim):=(
//help:Setpara(options2anim2=["OpA=[loop,controls,buttonsize=3mm]"]);
//help:Setpara(options2anim3=["OpA=+step"]);
//help:Setpara(options2anim4=["Mag=1600","Title=folder"]);
- regional(path);//17.04.10
+ regional(path,tmp,tmp1,tmp2,tmp3,eqL,ndiv,gtmp,ctmp,nn,flg);
if(length(pathorg)==0, path=Slidename,path=pathorg);//17.04.10
ParaPath=path;
ParaFstr=fstr;
ParaSL=sL;
+ if(isstring(sL),
+ ndiv=25;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ forall(eqL,
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(tmp_1);
+ if(substring(tmp1,0,1)=="D",
+ ndiv=parse(tmp_2);
+ );
+ );
+ tmp=Strsplit(sL,"=");
+ tmp1=parse(tmp_2);
+ ParaSL=apply(0..ndiv,tmp1_1+#*(tmp1_2-tmp1_1)/ndiv);
+ );
ParaOp=options;
- ParaOpAnim=optionsanim; //17.11.25
+ if((!contains(Paraop,"r"))&(!contains(ParaOp,"m")),
+ ParaOp=append(ParaOp,"m");//180604
+ );
+ ParaOpAnim=optionsanim;
GLISTback=GLIST;
GCLISTback=GCLIST;
GOUTLISTback=GOUTLIST;
@@ -46,167 +64,207 @@ Setpara(pathorg,fstr,sL,options,optionsanim):=(
COM0thlistback=COM0thlist;
COM1stlistback=COM1stlist;
COM2ndlistback=COM2ndlist;
+ Dirworkbkup=Dirwork; //0611from
+ Dirworksubbkup=Dirwork+pathsep()+ParaPath;
+ Changework(Dirworksubbkup);
+ Changework(Dirworkbkup);
+ Fheadbkup=Fhead; //0611to
+ gtmp=GLISTback;
+ tmp1=select(1..(length(gtmp)),indexof(gtmp_#,"ReadOutData")>0); //180614from
+ tmp2=[];tmp3=[];
+ forall(tmp1,nn,
+ tmp2=append(tmp2,nn);
+ flg=0;
+ tmp=min([nn+40,length(gtmp)]);
+ forall((nn+1)..tmp,
+ if(flg==0,
+ if(indexof(gtmp_#,"Projpara")>0,
+ tmp2=append(tmp2,#);
+ tmp=indexof(gtmp_#,"=");
+ tmp=substring(gtmp_#,0,tmp-1);
+ tmp3=append(tmp3,tmp);
+ ,
+ flg=1;
+ );
+ );
+ );
+ );
+ tmp1=remove(1..(length(gtmp)),tmp2);
+ GLISTback=apply(tmp1,GLIST_#); //180614to
+ ctmp=COM2ndlistback; //180614
+ forall(tmp3,tmp2,
+ tmp=select(ctmp,indexof(#,tmp2)>0);
+ ctmp=remove(ctmp,tmp);
+ );
+ COM2ndlistback=ctmp;
);
-Parafolder():=Parafolder(ParaPath,ParaFstr,ParaSL,ParaOp);
-Parafolder(path,fstr,sL):=Parafolder(path,fstr,sL,[]);
-Parafolder(path,fstr,sLorg,optionorg):=(
+Parafolder():=Parafolder(ParaFstr,ParaSL,ParaOp);
+Parafolder(fstr,sL):=Parafolder(fstr,sL,[]);
+Parafolder(fstr,sL,optionorg):=(
//help:Parafolder(foldername,1..4);
//help:Parafolder(foldername,"s=[0,1]");
//help:Parafolder("mf(s)",foldername,"s=[0,1]");
-//help:Parafolder(options=["m/r","Div=25","Wait=20"]);
+//help:Parafolder(options=["m/r","Div=25","Wait=20"]);
+//help:Parafolder(optionsadd=[""Outfile=n",Pause=10(ms)"]);
//help:Paraslide(para=folder:layery:pos:input,scale);
//help:Paraslide(para=folder:layery:pos:include:[width=100]);
- regional(nn,sL,tmp,tmp1,tmp2,strL,eqL,waiting,
- mkr,mktex,ndiv,options,sfL);
- if(!isstring(ParaPath),
- println("Setpara not executed");
- ,
- sL=sLorg;//16.12.24from
- if(!isstring(sL),
- tmp=indexof(fstr,"(");
- tmp1=substring(fstr,tmp,length(fstr));
- tmp=indexof(tmp1,")");
- tmp1=substring(tmp1,0,tmp-1);
- ,
- tmp=indexof(sL,"=");//16.12.21from
- if(length(tmp)>0,
- tmp1=substring(sL,0,tmp-1);
- );
+ regional(nn,tmp,tmp1,tmp2,strL,eqL,waiting,outflg,pause,
+ mkr,mktex,options,sfL,dirbkup,fbkup,pfile,ctr,flg,varL);
+ Changework(Dirworkbkup);
+ Setfiles(Fheadbkup);
+ tmp=indexof(fstr,"(");
+ tmp1=substring(fstr,tmp,length(fstr));
+ tmp=indexof(tmp1,")");
+ tmp1=substring(tmp1,0,tmp-1);
+ parse("Movieframe("+tmp1+"):="+fstr);
+ options=optionorg;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ strL=tmp_7;
+ if(length(strL)==0,options=append(options,"m"));
+ mkr="A";
+ mktex="A";
+ waiting=20;
+ outflg=0;
+ pause=10;
+ forall(eqL,
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(substring(tmp_1,0,1));
+ if(tmp1=="W",
+ waiting=parse(tmp_2);
+ options=remove(options,[#]);
);
- parse("Movieframe("+tmp1+"):="+fstr);
- options=optionorg;
- tmp=Divoptions(options);
- eqL=tmp_5;
- strL=tmp_7;
- if(length(strL)==0,options=append(options,"m"));//16.12.18
- mkr="A";
- mktex="A";
- ndiv=25;
- waiting=20;
- forall(eqL,
- tmp=Indexof(#,"=");
- tmp1=Toupper(substring(#,0,1));
- tmp2=substring(#,tmp,length(#));
- if(tmp1=="D",
- ndiv=parse(tmp2);
- options=remove(options,[#]);
- );
- if(tmp1=="W",
- waiting=parse(tmp2);
- options=remove(options,[#]);
- );
+ if((tmp1=="O")%(tmp1=="R"), //180606from
+ tmp=Toupper(substring(tmp_2,0,1));
+ if(tmp=="Y", outflg=1);
+ options=remove(options,[#]);
);
- forall(strL,
- tmp1=Toupper(substring(#,0,1));
- if(tmp1=="M",
- mkr="Y"; mktex="Y";
- );
+ if(tmp1=="P", //180610from
+ pause=parse(tmp_2);
+ options=remove(options,[#]);
+ ); // //180610to
+ );
+ forall(strL,
+ tmp1=Toupper(substring(#,0,1));
+ if(tmp1=="M",
+ mkr="Y"; mktex="Y";
);
- sL=sLorg;
- if(isstring(sL),
- tmp=indexof(sL,"=");
- tmp1=parse(substring(sL,tmp,length(sL)));
- sL=apply(0..ndiv,tmp1_1+#*(tmp1_2-tmp1_1)/ndiv);
+ );
+ Changework(Dirworksubbkup);
+ SCEOUTPUT = openfile("all.r");
+ println(SCEOUTPUT,"");
+ closefile(SCEOUTPUT);//180608to
+ if(outflg==1, //180606from
+ CommonMake=1;//180609
+ ctr=1;
+ forall(sL,
+ tmp="000000"+text(ctr);
+ pfile="p"+substring(tmp,length(tmp)-3,length(tmp));
+ Setfiles(pfile);
+ Changework(Dirworksubbkup);
+ Movieframe(#);
+ Changework(Dirworksubbkup);//180608
+ ctr=ctr+1;
);
- if(!isexists(Dirwork,path),
- if(ErrFlag!=-1,
- makedir(Dirwork,path)
- ,
- println(" ==> Changework may not work properly");
- sL=[];
- );
+ CommonMake=-1;//180609
+ Setfiles(fbkup);
+ ); //180606to
+ wait(pause); //180610
+// Changework(Dirworkbkup);
+ sfL=[];
+ ctr=1;
+ forall(1..(length(sL)),nn,
+ Changework(Dirworkbkup);//180611(2lines)
+ Setfiles(Fheadbkup);
+ GLIST=GLISTback;
+ GCLIST=GCLISTback;
+ GOUTLIST=GOUTLISTback;
+ POUTLIST=POUTLISTback;
+ VLIST=VLISTback;
+ FUNLIST=FUNLISTback;
+ LETTERlist=LETTERlistback;
+ COM0thlist=COM0thlistback;
+ COM1stlist=COM1stlistback;
+ COM2ndlist=COM2ndlistback;
+ tmp="000000"+text(nn);
+ pfile="p"+substring(tmp,length(tmp)-3,length(tmp));
+ Setfiles(pfile);
+ Changework(Dirworksubbkup);
+ sfL=append(sfL,FnameR);
+ if(outflg==1,
+ Changework(Dirworksubbkup);//180606
+ Setfiles(pfile); //180610(2lines)
+ wait(pause);
+ Movieframe(sL_nn);
+ Changework(Dirworksubbkup);//180606
+ ctr=ctr+1;
,
- tmp=fileslist(Dirwork+pathsep()+path); //17.12.09(3lines);
- tmp=length(tmp);
- if((mkr=="Y") & (tmp>0),
- tmp1=replace(Dirwork,"\","/");//17.10.13
- cmdL=[
- "setwd",[Dq+tmp1+"/"+path+Dq],
- "fL=as.matrix(list.files())",[],
- "apply",["fL",2,"file.remove"],
- "setwd",[Dq+tmp1+Dq],
- ];
- CalcbyR("rvf",cmdL,["Cat=n","m"]);
- tmp=Dirwork+pathsep()+path;
- repeat(1..30,
- if(length(fileslist(tmp))>0,wait(10));
- );
- );//17.02.20until
- );
- sfL=[];
- forall(1..(length(sL)),nn,
- GLIST=GLISTback;
- GCLIST=GCLISTback;
- GOUTLIST=GOUTLISTback;
- POUTLIST=POUTLISTback;
- VLIST=VLISTback;
- FUNLIST=FUNLISTback;
- LETTERlist=LETTERlistback;
- COM0thlist=COM0thlistback;
- COM1stlist=COM1stlistback;
- COM2ndlist=COM2ndlistback;
- tmp1=Sprintf(nn/1000,3);
- tmp=indexof(tmp1,".");
- tmp1=substring(tmp1,tmp,length(tmp1));
- FnameR=path+"/p"+tmp1+".r";
- sfL=append(sfL,FnameR);
- Fnametex=replace(FnameR,".r",".tex");
- Movieframe(sL_nn); //17.10.13
- if(!isexists(Dirwork,FnameR) % mkr=="Y",
- if(ErrFlag!=-1,
- WritetoRS(2); //17.12.09
- );
+ Movieframe(sL_nn);
+ );
+ CommonMake=0;//180609
+ Setfiles(pfile); //180608
+ if(!isexists(Dirworksubbkup,FnameR) % mkr=="Y",
+ if(ErrFlag!=-1,
+ WritetoRS(2);
);
- );
- tmp1=replace(Dirwork,"\","/"); //17.10.13
- cmdL=[
- "setwd",[Dq+tmp1+"/"+path+Dq],
- "Mkallfile=function(fname){",[],
- " Ctr<<- Ctr+1",[],
- " tmp=readLines(fname)",[],
- " first=1",[],
- " if(Ctr>1){",[],
- " first=7",[],
- " cat('Ketinit()\n',file='all.r',append=TRUE)",[],
+ );
+ );
+ wait(pause); //180610
+ Setfiles(fkbkup);
+ Changework(Dirworksubbkup);
+ GLIST=select(GLIST,indexof(#,"Projpara")==0);
+ tmp1=replace(Dirworksubbkup,"\\","/"); //180611
+ tmp1=replace(tmp1,"\","/");
+ cmdL=[
+ "setwd("+Dqq(tmp1)+")",[],
+ "size="+text(length(sL)),[],
+ "cat('',file='all.r',sep='',append=FALSE)",[], //180614
+ "for(n in Looprange(1,size)){",[],
+ " tmp=as.character(n)",[],
+ " tmp=paste('0000',tmp,sep='')",[],
+ " tmp=substring(tmp,nchar(tmp)-2,nchar(tmp))",[],
+ " fname=paste('p',tmp,'.r',sep='')",[],
+ " lines=readLines(fname)",[],
+ " if(n>1){",[], //180614from
+ " for(j in 1:length(lines)){",[],
+ " tmp=grep('source',lines[j],fixed=TRUE)",[],
+ " if(length(tmp)>0){",[],
+ " lines[j]=paste('#',lines[j],sep='')",[],
+ " lines[j+2]=paste('#',lines[j+2],sep='')",[],
+ " break",[],
+ " }",[],
+ " }",[],
" }",[],
- " for(J in first:(length(tmp)-1)){",[],
- " cat(paste(tmp[J],'\n',sep=''),file='all.r',append=TRUE)",[],
+ " lines=lines[1:(length(lines)-1)]",[], //180614to
+ " tmp=paste('print(',as.character(n),')',sep='')",[],
+ " lines=c(tmp,lines)",[],
+ " for(j in Looprange(1,length(lines))){",[],
+ " cat(lines[j],file='all.r',sep='\n',append=TRUE)",[],
" }",[],
- " cat('print(',Ctr,')\n',file='all.r',append=TRUE)",[],
- " Tmp=proc.time()-Tm",[],
- " cat('print(',Tmp[3],')\n',file='all.r',append=TRUE)",[],
- "}",[],
- "if(file.exists('all.r')){file.remove('all.r')}",[], //17.10.24
- "fL=list.files()",[],
- "Ctr=0",[],
- "Tm<-invisible(proc.time())",[],
- "for(fname in fL){",[],
- " if(length(grep('.r',fname))>0){Mkallfile(fname)}",[], // 17.11.24
"}",[],
- "source('all.r')",[],
- "setwd",[Dq+tmp1+Dq]
- ];
- if(ErrFlag!=-1,
- if(!isexists(Dirwork,Fnametex) % mktex=="Y",
- CalcbyR("all",cmdL,["Cat=n","m","Wait="+text(waiting)]);
- ,
- println("Parafolder "+path+" finished");//16.12.20
- );
- if(length(after)>0, // 16.12.27
- parse(after);
- );
- FnameR=Fhead+".r";
- Fnametex=Fhead+".tex";
+ "source('all.r')",[]
+ ];
+ if(ErrFlag!=-1,
+ waiting=min([waiting,8])*length(ParaSL); //180610
+ if(!isexists(Dirworksubbkup,Fnametex) % mktex=="Y",
+ CalcbyR("",cmdL,["Cat=n","m","Wait="+text(waiting)]);
+ ,
+ println("Parafolder finished");
+ );
+ if(length(after)>0,
+ parse(after);
);
);
+ Changework(Dirworkbkup);
+ Setfiles(Fheadbkup);
);
Animatefile():=Animatefile(Dirwork,ParaPath);
Animatefile(path,folder):=(
//help:Animatefile();
//help:Animatefile(Dirwork,ParaPath);
- regional(FRate, Scale, OpA, pa,fname,eqL,tmp,tmp1,tmp2);
+ regional(FRate, Scale, OpA, pa,fname,eqL,tmp,tmp1,tmp2,texfiles);
tmp=divoptions(ParaOpAnim); //17.11.24
eqL=tmp_5;
FRate="10";
@@ -244,11 +302,19 @@ Animatefile(path,folder):=(
tmp1=fileslist(tmp);
tmp1=tokenize(tmp1,",");
tmp1=select(tmp1,indexof(#,".tex")>0);
+ texfiles=[];//180609from
+ forall(tmp1,
+ tmp=indexof(#,".");
+ tmp=parse(substring(#,1,tmp-1));
+ if(tmp<=length(ParaSL),
+ texfiles=append(texfiles,#);
+ );
+ );//180609to
SCEOUTPUT= openfile(fname);
println(SCEOUTPUT,"\def\parapath{"+pa+"}%"); //17.06.22
println(SCEOUTPUT,"\def\figsize{"+Scale+"}%"); //17.12.07
println(SCEOUTPUT,"\begin{animateinline}"+OpA+"{"+FRate+"}%");
- forall(1..(length(tmp1)),
+ forall(1..(length(texfiles)), //180609
if(Scale==1, // 17.08.30from
tmp="\input{\parapath/";
tmp=tmp+folder+"/"+tmp1_#+"}%";
@@ -511,7 +577,15 @@ Mkflipanime(path,folder):=(
println(SCEOUTPUT,"");
tmp=fileslist(Dirwork+pathsep()+folder);
tmp=tokenize(tmp,",");
- texfiles=select(tmp,indexof(#,".tex")>0);
+ tmp1=select(tmp,indexof(#,".tex")>0); //180609from
+ texfiles=[];
+ forall(tmp1,
+ tmp=indexof(#,".");
+ tmp=parse(substring(#,1,tmp-1));
+ if(tmp<=length(ParaSL),
+ texfiles=append(texfiles,#);
+ );
+ );//180609to
forall(texfiles,
println(SCEOUTPUT,"\vspace*{25mm}");
println(SCEOUTPUT,"");
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt
index 94752a33760..77e7c8c8656 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt
@@ -1,3 +1,78 @@
+// 20180612
+// Hatchdata renamed to HatchdataR
+// kcC changed ( "gcc -lm" )
+// 20180611
+// StartsurfC changed ( "reset" of GLIST )
+// 20180610
+// StartsurfC debugged ( sizeL )
+// 20180609
+// StartsurfC changed ( multi type of setting constant)
+// ExeccmdC changed (CommonMake)
+// 20180608
+// StartsurfC changed ( FuncListC reset)
+// ExeccmdC changed ( Fhead printed)
+// ExeccmdC, Crvsfparadata,... changed (Projpara with "Msg=n" )
+// CalcbyR changed (Wait=30)
+// 20180607
+// CrvsfparadataC,WireparadataC debugged ( "sprintf..." of CommandListC);
+// SfbdparadataC changed (name: funnm =>nm )
+// 20180606
+// StartsurfC added
+// SfbdparadataC changed (FuncListC)
+// Setpara, Parafolder renewed
+// 20180605
+// ExeccmdC changed ("Path=" option supported )
+// 20180602
+// divoptions ( 8,9 ->length(tmp)-1,length(tmp))
+// ExeccmdC changed ( optionsh (default="do"), varL )
+// Crv2onsfparadata,Crv3onsfparadata debugged
+// 20180601
+// SfbdparadataC,... changed ( fbdy => sfbd)
+// Ctopsurf changed (data[DsizeL][3],sfbd[DsizeL][3] added )
+// Ctosurf changed (CutFunList)
+// SfbdparadataC changed ( "w" or "a" set according to CommandListC)
+// Wireparadata,Sfcutdata changed (cmdflg)
+// ExeccmdC changed ( EraseList );
+// 20180531
+// SfbdparadataC changed ( outputend added, readoutdata3 changed)
+// 20180530
+// Ctopsurf changed ( stdlib.h, string.h)
+// CrvsfparadataC,Crvonsfparadata,... changed (readoutdata3 used for fbdy)
+// 20180523
+// Cheadsurf,Ctopsurf debugged (case => break added )
+// Cheadsurf debugged ( Dirname "\" => "/")
+// CalcbyC debugged ( "////" )
+// 20180521
+// IntersectcrvsfC added
+// 20180517
+// Cform debugged ( "=", tmp=0)
+// SfbdparadataC,... changed ( "" removed from optionh )
+// CalcbyC changed ( "result" => "end" )
+// 20180516
+// Ctopsurf debugged ( : => ;)
+// 20180510
+// CalcbyR changed ( for the last command )
+// Crv2sfparadataC added
+// 20180508
+// MkprecommandR changed (PVOFG)
+// CalcbyR changed (option Pre)
+// 20180505
+// Ctopsurf changed ( for mult cutfun)
+// 20180504
+// Ketinit debuggde (MARKLEN : )
+// 20180502
+// CostC removed
+// SetconstantC added
+// 20180428
+// CrvsfparadataC changed (Changestyle => "nodisp")
+// Ctopsurf changed (data[DsizeLL][3] removed )
+// 20180426
+// CrvsfparadataC largely changed
+// WritedataC changed ( \n removed at the last line )
+// 2018.04.12
+// CalcbyR changed ( for blank name )
+// 2018.04.11
+// Mkketcindyjs debugged
// 2018.03.27
// functions of C changed
// CalcbyC added
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
index 1bb3e3439c6..ef6f151f6b3 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
@@ -14,7 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindyout(20180327) loaded");
+println("ketcindylibout(20180612 loaded");
//help:start();
@@ -646,6 +646,90 @@ Dataframe(nmL,dL,options):=(
out=replace(out,"]",")");
);
+MkprecommandR():=MkprecommandR(6,"PVOFG"); //180508(9lines)
+MkprecommandR(Arg):=(
+ regional(out,tmp1);
+ if(isstring(Arg),
+ MkprecommandR(6,Arg);
+ ,
+ if(islist(Arg),
+ out=[];
+ forall(Arg,
+ tmp1=Rform(#);
+ out=concat(out,[tmp1,[]]);
+ );
+ out;
+ ,
+ MkprecommandR(Arg,"PVOFG");
+ );
+ );
+);
+MkprecommandR(prec,chstr):=(
+ regional(cmdL,Plist,tmp,tmp1,tmp2);
+ cmdL=[];
+ if(indexof(chstr,"P")>0,
+ Plist=[];
+ forall(remove(allpoints(),[SW,NE]),
+ tmp=textformat(re(Lcrd(#)),prec);
+ tmp=RSform(tmp);
+ tmp1=#.name;
+ tmp1=tmp1+"="+tmp+";Assignadd('"+tmp1+"',"+tmp1+")";
+ Plist=append(Plist,tmp1);
+ );
+ forall(1..(length(Plist)),
+ cmdL=concat(cmdL,[Plist_#,[]]);
+ );
+ );
+ if(indexof(chstr,"V")>0,
+ tmp2=sort(apply(VLIST,#_1)); // 16.02.03 from
+ tmp=apply(allpoints(),text(#));//18.02.11
+ tmp2=remove(tmp2,tmp);
+ tmp1=[];
+ forall(tmp2,tmp,
+ tmp1=concat(tmp1,select(VLIST,#_1==tmp));
+ );
+ VLIST=tmp1;// 17.09.24from
+ forall(VLIST,
+ tmp=#_1;
+ tmp1=#_2;
+ if(!isstring(tmp1),
+ if(islist(tmp1),
+ tmp2="[";
+ forall(tmp1,
+ tmp2=tmp2+textformat(#,prec)+",";
+ );
+ tmp1=substring(tmp2,0,length(tmp2)-1)+"]";
+ ,
+ tmp1=format(tmp1,prec);
+ );
+ );
+ tmp1=RSform(tmp1);
+ tmp1=tmp+"="+tmp1+";";
+ tmp1=tmp1+"Assignadd('"+tmp+"',"+tmp+")";
+ cmdL=concat(cmdL,[tmp1,[]]);//17.09.24until
+ );
+ );
+ if(indexof(chstr,"O")>0,
+ forall(OutFileList,
+ cmdL=concat(cmdL,["tmp=ReadOutData",[Dq+#+Dq]]);
+ );
+ );
+ if(indexof(chstr,"F")>0,
+ forall(FUNLIST,
+ cmdL=concat(cmdL,[#,[]]);
+ );
+ );
+ if(indexof(chstr,"G")>0,
+ forall(GLIST,
+ if(indexof(#,"ReadOutData")==0, //18.02.12
+ tmp1=Rform(#);
+ cmdL=concat(cmdL,[tmp1,[]]);
+ );
+ );
+ );
+ cmdL;
+);
+
CalcbyR(name,cmd):=CalcbyR(name,PathR,cmd,[]);
CalcbyR(name,Arg1,Arg2):=(
if(isstring(Arg1),
@@ -656,9 +740,10 @@ CalcbyR(name,Arg1,Arg2):=(
);
CalcbyR(name,path,cmd,optionorg):=(
//help:CalcbyR(name,cmd);
-//help:CalcbyR(options=["m/r","Wait=2","Out=yes","Pre=yes","Res=" ]);
+//help:CalcbyR(options=["m/r","Wait=2","Out=yes","Pre=PVOFG","Res=" ]);
+//help:CalcbyR(options2=["Pre=!G" ]);
regional(options,tmp,tmp1,tmp2,tmp3,realL,strL,eqL,
- cat,dig,preflg,flg,wflg,file,nc,arg,cmdR,cmdlist,wfile,waiting);
+ cat,dig,prestr,flg,wflg,file,nc,arg,cmdR,cmdlist,wfile,waiting);
options=optionorg;
tmp=divoptions(options);
eqL=tmp_5;
@@ -667,12 +752,12 @@ CalcbyR(name,path,cmd,optionorg):=(
dig=5;
cat="Y";
wfile="";
- preflg=1;
- waiting=5;
+ prestr="PVOFG"; //180508
+ waiting=30; //180608
forall(eqL,
- tmp=indexof(#,"=");
- tmp1=Toupper(substring(#,0,1));
- tmp2=substring(#,tmp,length(#));
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(substring(tmp_1,0,1));
+ tmp2=tmp_2;
if((tmp1=="C")%(tmp1=="O"),
cat=Toupper(substring(tmp2,0,1));
options=remove(options,[#]);
@@ -681,10 +766,16 @@ CalcbyR(name,path,cmd,optionorg):=(
waiting=parse(tmp2);
options=remove(options,[#]);
);
- if(tmp1=="P", //18.01.27
- tmp2=substring(Toupper(tmp2),0,1);
- if(tmp2=="Y",preflg=1);
- if(tmp2=="N",preflg=0);
+ if(tmp1=="P", //180508from
+ tmp2=Toupper(tmp2);
+ if(substring(tmp2,0,1)!="!",
+ prestr=tmp2;
+ ,
+ tmp2=substring(tmp2,1,length(tmp2));
+ forall(1..(length(tmp2)),
+ prestr=replace(prestr,substring(tmp2,#-1,#),"");
+ );
+ );//180508to
options=remove(options,[#]);
);
if(tmp1=="D",
@@ -704,7 +795,7 @@ CalcbyR(name,path,cmd,optionorg):=(
if(cat=="Y",
wfile=Fhead+name+".txt";
,
- wfile="result.txt";
+ wfile="resultR.txt";
);
);
wflg=0;
@@ -725,12 +816,14 @@ CalcbyR(name,path,cmd,optionorg):=(
if(length(tmp)==0,wflg=1);
);
);
- file=Fhead+name;
+ if(length(name)>0,//180412from
+ file=Fhead+name;
+ ,
+ file=Cindyname();
+ );//180412to
cmdR=[];
- if(preflg==1, //18.01.27from
- cmdR=MkprecommandR();
- );
- cmdR=concat(cmdR,cmd); //18.01.27until
+ cmdR=MkprecommandR(6,prestr);
+ cmdR=concat(cmdR,cmd); //18.01.27to
cmdlist=[];
if(dig>5, //16.10.28from
cmdlist=append(cmdlist,"options(digits="+text(dig+2)+");");
@@ -738,9 +831,9 @@ CalcbyR(name,path,cmd,optionorg):=(
forall(1..floor(length(cmdR)/2),nc, //17.05.18
tmp1=cmdR_(2*nc-1);
tmp1=replace(tmp1,LFmark,""); // 16.06.12
- if(nc==length(cmdR)/2, //16.10.23from
+// if(nc==length(cmdR)/2, //16.10.23from
// if(indexof(tmp1,"=")==0,tmp1="="+tmp1);//16.12.20
- ); //16.10.23uptp
+// ); //16.10.23uptp
if(substring(tmp1,0,1)=="=",
tmp1=name+tmp1;
);
@@ -769,17 +862,23 @@ CalcbyR(name,path,cmd,optionorg):=(
);
tmp1=cmdlist_(length(cmdlist));
if(indexof(tmp1,"=")==0,
- tmp1=tokenize(tmp1,"::");
- if(length(tmp1)==1,
- tmp2=name+"="+tmp1_1;
- ,
- tmp2=name+"=list(";
- forall(tmp1,
- tmp2=tmp2+#+",";
+ if(length(name)>0, //180412
+ tmp1=tokenize(tmp1,"::");
+ if(length(tmp1)==1,
+ if(indexof(tmp1_1,"(")==0, //180510from
+ tmp2=name+"="+tmp1_1;
+ ,
+ tmp2=tmp1_1;
+ ); //180510to
+ ,
+ tmp2=name+"=list(";
+ forall(tmp1,
+ tmp2=tmp2+#+",";
+ );
+ tmp2=substring(tmp2,0,length(tmp2)-1)+")"; //180510(moved)
);
- tmp2=substring(tmp2,0,length(tmp2)-1)+")";
+ cmdlist_(length(cmdlist))=tmp2;
);
- cmdlist_(length(cmdlist))=tmp2;
);
if(CONTINUED==1,
ComOutList=concat(ComOutList,cmdlist);
@@ -1197,10 +1296,10 @@ Writecsv(nmL,dataorg,file,optionorg):=(
closefile(SCEOUTPUT);
);
-Hatchdata(nm,iostr,pltlist):=Hatchdata(nm,iostr,pltlist,[]);
-Hatchdata(nm,iostr,pltlist,optionorg):=( //17.09.18
-//help:Hatchdata("1","ii",[["gr1"],["gr2","n"]]);
-//help:Hatchdata(options=["Wait=5"]);
+HatchdataR(nm,iostr,pltlist):=HatchdataR(nm,iostr,pltlist,[]);
+HatchdataR(nm,iostr,pltlist,optionorg):=( //17.09.18
+//help:HatchdataR("1","ii",[["gr1"],["gr2","n"]]);
+//help:HatchdataR(options=["Wait=5"]);
regional(options,name,eqL,reL,strL,
plt,fname,options,tmp,tmp1,tmp2,tmp3,flg,wflg,waiting);
name="ha"+nm;
@@ -1896,66 +1995,6 @@ Rulerscale(pt,hscale,vscale,tick):=(
);
);
-MkprecommandR():=MkprecommandR(6);
-MkprecommandR(prec):=(
- regional(cmdL,Plist,tmp,tmp1,tmp2);
- Plist=[];
- Pnamelist=[];
- Pvaluelist=[];
- forall(remove(allpoints(),[SW,NE]),
- tmp=textformat(re(Lcrd(#)),prec);
- tmp=RSform(tmp);
- tmp1=#.name;
- tmp1=tmp1+"="+tmp+";Assignadd('"+tmp1+"',"+tmp1+")";
- Plist=append(Plist,tmp1);
- );
- cmdL=[];
- forall(1..(length(Plist)),
- cmdL=concat(cmdL,[Plist_#,[]]);
- );
- tmp2=sort(apply(VLIST,#_1)); // 16.02.03 from
- tmp=apply(allpoints(),text(#));//18.02.11
- tmp2=remove(tmp2,tmp);
- tmp1=[];
- forall(tmp2,tmp,
- tmp1=concat(tmp1,select(VLIST,#_1==tmp));
- );
- VLIST=tmp1;// 17.09.24from
- forall(VLIST,
- tmp=#_1;
- tmp1=#_2;
- if(!isstring(tmp1),
- if(islist(tmp1),
- tmp2="[";
- forall(tmp1,
- tmp2=tmp2+textformat(#,6)+",";
- );
- tmp1=substring(tmp2,0,length(tmp2)-1)+"]";
- ,
- tmp1=format(tmp1,6);
- );
- );
- tmp1=RSform(tmp1);
- tmp1=tmp+"="+tmp1+";";
- tmp1=tmp1+"Assignadd('"+tmp+"',"+tmp+")";
- cmdL=concat(cmdL,[tmp1,[]]);//17.09.24until
- );
- forall(OutFileList,
- cmdL=concat(cmdL,["tmp=ReadOutData",[Dq+#+Dq]]);
- );
- forall(FUNLIST,
- cmdL=concat(cmdL,[#,[]]);
- );
- forall(GLIST,
- if(indexof(#,"ReadOutData")==0, //18.02.12
- tmp1=Rform(#);
- cmdL=concat(cmdL,[tmp1,[]]);
- );
- );
- cmdL;
-);
-
-
MkprecommandS():=MkprecommandS(6);
MkprecommandS(prec):=(
regional(cmdL,Plist,Pnamelist,Pvaluelist,tmp,tmp1,tmp2);
@@ -2029,8 +2068,8 @@ MkprecommandS(prec):=(
PlotdataS(name1,func,var):=PlotdataS(name1,func,var,[]);
PlotdataS(nm,fun,variable,optionorg):=(
-//help:PlotdataS("1","besselj(1,x)","x");
-//help:PlotdataS(options=["m/r","Num=50","Wait=5","Mx=no"]);
+// help:PlotdataS("1","besselj(1,x)","x");
+// help:PlotdataS(options=["m/r","Num=50","Wait=5","Mx=no"]);
regional(options,name,varstr,Num,waiting,mxcheck,outreg,
eqL,strL,fname,tmp,tmp1,tmp2,tmp3,cmdL,flg,wflg);
name="grsc"+nm;
@@ -4542,8 +4581,17 @@ Mkketcindyjs(Arg):=(
);
Mkketcindyjs(libname,options):=( //17.11.18
//help:Mkketcindyjs();
-//help:Mkketcindyjs(options="Tex=y","Net=y"]);
- regional(texflg,netflg,tmp,tmp1,tmp2);
+//help:Mkketcindyjs(options=["Tex=y","Net=y"]);
+ regional(texflg,netflg,tmp,tmp1,tmp2,dirfile,dirwork,dirketjs);
+ dirwork=replace(Dirwork,"\","/");
+ tmp=replace(Dircdy,"\","/");
+ if(substring(tmp,length(tmp)-1,length(tmp))=="/",//180411from
+ dirfile=substring(tmp,0,length(tmp)-1);
+ ,
+ dirfile=tmp;
+ );//180411to
+ tmp=replace(Dirlib,"\","/");
+ dirketjs=replace(tmp,"ketlib","ketcindyjs");//180411to
texflg="Y";
netflg="Y";
forall(options,
@@ -4557,15 +4605,15 @@ Mkketcindyjs(libname,options):=( //17.11.18
netflg=Toupper(substring(tmp1,tmp,tmp+1));
);
);
- if(isexists(Dirwork,Fhead+".html"),
+ if(isexists(dirfile,Fhead+".html"),//180411to
SCEOUTPUT = openfile(Fhead+".r");
println(SCEOUTPUT,"Looprange<- function(a,b){");
println(SCEOUTPUT," if (a<=b) return(a:b)");
println(SCEOUTPUT," return(c())");
println(SCEOUTPUT,"}");
- println(SCEOUTPUT,"setwd('"+Dirfile+"/CindyJS')");
+ println(SCEOUTPUT,"setwd('"+dirketjs+"')");
println(SCEOUTPUT,"Dtket=readLines('"+libname+".txt')");
- println(SCEOUTPUT,"setwd('"+Dirwork+"')");
+ println(SCEOUTPUT,"setwd('"+dirfile+"')");//180411
println(SCEOUTPUT,"Dtjs=readLines('"+Fhead+".html')");
println(SCEOUTPUT,"Qt=rawToChar(as.raw(34))");
println(SCEOUTPUT,
@@ -4579,7 +4627,7 @@ Mkketcindyjs(libname,options):=( //17.11.18
println(SCEOUTPUT,
" if(length(grep('link rel=',Tmp,fixed=TRUE))>0){");
println(SCEOUTPUT,
- " Tmp1='file:///"+Dirfile+"/CindyJS/CindyJS.css'");
+ " Tmp1='file:///"+dirketjs+"/CindyJS.css'");//180411
println(SCEOUTPUT,
" Tmp=paste(' <link rel=',Qt,'stylesheet',Qt,' href=',Qt,Tmp1,Qt,'>',sep='')");
println(SCEOUTPUT,
@@ -4591,7 +4639,7 @@ Mkketcindyjs(libname,options):=( //17.11.18
println(SCEOUTPUT,
" if(Tmp1>0){");
println(SCEOUTPUT,
- " Tmp1='file:///"+Dirfile+"/CindyJS/Cindy.js'");
+ " Tmp1='file:///"+dirketjs+"/Cindy.js'");//180411
println(SCEOUTPUT,
" Tmp=paste(' <script type=',Qt,'text/javascript',Qt,' src=',Qt,Tmp1,Qt,'>',sep='')");
println(SCEOUTPUT,
@@ -4633,7 +4681,7 @@ Mkketcindyjs(libname,options):=( //17.11.18
" if(length(grep(paste(Qt,'Parent',sep=''),Dtjs[I],fixed=TRUE))>0){next}");
println(SCEOUTPUT,
" if(length(grep(paste(Qt,'KeTJS',sep=''),Dtjs[I],fixed=TRUE))>0){next}");
- println(SCEOUTPUT,
+ println(SCEOUTPUT,
" }");
println(SCEOUTPUT," Dt=c(Dt,Dtjs[I])");
if(texflg=="Y",
@@ -4645,12 +4693,14 @@ Mkketcindyjs(libname,options):=( //17.11.18
" }");
);
println(SCEOUTPUT,"}");
+ println(SCEOUTPUT,"setwd('"+dirfile+"')");//180411
println(SCEOUTPUT,"writeLines(Dt,'"+Fhead+"ketcindy.html',sep='\n')");
println(SCEOUTPUT,"quit()");
closefile(SCEOUTPUT);
kcR(PathR,Fhead+".r",["m"]);
+ println(Fhead+"ketcindy.html generated successfully");
,
- drawtext(mouse().xy-[0,1],"First export to CindyJS",size->24,color->[1,0,0]);
+ drawtext(mouse().xy-[0,1],"use 'write to CindyJS' before that",size->24,color->[1,0,0]);
wait(3000);
);
);
@@ -4658,10 +4708,10 @@ Mkketcindyjs(libname,options):=( //17.11.18
///////////////// C function //////////////////
Cform(strorg):=(
-//help:Cform(str)
+//help:Cform(str);
regional(str,ter,out,hat,ns,ne,nn,jj,flg,
lv,str1,str2,tmp,tmp1,tmp2);
- ter=["+","-","*","/","(",")"];
+ ter=["+","-","*","/","(",")","="]; //180517
str=replace(strorg,"pi","M_PI");
hat=Indexall(str,"^");
out="";
@@ -4677,6 +4727,7 @@ Cform(strorg):=(
out=out+substring(str,ns,ns+tmp-1);
str1=substring(str,ns+tmp,nn-2);
,
+ tmp=0;//180517
flg=0;
tmp2=reverse(ns..(nn-1));
forall(tmp2,jj,
@@ -4769,31 +4820,46 @@ ConvertFdtoC(Fd,name):=(
FdC=concat(FdC,[tmp1_6]);
);
-ConstC(setlist):=( //180323
- regional(divL,sizeL,epsL);
- //Mdv=50; Ndv=50;
- //DsizeLL=5000; DsizeL=1500; DsizeM=500; DsizeS=200;
- //Eps=0.00001; Eps1=0.01; Eps2=0.1;
- forall(setlist,
- if((#_1>1)&(#_1<=200),
- divL=#;
- if(length(divL)==0,divL=[50]);
- if(length(divL)==1,divL=append(divL,divL_1));
+StartsurfC():=StartsurfC("",[50,50],[1500,500,200],[0.01,0.1]);//180611renewed
+StartsurfC(Arg):=(
+ regional(tmp);
+ if(isstring(Arg),
+ StartsurfC(Toupper(Arg),[50,50],[1500,500,200],[0.01,0.1]);
+ ,
+ tmp=max(Arg);
+ if(tmp>=500,
+ StartsurfC("",[50,50],Arg,[0.01,0.1]);
,
- if(#_1>=100,
- sizeL=#;
- if(length(sizeL)==0,sizeL=[5000]);
- if(length(sizeL)==1,sizeL=append(sizeL,1500));
- if(length(sizeL)==2,sizeL=append(sizeL,500));
- if(length(sizeL)==3,sizeL=append(sizeL,200));
+ if(tmp>1,
+ StartsurfC("",Arg,[1500,500,200],[0.01,0.1]);
,
- epsL=#;
- if(length(epsL)==0,epsL=[0.01]);
- if(length(epsL)==1,epsL=append(epsL,0.1));
- epsL=prepend(0.00001,epsL);
+ StartsurfC("",[50,50],[1500,500,200],Arg);
);
);
);
+);
+StartsurfC(restr,Nplist,Dsizelist,Epslist):=(//180501
+//help:StartsurfC();
+//help:StartsurfC("reset");
+//help::StartsurfC([0.01,0.1]);
+//help:StartsurfC([50,50],[1500,500,200],[0.01,0.1]);
+//help:StartsurfC([50],[1500,500],[0.01,0.1]);
+ regional(divL,sizeL,epsL);
+ CommandListC=[];//180608(2lines)
+ FuncListC=[];
+ if(substring(restr,0,1)=="R", //180611(3lines)
+ GLIST=[];
+ );
+ divL=Nplist; sizeL=Dsizelist; epsL=Epslist;
+ if(length(divL)==0,divL=[50]);
+ if(length(divL)==1,divL=append(divL,divL_1));
+ if(length(sizeL)==0,sizeL=[1500]); //180610from
+ if(length(sizeL)==1,sizeL=append(sizeL,500));
+ if(length(sizeL)==2,sizeL=append(sizeL,200));
+ sizeL=prepend(5000,sizeL); //180610to
+ if(length(epsL)==0,epsL=[0.01]);
+ if(length(epsL)==1,epsL=append(epsL,0.1));
+ epsL=prepend(0.00001,epsL);
ConstantListC=[divL,sizeL,epsL];
);
@@ -4978,7 +5044,7 @@ Cmain(fname,cmdLorg):=(
tmp3=concat(tmp3,[
"double "+tmp2_1+"[DsizeL][3];",[], //17.06.09(6lines)
"sfbdparadata",[tmp2_1],
- "output3h",[var, varh,file,tmp2_1],
+ "output3h",["w",var, varh,file,tmp2_1],
"dataindexd3",[3,tmp2_1,"din"],
tmp2_2+"[0][0]=0;",[],
"appendd3",[2,"din[1][0]","din[1][1]",tmp2_1,tmp2_2]
@@ -5004,7 +5070,7 @@ Cmain(fname,cmdLorg):=(
"crvsfparadata",[tmp2_1,tmp2_2,1,"Crvdata"],
tmp2_1+"[0][0]=0;",[], //17.06.09(3lines)
"appendd3",[0,1,"length3(Crvdata)","Crvdata",tmp2_1],
- "output3h",[var, varh, file,tmp2_1]
+ "output3h",["w",var, varh, file,tmp2_1]
]);
cmd=concat(cmd,tmp3);
if(#<length(nL),
@@ -5028,7 +5094,7 @@ Cmain(fname,cmdLorg):=(
" crv3onsfparadata",[tmp2_1,tmp2_2,1,"Crvdata"],
tmp2_1+"[0][0]=0;",[],
"appendd3",[0,1,"length3(Crvdata)","Crvdata",tmp2_1],
- "output3h",[var,varh, file ,tmp2_1]
+ "output3h",["w",var,varh, file ,tmp2_1]
]);
cmd=concat(cmd,tmp3);
if(#<length(nL),
@@ -5058,7 +5124,7 @@ Cmain(fname,cmdLorg):=(
"crv3onsfparadata",["out",tmp2_2,"Crvdata"],
tmp2_1+"[0][0]=0;",[],
"appendd3",[0,1,"length3(Crvdata)","Crvdata",tmp2_1],
- "output3h",[var, varh, file, tmp2_1]
+ "output3h",["w",var, varh, file, tmp2_1]
]);
cmd=concat(cmd,tmp3);
if(#<length(nL),
@@ -5114,7 +5180,7 @@ Cmain(fname,cmdLorg):=(
"wireparadata",["Surf", "udv","vdv", num, "Wiredata"],
tmp2_1+"[0][0]=0;",[],
"appendd3",[0,1,"length3(Wiredata)","Wiredata",tmp2_1],
- "output3h",[var, varh, file, tmp2_1]
+ "output3h",["w",var, varh, file, tmp2_1]
]);
cmd=concat(cmd,tmp3);
if(#<length(nL),
@@ -5169,7 +5235,7 @@ Cmain(fname,cmdLorg):=(
if(length(tmp2)<=3,tmp=1,tmp=tmp2_4);
tmp3=concat(tmp3,[
"skeletondata3",["data", tmp, "Eps1","Eps2","sk"],//17.06.13
- "output3",[var, file, 2, "sk"]
+ "output3",["w",var, file, 2, "sk"]
]);
cmd=concat(cmd,tmp3);
if(nn<length(nL),
@@ -5304,7 +5370,7 @@ Cmain(fname,cmdLorg):=(
kcC():=kcC(FheadC);
kcC(cname):=(
regional(tmp, tmp1,flg,rfile);
- rfile="resultC"+cname+".txt";
+ rfile=cname+"end.txt"; //180517
if(iswindows(),
SCEOUTPUT = openfile("kc.bat");
println(SCEOUTPUT,"set path="+Dirwork);
@@ -5315,6 +5381,7 @@ kcC(cname):=(
tmp=PathC+" %path%\"+cname+".c";
tmp=tmp+" -o %path%\main.exe";
println(SCEOUTPUT,tmp);
+ println(SCEOUTPUT,"cd "+Dq+Dirwork+Dq);
println(SCEOUTPUT,"%path%\main.exe");
println(SCEOUTPUT,"echo //// > %path%\"+rfile);
println(SCEOUTPUT,"exit");
@@ -5325,7 +5392,7 @@ kcC(cname):=(
SCEOUTPUT = openfile("kc.sh");
println(SCEOUTPUT,"#!/bin/sh");
println(SCEOUTPUT,"cd "+Dq+Dirwork+Dq);
- tmp=PathC+" "+cname+".c -o main.out";
+ tmp=PathC+" -lm "+cname+".c -o main.out"; //180612
println(SCEOUTPUT,tmp);
println(SCEOUTPUT,"./main.out");
println(SCEOUTPUT,"echo //// >"+rfile);
@@ -5354,8 +5421,8 @@ kcC(cname):=(
);
);
-ReadCdataold(var, fname):=ReadCdata(var, fname,[]);
-ReadCdata(var, fname,options):=(
+ReaddataCold(var, fname):=ReaddataC(var, fname,[]);
+ReaddataC(var, fname,options):=(
regional(file,dt,name,str,tmp,tmp1,opstr,gout, out3,out2);
if(indexof(fname,".")==0,
file=fname+".txt";
@@ -5366,7 +5433,7 @@ ReadCdata(var, fname,options):=(
name=substring(fname,0,tmp-1);
);
tmp=Divoptions(options);
- opstr=tmp_8;
+ opstr=tmp_(length(tmp)-1);
gout=ReadOutData(file);
GLIST=Append(GLIST,"Tmpstr=ReadOutData("+Dq+file+Dq+")");
if(substring(var,length(var)-1,length(var))!="h",
@@ -5380,7 +5447,7 @@ ReadCdata(var, fname,options):=(
);//17.06.16until
);
-ReadCdata(fnameorg):=(
+ReaddataC(fnameorg):=(
regional(tmp,tmp1,fname,data,out);
fname=fnameorg;
if(indexof(fname,".")==0, fname=fname+".txt");
@@ -5403,8 +5470,8 @@ ReadCdata(fnameorg):=(
out;
);
-WriteCdata(fnameorg,dataorg):=(
-//help:WriteCdata(filename, 3ddata);
+WritedataC(fnameorg,dataorg):=(
+//help:WritedataC(filename, 3ddata);
regional(tmp,fname,data,kk,nn,pt);
data=dataorg;
if(isstring(data),data=parse(data));
@@ -5416,9 +5483,13 @@ WriteCdata(fnameorg,dataorg):=(
forall(1..(length(data_kk)),nn,
pt=apply(1..3,Sprintf(data_kk_nn_#,5));
tmp=pt_1+" "+pt_2+" "+pt_3+" -99999";
- println(SCEOUTPUT,tmp);
+ print(SCEOUTPUT,tmp);
+ if(nn<length(data_kk), //180426from
+ println(SCEOUTPUT,"");
+ );//180426to
);
if(kk<length(data),
+ println(SCEOUTPUT,"");//180426
println(SCEOUTPUT,"99999.00000 2.00000 0.00000 -99999");
);
);
@@ -5442,7 +5513,7 @@ DisplayC(dispc):=(
cflg=0;
tmp=Divoptions(options);//17.06.18from
eqL=tmp_5;
- opcindy=tmp_9;
+ opcindy=tmp_(length(tmp));
forall(eqL,
if(Toupper(substring(#,0,2))=="CO",
tmp=indexof(#,"=");
@@ -5465,7 +5536,7 @@ DisplayC(dispc):=(
Texcom("{");
Setcolor(color);
);
- ReadCdata(var,file,options);// 17.05.24
+ ReaddataC(var,file,options);// 17.05.24
if(cflg==1,
Texcom("}");
);
@@ -5504,7 +5575,8 @@ Cheadsurf():=(
tmp=tmp+", Eps1="+tmp1_2;
tmp=tmp+", Eps2="+tmp1_3+";";
cmd=append(cmd,tmp);
- tmp="const char dirname[]="+Dq+Dirwork+"/"+Dq+";";
+ tmp=replace(Dirwork,"\","/"); //180523(2lines)
+ tmp="const char Dirname[]="+Dq+tmp+"/"+Dq+";";
cmd=append(cmd,tmp);
cmd=append(cmd,"double Urng[2],Vrng[2];");
cmd=append(cmd, "int DrawE,DrawW,DrawS,DrawN;");
@@ -5519,6 +5591,7 @@ Cheadsurf():=(
if(#==4,tmp="Urng",tmp="Vrng");
tmp2=tmp2+tmp+"[0]="+tmp1_1+";"+tmp+"[1]="+tmp1_2+";";
);
+ tmp2=tmp2+"break;"; //180523
cmd=append(cmd,tmp2);
);
cmd=append(cmd," }");
@@ -5536,6 +5609,7 @@ Cheadsurf():=(
if(indexof(tmp,"s")>0,tmp2=tmp2+"1;",tmp2=tmp2+"0;");
tmp2=tmp2+"DrawN=";
if(indexof(tmp,"n")>0,tmp2=tmp2+"1;",tmp2=tmp2+"0;");
+ tmp2=tmp2+"break;"; //180523
cmd=append(cmd,tmp2);
);
cmd=append(cmd," }");
@@ -5550,6 +5624,7 @@ Cheadsurf():=(
tmp1=substring(tmp1,tmp,length(tmp1));
tmp2=tmp2+"p["+text(#-1)+"]="+tmp1+";";
);
+ tmp2=tmp2+"break;"; //180523
cmd=append(cmd,tmp2);
);
cmd=append(cmd," }");
@@ -5557,36 +5632,47 @@ Cheadsurf():=(
cmd;
);
-Ctopsurf(name):=Ctopsurf(name,[]);
-Ctopsurf(name,cmdadd):=(
- regional(path,cmd);
+Ctopsurf(name):=Ctopsurf(name,CutFunList);
+Ctopsurf(name,cutfunLorg):=(
+ regional(cutfunL,path,cmd,tmp,tmp1,tmp2);
+ cutfunL=cutfunLorg; //180601from
+ if(length(cutfunL)==0,
+ cutfunL=["1"];
+ );//180601to
path=DirlibC+"/";
path=replace(path,"\","/");
cmd=[
- "#include <stdio.h>", "#include <math.h>",
+ "#include <stdio.h>","#include <math.h>",
+ "#include <stdlib.h>","#include <string.h>", //180530
"#include "+Dqq(Fhead+name+"header.h"),
"#include "+Dqq(path+"ketcommonhead.h"),
"#include "+Dqq(path+"ketcommon.h"),
"#include "+Dq+path+"surflibhead.h"+Dq,
"#include "+Dq+path+"surflib.h"+Dq,
- "double cutfun1(short ch,double u, double v){",
+ "double cutfun(short chfd, short chcut, double u, double v){",
" double p[3],val;",
- " surffun(ch,u,v,p);",
- " val=1;",
- " return val;",
- "}",
- "double cutfun(short ch, int chcut, double u, double v){",
- " double p[3],val;",
- " switch(chcut){",
- " case 1: val=cutfun1(ch,u,v);",
+ " surffun(chfd,u,v,p);",
+ " switch(chcut){"
+ ];
+ tmp1=[];
+ forall(1..(length(cutfunL)),
+ tmp2=replace(cutfunL_#,"x","p[0]");
+ tmp2=replace(tmp2,"y","p[1]");
+ tmp2=replace(tmp2,"z","p[2]");
+ tmp2=" case "+text(#)+": val="+tmp2+";";
+ tmp2=tmp2+"break;"; //180523
+ tmp1=append(tmp1,tmp2);
+ );
+ cmd=concat(cmd,tmp1);
+ cmd=concat(cmd,[
" }",
" return val;",
"}",
"int main(void){",
- " double out[DsizeL][3], data[DsizeLL][3];",
- " int i, j, nall, din[DsizeS][2];",
+ " double data[DsizeL][3],sfbd[DsizeL][3],out[DsizeL][3];", //180601
+ " int i, j, nall;",
" char dirfname[256] = {'\0'};"
- ];
+ ]);
cmd;
);
@@ -5630,15 +5716,23 @@ CalcbyC(name,path,cmd,optionorg):=(
body=cmd_3;
options=optionorg;
tmp=divoptions(options);
-// eqL=tmp_5;
+ eqL=tmp_5;
strL=tmp_7;
- waiting=30;
- wfile="resultC"+Fhead+name+".txt";
+ waiting=40;
+ wfile=Fhead+name+"end.txt"; //180517
hfile=Fhead+name+"header.h";
println(Dirwork);
println(hfile);
mfile=Fhead+name+".c";
wflg=0;
+ forall(eqL,
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(substring(tmp_1,0,1));
+ if(tmp1=="W",
+ waiting=parse(tmp_2);
+ options=remove(options,[#]);
+ );
+ );
forall(strL,
tmp=Toupper(substring(#,0,1));
if(tmp=="M",
@@ -5693,13 +5787,9 @@ CalcbyC(name,path,cmd,optionorg):=(
repeat(tmp1,
if(flg==0,
tmp=load(wfile);
- if(length(tmp)>=4,
- tmp2=substring(tmp,length(tmp)-4,length(tmp));
- if(tmp2=="////",
- tmp=substring(tmp,0,length(tmp)-4);
- flg=1;
- tmp2=#*WaitUnit/1000;
- );
+ if(indexof(tmp,"////")>0, //180523from
+ flg=1;
+ tmp2=#*WaitUnit/1000;//180523to
,
if(wflg==-1,
flg=-1;
@@ -5722,19 +5812,122 @@ CalcbyC(name,path,cmd,optionorg):=(
);
);
+ExeccmdC(nm):=ExeccmdC(nm,[],["do"]); //180531
+ExeccmdC(nm,options):=ExeccmdC(nm,options,["do"]);
+ExeccmdC(nm,optionorg,optionhorg):=(
+//help:ExeccmdC("1",["m/r","Wait=30"],["do"]);
+ regional(options,optionsh,name2,name3,waiting,dirbkup,
+ eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,varL);
+ fname=Fhead+nm+".txt";
+ options=optionorg;
+ optionsh=optionhorg;
+ optionsh=select(optionsh,length(#)>0);
+ if(length(optionsh)==0,optionsh=["do"]);
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ reL=tmp_6;
+ strL=tmp_7;
+ waiting=30;
+ wflg=0;
+ cmdflg=0;
+ forall(strL,
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="M",
+ wflg=1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="R",
+ wflg=-1;
+ options=remove(options,[#]);
+ );
+ );
+ forall(eqL,
+ tmp=Strsplit(#,"=");
+ if(Toupper(tmp_1)=="WAIT",
+ waiting=parse(tmp_2);
+ options=remove(options,[#]);
+ );
+ );
+ options=remove(options,reL);
+ options=select(options,length(#)>0);
+ if(CommonMake==1,//180609from
+ tmp1=append(options,"m");
+ wflg=0;
+ );
+ if(CommonMake==-1,
+ tmp1=append(options,"r");
+ wflg=0;
+ );//180609to
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ tmp1=append(tmp1,"Wait="+text(waiting));
+ CommandListC=prepend(" char fnameall[]="+Dqq(fname)+";",CommandListC);
+ CommandListC=prepend(" printf("+Dqq("%s\n")+","+Dqq(Fhead)+");",CommandListC); //180608
+ tmp=select(CommandListC,indexof(#,"outputend")>0);
+ if(length(tmp)==0,
+ CommandListC=append(CommandListC," outputend(dirfname);");
+ );
+ if(length(CommandListC)<=2,ErrFlag=1);
+ if(ErrFlag==0,
+ CalcbyC(nm,[Cheadsurf(),Ctopsurf(nm),CommandListC],tmp1);
+ );
+ if(ErrFlag==1,
+ err("CommandListC is empty or execcmd is not completed");
+ ,
+ varL=ReadOutData(fname);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
+ tmp1=select(varL,indexof(#,"h3d")==0);
+ tmp2=remove(varL,tmp1);
+ tmp1=select(tmp1,indexof(#,"3d")>0);
+ tmp="";
+ if(length(options)>0,
+ forall(options,
+ tmp=tmp+Dqq(#)+",";
+ );
+ tmp=substring(tmp,0,length(tmp)-1);
+ );
+ if(length(tmp)>0,tmp=tmp+","); //180602
+ tmp=tmp+Dqq("Msg=no"); //180602
+ tmp1=apply(tmp1,replace(#,"3d","2d")+"=Projpara("+Dqq(#)+",["+tmp+"]);");
+ forall(tmp1,parse(#));
+ tmp="";
+ if(length(optionsh)>0,
+ forall(optionsh,
+ tmp=tmp+Dqq(#)+",";
+ );
+ tmp=substring(tmp,0,length(tmp)-1);
+ );
+ tmp2=apply(tmp2,replace(#,"3d","2d")+"=Projpara("+Dqq(#)+",["+tmp+"]);");
+ forall(tmp2,parse(#));
+ Changestyle3d(EraseList,["nodisp"]);//180601
+ );
+ varL=select(varL,length(parse(#))>0);
+ if(length(addpath)>0,Changework(dirbkup,["Sub=n"])); //180605
+ varL;
+);
+
SfbdparadataC(nm,fd):=
SfbdparadataC(nm,fd,[],["nodisp"]);
SfbdparadataC(nm,fd,options):=
SfbdparadataC(nm,fd,options,["nodisp"]);
SfbdparadataC(nm,fdorg,optionorg,optionsh):=(
//help:SfbdparadataC("1",Fd);
-//help:SfbdparadataC(options2=["r/m"]);
+//help:SfbdparadataC(options2=["c(default)/r/m"]);
regional(funnm,fd,options,name2,name3,name2h,name3h,waiting,
- eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg);
+ eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,cmdflg);
if(ChNumber==0,ChNumber=Ch);
fd=ConvertFdtoC(fdorg);
- FuncListC=append(FuncListC,fd);
- funnm=text(length(FuncListC));
+ tmp1=0; //180606from
+ forall(1..(length(FuncListC)),
+ if(FuncListC_#==fd,
+ funnm=#;
+ tmp1=1;
+ );
+ );
+ if(tmp1==0,
+ FuncListC=append(FuncListC,fd);
+ funnm=text(length(FuncListC));
+ ); //180606to
name2="sfbd2d"+nm;
name3="sfbd3d"+nm;
name2h="sfbdh2d"+nm;
@@ -5745,80 +5938,100 @@ SfbdparadataC(nm,fdorg,optionorg,optionsh):=(
eqL=tmp_5;
reL=tmp_6;
strL=tmp_7;
- waiting=120;
+ waiting=60;
wflg=0;
+ cmdflg=1;
forall(strL,
tmp=Toupper(substring(#,0,1));
if(tmp=="M",
+ cmdflg=0;
wflg=1;
options=remove(options,[#]);
);
if(tmp=="R",
+ cmdflg=0;
wflg=-1;
options=remove(options,[#]);
);
+ if(tmp=="C", //180531
+ cmdflg=1;
+ options=remove(options,[#]);
+ );
);
options=remove(options,eqL);
options=remove(options,reL);
options=select(options,length(#)>0);
cmdL=[
- " double sfbd"+funnm+"[DsizeL][3];",
- " char fname"+funnm+"[]="+Dqq(fname)+";",
+ " char fname"+nm+"[]="+Dqq(fname)+";",
" rangeUV("+funnm+");",
" boundary("+funnm+");",
- " sfbdparadata("+funnm+",sfbd"+funnm+");",
- " sprintf(dirfname,"+Dqq("%s%s")+",dirname,fname"+funnm+");",
- " output3h("+Dqq("sfbd3d"+nm)+","+Dqq("sfbdh3d"+nm)+",dirfname,sfbd"+funnm+");";
+ " sfbdparadata("+funnm+",sfbd);",
+ " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");",
+ " output3h("+Dqq("w")+","+Dqq("sfbd3d"+nm)+","+Dqq("sfbdh3d"+nm)+",dirfname,sfbd);",
+ " outputend(dirfname);"
];
- if(wflg==1,tmp1=append(options,"m"));
- if(wflg==-1,tmp1=append(options,"r"));
- if(ErrFlag==0,
- tmp="sfbd"+nm;
- CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
- );
- if(ErrFlag==1,
- err("Sfbdparadata not completed");
+ if(cmdflg==1, //180531from
+ println(" ExeccmdC will generate "+ name3+","+name3h);
+ tmp=replace(cmdL_5,"fname"+funnm,"fnameall");cmdL_5=tmp;
+ tmp=select(CommandListC,indexof(#,"output3")>0); //180601from
+ if(length(tmp)>0,
+ tmp=replace(cmdL_6,Dqq("w"),Dqq("a"));cmdL_6=tmp;
+ ); //180601from
+ cmdL=remove(cmdL,[cmdL_1,cmdL_(length(cmdL))]);
+ CommandListC=concat(CommandListC,cmdL); //180531to
,
- ReadOutData(fname);
- GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
- if(islist(parse(name3)),
- tmp1=name2+"=Projpara("+Dqq(name3)+",[";
- tmp2="";
- if(length(options)>0,
- forall(options,
- tmp2=tmp2+Dqq(#)+",";
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ if(ErrFlag==0,
+ tmp="sfbd"+nm;
+ CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
+ );
+ if(ErrFlag==1,
+ err("Sfbdparadata not completed");
+ ,
+ ReadOutData(fname);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
+ if(islist(parse(name3)),
+ tmp1=name2+"=Projpara("+Dqq(name3)+",[";
+ tmp2="";
+ if(length(options)>0,
+ forall(options,
+ tmp2=tmp2+Dqq(#)+",";
+ );
+ tmp2=substring(tmp2,0,length(tmp2)-1);
);
- tmp2=substring(tmp2,0,length(tmp2)-1);
- );
- tmp1=tmp1+tmp2+"]);";
- parse(tmp1);
- if(length(optionsh)==0,tmp2=["nodisp"],tmp2=optionsh);
- tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
- forall(tmp2,
- tmp1=tmp1+Dqq(#)+",";
+ tmp1=tmp1+tmp2+"]);";
+ parse(tmp1);
+ tmp2=select(optionsh,length(#)>0); //180517(2lines)
+ if(length(tmp2)==0,tmp2=["nodisp"]);
+ tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
+ forall(tmp2,
+ tmp1=tmp1+Dqq(#)+",";
+ );
+ tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
+ parse(tmp1);
+ ,
+ ErrFlag=1;
);
- tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
- parse(tmp1);
- ,
- ErrFlag=1;
);
);
);
-CrvsfparadataC(nm,fk,fbdy,fd):=
- CrvsfparadataC(nm,fk,fbdy,fd,[],["nodisp"]);
-CrvsfparadataC(nm,fk,fbdy,fd,options):=
- SfbdparadataC(nm,fk,fbdy,fd,options,["nodisp"]);
-CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=(
+CrvsfparadataC(nm,fk,sfbd,fd):=
+ CrvsfparadataC(nm,fk,sfbd,fd,[],["nodisp"]);
+CrvsfparadataC(nm,fk,sfbd,fd,options):=
+ SfbdparadataC(nm,fk,sfbd,fd,options,["nodisp"]);
+CrvsfparadataC(nm,Fk,sfbdorg,fdorg,optionorg,optionsh):=(
//help:CrvsfparadataC("1","ax3d","sfbd3d1",Fd);
-//help:CrvsfparadataC(options2=["r/m"]);
+//help:CrvsfparadataC(options2=["c(default)/r/m"]);
//help:CrvsfparadataC(optionsh=["nodisp"]);
- regional(funnm,fd,options,name2,name3,name2h,name3h,waiting,
- eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps);
+ regional(funnm,sfbd,fd,options,name2,name3,name2h,name3h,waiting,
+ eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdlfg);
eps=10^(-5);
+ sfbd=replace(sfbdorg,"bdy","sfbd");
fd=ConvertFdtoC(fdorg);
tmp=select(1..(length(FuncListC)),FuncListC_#==fd);
- funcnum=tmp_1;
+ funnm=text(tmp_1); //180426
name2="crvsf2d"+nm;
name3="crvsf3d"+nm;
name2h="crvsfh2d"+nm;
@@ -5829,30 +6042,35 @@ CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=(
eqL=tmp_5;
reL=tmp_6;
strL=tmp_7;
- waiting=120;
+ waiting=60;
wflg=0;
+ cmdflg=1;
forall(strL,
tmp=Toupper(substring(#,0,1));
if(tmp=="M",
+ cmdflg=0;
wflg=1;
options=remove(options,[#]);
);
if(tmp=="R",
+ cmdflg=0;
wflg=-1;
options=remove(options,[#]);
);
+ if(tmp=="C", //180531
+ cmdflg=1;
+ options=remove(options,[#]);
+ );
);
options=remove(options,eqL);
options=remove(options,reL);
options=select(options,length(#)>0);
-// tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2];
-// tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]);
- tmp2=parse(Fbdy);
+ tmp2=parse(Fk);
flg=0;
- tmp=Fhead+Fbdy+".dat";
+ tmp=Fhead+Fk+".dat";
if(!isexists(Dirwork,tmp),flg=1);
if(flg==0,
- tmp1=ReadCdata(tmp);
+ tmp1=ReaddataC(tmp);
if(length(tmp1)!=length(tmp2),flg=1);
if(flg==0,
forall(1..(length(tmp1)),ii,
@@ -5865,13 +6083,131 @@ CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=(
);
);
);
- if(flg==1,WriteCdata(tmp,Fbdy));
- tmp2=parse(Fk);
+ if(flg==1,WritedataC(tmp,Fk));
+ if(cmdflg==1,
+ EraseList=append(EraseList,Fk);
+ ,
+ Changestyle3d(Fk,["nodisp"]);
+ );
+ cmdL=[
+ " char fname"+nm+"[]="+Dqq(fname)+";",
+ " rangeUV("+funnm+");",
+ " boundary("+funnm+");",
+ " readdataC("+Dqq(Fhead+Fk+".dat")+",data);",
+ " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531
+ " crvsfparadata("+funnm+",data,sfbd, 0, out);",
+ " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");",
+ " output3h("+Dqq("w")+","+Dqq("crvsf3d"+nm)+","+Dqq("crvsfh3d"+nm)+",dirfname,out);",
+ " outputend(dirfname);"
+ ];
+ if(cmdflg==1,//180531from
+ println(" ExeccmdC will generate "+ name3+","+name3h);
+ cmdL_5=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);";
+ cmdL_7=" sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fnameall);"; //180607
+ tmp=replace(cmdL_(length(cmdL)-1),Dqq("w"),Dqq("a")); cmdL_(length(cmdL)-1)=tmp;
+ cmdL=remove(cmdL,[cmdL_(length(cmdL))]);
+ CommandListC=concat(CommandListC,cmdL); //180531to
+ ,
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ if(ErrFlag==0,
+ tmp="crvsf"+nm;
+ CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
+ );
+ if(ErrFlag==1,
+ err("Crvsfparadata not completed");
+ ,
+ ReadOutData(fname);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
+ if(islist(parse(name3)),
+ tmp1=name2+"=Projpara("+Dqq(name3)+",[";
+ tmp2="";
+ if(length(options)>0,
+ forall(options,
+ tmp2=tmp2+Dqq(#)+",";
+ );
+ tmp2=substring(tmp2,0,length(tmp2)-1);
+ );
+ tmp1=tmp1+tmp2+"]);";
+ parse(tmp1);
+ tmp2=select(optionsh,length(#)>0); //180517(2lines)
+ if(length(tmp2)==0,tmp2=["nodisp"]);
+ tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
+ forall(tmp2,
+ tmp1=tmp1+Dqq(#)+",";
+ );
+ tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
+ parse(tmp1);
+ ,
+ ErrFlag=1;
+ );
+ );
+ );
+);
+
+Crv3onsfparadataC(nm,crv3d,sfbd,fd):=
+ Crv3onsfparadataC(nm,crv3d,sfbd,fd,[],["nodisp"]);
+Crv3onsfparadataC(nm,crv3d,sfbd,fd,options):=
+ Crv3onsfparadataC(nm,crv3d,sfbd,fd,options,["nodisp"]);
+Crv3onsfparadataC(nm,crv3d,sfbdorg,fdorg,optionorg,optionsh):=(
+//help:Crv3onsfparadataC("1","sc3","sfbd3d1",fd);
+ regional(funnm,sfbd,fd,options,name3,name3h,name2,name2h,waiting,
+ eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdflg);
+ tmp1=replace(crv3d,"3d","2d");
+ tmp=apply(GCLIST,#_1);
+ if(contains(tmp,tmp1),
+ if(cmdflg==1,
+ EraseList=append(EraseList,tmp1);
+ ,
+ Changestyle3d(tmp1,["nodisp"]);//180428
+ );
+ );
+ eps=10^(-5);
+ sfbd=replace(sfbdorg,"bdy","sfbd");
+ fd=ConvertFdtoC(fdorg);
+ tmp=select(1..(length(FuncListC)),FuncListC_#==fd);
+ funnm=text(tmp_1); //180426
+ name3="crv3onsf3d"+nm;
+ name3h="crv3onsfh3d"+nm;
+ name2=replace(name3,"3d","2d");
+ name2h=replace(name3h,"3d","2d");
+ fname=Fhead+"crv3onsf"+nm+".txt";
+ tmp=apply(fdorg,if(isstring(#),Dqq(#),#));
+ tmp=text(tmp);
+ options=optionorg;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ reL=tmp_6;
+ strL=tmp_7;
+ waiting=60;
+ wflg=0;
+ cmdflg=1;
+ forall(strL,
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="M",
+ cmdflg=0;
+ wflg=1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="R",
+ cmdflg=0;
+ wflg=-1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="C", //180531
+ cmdflg=1;
+ options=remove(options,[#]);
+ );
+ );
+ options=remove(options,eqL);
+ options=remove(options,reL);
+ options=select(options,length(#)>0);
+ tmp2=parse(crv3d);
flg=0;
- tmp=Fhead+Fk+".dat";
+ tmp=Fhead+crv3d+".dat";
if(!isexists(Dirwork,tmp),flg=1);
if(flg==0,
- tmp1=ReadCdata(tmp);
+ tmp1=ReaddataC(tmp);
if(length(tmp1)!=length(tmp2),flg=1);
if(flg==0,
forall(1..(length(tmp1)),ii,
@@ -5883,50 +6219,432 @@ CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=(
);
);
);
- );
- if(flg==1,WriteCdata(tmp,Fk));
+ );
+ if(flg==1,WritedataC(tmp,crv3d));
cmdL=[
- " double fbdy[DsizeL][3],fk[DsizeL][3];",
- " char fname"+nm+"[]="+Dqq(fname)+";",
+ " char fname"+nm+"[]="+Dqq(fname)+";",
" rangeUV("+funnm+");",
" boundary("+funnm+");",
- " readdata3("+Dqq(Fhead+Fbdy+".dat")+",fbdy);",
- " readdata3("+Dqq(Fhead+Fk+".dat")+",fk);",
- " crvsfparadata(fk,fbdy, 0, out);",
- " sprintf(dirfname,"+Dqq("%s%s")+",dirname,fname"+nm+");",
- " output3h("+Dqq("crvsf3d"+nm)+","+Dqq("crvsfh3d"+nm)+",dirfname,out);"
+ " readdataC("+Dqq(Fhead+crv3d+".dat")+",data);",
+ " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531
+ " crv3onsfparadata("+funnm+",data,sfbd,out);",
+ " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");",
+ " output3h("+Dqq("w")+","+Dqq("crv3onsf3d"+nm)+","+Dqq("crv3onsfh3d"+nm)+",dirfname,out);",
+ " outputend(dirfname);"
];
- if(wflg==1,tmp1=append(options,"m"));
- if(wflg==-1,tmp1=append(options,"r"));
- if(ErrFlag==0,
- tmp="crvsf"+nm;
- CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
+ if(cmdflg==1,//180531from
+ println(" ExeccmdC will generate "+ name3+","+name3h);
+ cmdL_7=" sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fnameall);"; //180607
+ tmp=replace(cmdL_(length(cmdL)-1),Dqq("w"),Dqq("a")); cmdL_(length(cmdL)-1)=tmp;
+ cmdL_5=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);";
+ cmdL=remove(cmdL,[cmdL_1,cmdL_(length(cmdL))]);
+ CommandListC=concat(CommandListC,cmdL); //180531to
+ ,
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ if(ErrFlag==0,
+ tmp="crv3onsf"+nm;
+ CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
+ );
+ if(ErrFlag==1,
+ err("Crvonsfparadata not completed");
+ ,
+ ReadOutData(fname);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
+ if(islist(parse(name3)),
+ tmp1=name2+"=Projpara("+Dqq(name3)+",[";
+ tmp2="";
+ if(length(options)>0,
+ forall(options,
+ tmp2=tmp2+Dqq(#)+",";
+ );
+ tmp2=substring(tmp2,0,length(tmp2)-1);
+ );
+ tmp1=tmp1+tmp2+"]);";
+ parse(tmp1);
+ tmp2=select(optionsh,length(#)>0); //180517(2lines)
+ if(length(tmp2)==0,tmp2=["nodisp"]);
+ tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
+ forall(tmp2,
+ tmp1=tmp1+Dqq(#)+",";
+ );
+ tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
+ parse(tmp1);
+ ,
+ ErrFlag=1;
+ );
+ );
);
- if(ErrFlag==1,
- err("Crvsfparadata not completed");
+);
+
+Crv2onsfparadataC(nm,crv2d,sfbd,fd):=
+ Crv2onsfparadataC(nm,crv2d,sfbd,fd,["c"],["do"]);
+Crv2onsfparadataC(nm,crv2d,sfbd,fd,options):=
+ Crv2onsfparadataC(nm,crv2d,sfbd,fd,options,["do"]);
+Crv2onsfparadataC(nm,crv2d,sfbd,fdorg,options,optionsh):=(
+//help:Crv2onsfparadataC("1","gp1","sfbd3d1",fd);
+ regional(fd,uname,vname,str,tmpfun,ii,jj,crv3d,tmp,tmp1,tmp2);
+ Changestyle3d(crv2d,["nodisp"]);
+ crv3d=crv2d+"3d";
+ fd=Fullformfunc(fdorg);
+ tmp=Strsplit(fd_5,"=");
+ uname=tmp_1;
+ tmp=Strsplit(fd_6,"=");
+ vname=tmp_1;
+ str="["+fd_2+","+fd_3+","+fd_4+"]";
+ tmp="tmpfun("+uname+","+vname+"):="+str+";";
+ parse(tmp);
+ tmp1=parse(crv2d);
+ tmp2=[];
+ forall(tmp1,
+ tmp2=append(tmp2,tmpfun(#_1,#_2));
+ );
+ tmp=crv3d+"="+textformat(tmp2,6);
+ parse(tmp);
+ Crv3onsfparadataC(nm,crv3d,sfbd,fdorg,options,optionsh);
+);
+
+WireparadataC(nm,sfbd,fd,wr1,wr2):=
+ WireparadataC(nm,sfbd,fd,wr1,wr2,[],["nodisp"]);
+WireparadataC(nm,sfbd,fd,wr1,wr2,options):=
+ WireparadataC(nm,sfbd,fd,wr1,wr2,options,["nodisp"]);
+WireparadataC(nm,sfbd,fdorg,wr1,wr2,optionorg,optionsh):=(
+//help:WireparadataC("1","sfbd3d1",fd,5,5);
+ regional(funnm,fd,options,name2,name3,name2h,name3h,waiting,
+ eqL,reL,strL,fname,fnameh,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,udata,vdata,cmdflg);
+ eps=10^(-5);
+ fd=ConvertFdtoC(fdorg);
+ tmp=select(1..(length(FuncListC)),FuncListC_#==fd);
+ funnm=text(tmp_1);
+ name2="wire2d"+nm;
+ name3="wire3d"+nm;
+ name2h="wireh2d"+nm;
+ name3h="wireh3d"+nm;
+ fname=Fhead+"wire"+nm+".txt";
+ fnameh=replace(fname,".txt","h.txt");
+ options=optionorg;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ reL=tmp_6;
+ strL=tmp_7;
+ waiting=60;
+ wflg=0;
+ options=remove(options,reL);
+ wflg=0;
+ cmdflg=1;
+ forall(strL,
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="M",
+ cmdflg=0;
+ wflg=1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="R",
+ cmdflg=0;
+ wflg=-1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="C", //180531
+ cmdflg=1;
+ options=remove(options,[#]);
+ );
+ );
+ options=remove(options,eqL);
+ options=remove(options,reL);
+ options=select(options,length(#)>0);
+ if(islist(wr1),
+ udata=prepend(length(wr1),wr1);
,
- ReadOutData(fname);
- GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
- if(islist(parse(name3)),
- tmp1=name2+"=Projpara("+Dqq(name3)+",[";
- tmp2="";
- if(length(options)>0,
- forall(options,
- tmp2=tmp2+Dqq(#)+",";
+ tmp=Fullformfunc(fdorg);
+ tmp1=tmp_5;
+ tmp=indexof(tmp1,"=");
+ tmp=substring(tmp1,tmp,length(tmp1));
+ tmp=parse(tmp);
+ tmp1=tmp_1; tmp2=tmp_2;
+ udata=apply(1..wr1,tmp1+#*(tmp2-tmp1)/(wr1+1));
+ udata=prepend(wr1,udata);
+ );
+ udata=textformat(udata,6);
+ udata=substring(udata,1,length(udata)-1);
+ if(islist(wr2),
+ vdata=prepend(length(wr2),wr2);
+ ,
+ tmp=Fullformfunc(fdorg);
+ tmp1=tmp_6;
+ tmp=indexof(tmp1,"=");
+ tmp=substring(tmp1,tmp,length(tmp1));
+ tmp=parse(tmp);
+ tmp1=tmp_1; tmp2=tmp_2;
+ vdata=apply(1..wr2,tmp1+#*(tmp2-tmp1)/(wr2+1));
+ vdata=prepend(wr2,vdata);
+ );
+ vdata=textformat(vdata,6);
+ vdata=substring(vdata,1,length(vdata)-1);
+ cmdL=[
+ " double wireu[]={"+udata+"};",
+ " double wirev[]={"+vdata+"};",
+ " char fname[]="+Dqq(fname)+";",
+ " char fnameh[]="+Dqq(fnameh)+";",
+ " rangeUV("+funnm+");",
+ " boundary("+funnm+");",
+ " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531
+ " wireparadata("+funnm+",sfbd,wireu,wirev,fname,fnameh);"
+ ];
+ if(cmdflg==1,//180531from
+ println(" ExeccmdC will generate "+ name3+","+name3h);
+ tmp=replace(cmdL_8,"fnameh",Dqq(""));
+ tmp=replace(tmp,"fname","fnameall"); cmdL_8=tmp;
+ cmdL_7=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);";
+ cmdL=append(cmdL," outputend(dirfname);");
+ CommandListC=concat(CommandListC,cmdL); //180531to
+ ,
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ if(ErrFlag==0,
+ tmp="wire"+nm;
+ CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
+ );
+ if(ErrFlag==1,
+ err("Wireparadata not completed");
+ ,
+ ReadOutData(fname);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
+ ReadOutData(fnameh);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fnameh)+")");
+ if(islist(parse(name3)),
+ tmp1=name2+"=Projpara("+Dqq(name3)+",[";
+ tmp2="";
+ if(length(options)>0,
+ forall(options,
+ tmp2=tmp2+Dqq(#)+",";
+ );
+ tmp2=substring(tmp2,0,length(tmp2)-1);
+ );
+ tmp1=tmp1+tmp2+"]);";
+ parse(tmp1);
+ tmp2=select(optionsh,length(#)>0); //180517(2lines)
+ if(length(tmp2)==0,tmp2=["nodisp"]);
+ tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
+ forall(tmp2,
+ tmp1=tmp1+Dqq(#)+",";
);
- tmp2=substring(tmp2,0,length(tmp2)-1);
+ tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
+ parse(tmp1);
+ ,
+ ErrFlag=1;
);
- tmp1=tmp1+tmp2+"]);";
- parse(tmp1);
- if(length(optionsh)==0,tmp2=["nodisp"],tmp2=optionsh);
- tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
- forall(tmp2,
- tmp1=tmp1+Dqq(#)+",";
+ );
+ );
+);
+
+IntersectcrvsfC(nm,crv,fd):=IntersectcrvsfC(nm,crv,fd,"",[]);
+IntersectcrvsfC(nm,crv,fd,Arg):=(
+ if(isstring(Arg),
+ IntersectcrvsfC(nm,crv,fd,Arg,[]);
+ ,
+ IntersectcrvsfC(nm,crv,fd,"",Arg);
+ );
+);
+IntersectcrvsfC(nm,crv3d,fdorg,bdyeq,optionorg):=(
+//help:IntersectcrvsfC("1",curve,fd);
+ regional(fd,funnm,name,crv,fd,options,reL,fname,crvfname,argR,
+ waiting,tmp,tmp1,tmp2,flg,wflg,pts,cmdflg);
+ fd=ConvertFdtoC(fdorg);
+ tmp=select(1..(length(FuncListC)),FuncListC_#==fd);
+ funnm=text(tmp_1); //180426
+ name="intercrvsf"+nm;
+ fname=Fhead+name+".txt";
+ crvfname=Fhead+"crv"+nm+".txt";
+ fd=apply(fdorg,if(isstring(#),Dqq(#),#));
+ options=optionorg;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ reL=tmp_6;
+ strL=tmp_7;
+ waiting=60;
+ wflg=0;
+ cmdflg=1;
+ forall(strL,
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="M",
+ cmdflg=0;
+ wflg=1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="R",
+ cmdflg=0;
+ wflg=-1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="C", //180531
+ cmdflg=1;
+ options=remove(options,[#]);
+ );
+ );
+ options=remove(options,eqL);
+ options=remove(options,reL);
+ options=select(options,length(#)>0);
+ tmp2=parse(crv3d);
+ flg=0;
+ tmp=Fhead+crv3d+".dat";
+ if(!isexists(Dirwork,tmp),flg=1);
+ if(flg==0,
+ tmp1=ReaddataC(tmp);
+ if(length(tmp1)!=length(tmp2),flg=1);
+ if(flg==0,
+ forall(1..(length(tmp1)),ii,
+ if(length(tmp1_ii)!=length(tmp2_ii),flg=1);
+ forall(1..(length(tmp1_ii)),jj,
+ if(flg==0,
+ if(Norm(tmp1_ii_jj-tmp2_ii_jj)>eps,flg=1);
+ );
+ );
);
- tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
- parse(tmp1);
+ );
+ );
+ if(flg==1,WritedataC(tmp,crv3d));
+ cmdL=[
+ " double crv3d[DsizeL][3];",
+ " char fname"+nm+"[]="+Dqq(fname)+";",
+ " rangeUV("+funnm+");",
+ " boundary("+funnm+");",
+ " readdataC("+Dqq(Fhead+crv3d+".dat")+",crv3d);",
+ " intersectcrvsf("+Dqq("w")+","+funnm+",crv3d,"+Dqq(fname)+");",
+ " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");"
+ ];
+ if(cmdflg==1,//180531from
+ cmdL_6=" intersectcrvsf("+Dqq("a")+","+funnm+",crv3d,fnameall);";
+ cmdL=remove(cmdL,[cmdL_2]);
+ cmdL=remove(cmdL,[cmdL_(length(cmdL))]);
+ CommandListC=concat(CommandListC,cmdL); //180531to
+ ,
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ if(ErrFlag==0,
+ tmp="crv3onsf"+nm;
+ CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1);
+ );
+ if(ErrFlag==1,
+ err("Intersectcrvsf not completed");
,
- ErrFlag=1;
+ ReadOutData(fname);
+ );
+ println("generate "+name);
+ parse(name);
+ );
+);
+
+SfcutparadataC(nm,cutfunL,sfbd,fd):=(//180505
+ SfcutparadataC(nm,cutfunL,sfbd,fd,[],["nodisp"]);
+);
+SfcutparadataC(nm,cutfunL,sfbd,fd,options):=
+ SfcutparadataC(nm,cutfunL,sfbd,fd,options,["nodisp"]);
+SfcutparadataC(nm,cutfunLorg,sfbd,fdorg,optionorg,optionsh):=(
+//help:SfcutparadataC("1","2*x+3*y+z=1","sfbd3d",fd);
+ regional(funnm,cutfunL,fd,options,name2,name3,name2h,name3h,waiting,
+ eqL,reL,strL,fname,fnameh,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdflg);
+ eps=10^(-5);
+ fd=ConvertFdtoC(fdorg);
+ tmp=select(1..(length(FuncListC)),FuncListC_#==fd);
+ funnm=text(tmp_1);
+ cutfunL=cutfunLorg;
+ if(!islist(cutfunL),cutfunL=[cutfunL]);
+ forall(1..(length(cutfunL)),
+ tmp1=Strsplit(cutfunL_#,"=");
+ if(length(tmp1)>1,
+ tmp2=tmp1_1+"-("+tmp1_2+")"; //180516
+ cutfunL_#=Cform(tmp2);
+ );
+ );
+ CutFunList=cutfunL; //180601
+ name2="sfcut2d"+nm;
+ name3="sfcut3d"+nm;
+ name2h="sfcuth2d"+nm;
+ name3h="sfcuth3d"+nm;
+ fname=Fhead+"sfcut"+nm+".txt";
+ fnameh=replace(fname,".txt","h.txt");
+ options=optionorg;
+ tmp=Divoptions(options);
+ eqL=tmp_5;
+ reL=tmp_6;
+ strL=tmp_7;
+ waiting=60;
+ wflg=0;
+ options=remove(options,reL);
+ wflg=0;
+ cmdflg=1;
+ forall(strL,
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="M",
+ cmdflg=0;
+ wflg=1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="R",
+ cmdflg=0;
+ wflg=-1;
+ options=remove(options,[#]);
+ );
+ if(tmp=="C", //180531
+ cmdflg=1;
+ options=remove(options,[#]);
+ );
+ );
+ options=remove(options,eqL);
+ options=remove(options,reL);
+ options=select(options,length(#)>0);
+ tmp1=text(length(cutfunL));
+ cmdL=[
+ " char fname[]="+Dqq(fname)+";",
+ " char fnameh[]="+Dqq(fnameh)+";",
+ " rangeUV("+funnm+");",
+ " boundary("+funnm+");",
+ " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531
+ " sfcutparadata("+funnm+","+tmp1+",sfbd,fname,fnameh);"
+ ];
+ if(cmdflg==1,//180531from
+ println(" ExeccmdC will generate "+ name3+","+name3h);
+ tmp=replace(cmdL_6,"fnameh",Dqq(""));
+ tmp=replace(tmp,"fname","fnameall"); cmdL_6=tmp;
+ cmdL_5=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);";
+ cmdL=append(cmdL," outputend(dirfname);");
+ CommandListC=concat(CommandListC,cmdL); //180531to
+ ,
+ if(wflg==1,tmp1=append(options,"m"));
+ if(wflg==-1,tmp1=append(options,"r"));
+ if(ErrFlag==0,
+ tmp="sfcut"+nm;
+ CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); //180601
+ );
+ if(ErrFlag==1,
+ err("Sfcutparadata not completed");
+ ,
+ ReadOutData(fname);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")");
+ ReadOutData(fnameh);
+ GLIST=append(GLIST,"ReadOutData("+Dqq(fnameh)+")");
+ if(islist(parse(name3)),
+ tmp1=name2+"=Projpara("+Dqq(name3)+",[";
+ tmp2="";
+ if(length(options)>0,
+ forall(options,
+ tmp2=tmp2+Dqq(#)+",";
+ );
+ tmp2=substring(tmp2,0,length(tmp2)-1);
+ );
+ tmp1=tmp1+tmp2+"]);";
+ parse(tmp1);
+ tmp2=select(optionsh,length(#)>0); //180517(2lines)
+ if(length(tmp2)==0,tmp2=["nodisp"]);
+ tmp1=name2h+"=Projpara("+Dqq(name3h)+",[";
+ forall(tmp2,
+ tmp1=tmp1+Dqq(#)+",";
+ );
+ tmp1=substring(tmp1,0,length(tmp1)-1)+"]);";
+ parse(tmp1);
+ ,
+ ErrFlag=1;
+ );
);
);
);
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
index dc54682b443..84bfd5d0553 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
@@ -16,12 +16,34 @@
#########################################
-ThisVersion<- "KeTpic for R v5_2_4(20180327)"
+ThisVersion<- "KeTpic for R v5_2_4(20180603)"
print(ThisVersion)
+# 20180603
+# Setcolor debugged (length(Iro))
+# Scaledata,Reflectdata,Rotatedata,Translatedata changed ( for point list)
+# 20180602
+# Setcolor changed (rgb supported)
+# 20180523
+# Mkskeletondata debugged
+# 20180517
+# Sfbdparadata debugged ( tmp2[]=>tmp[2])
+# 20180511
+# Arrowhead,Arrowheaddata debugged ( for closed curve)
+# 20180510
+# Plotdata,Paramplot changed ( Assign added for KeTCindy )
+# Texsetctr debugged (grep, fixed=T)
+# Anglemark debugged ( for PB,PA,angle)
+# 20180509
+# Crvonsfparadata renamed to Crv2onsfparadata
+# Makecurves debugged ( Looprange used )
+# 20180506
+# Anglemark changed ( PB,PA,angle) supported
+# 20180501
+# Wireparadata changed and debugged ( is.numeric => length==1 )
# 20180402
-# Implicitplot greatly changed
+# Implicitplot largely changed
# 20180327
# Kyoukai debugged
# 20180317
@@ -768,41 +790,62 @@ Integrate<- function(...)
#--------------------------------------
#########################
+# 180506 (pB,pA,angle) supported
Anglemark<- function(...)
{
varargin<- list(...)
Nargs<- length(varargin)
Eps<- 10^(-3)
- PA<- varargin[[1]]
- PB<- varargin[[2]]
+ PB<- varargin[[1]]
+ PA<- varargin[[2]]
PC=varargin[[3]]
r <- 0.5
if(Nargs>=4){
r<- varargin[[4]]*r
}
Out=c()
- if(r>min(Norm(PA-PB),Norm(PC-PB))){
+ if(length(PC)>1){ #180506from
+ Tmp=min(Norm(PB-PA),Norm(PC-PA))
+ }else{
+ Tmp=Norm(PB-PA)
+ }
+ if(r>Tmp){ #180506to
return(Out)
}
- Cir<- Circledata(c(PB,r)) #17.11.29
+ Cir<- Circledata(c(PA,r)) #17.11.29
Tmp<- IntersectcrvsPp(Cir,Listplot(PA,PB))
P1<- Op(2,Op(1,Tmp))
- Tmp<- IntersectcrvsPp(Cir,Listplot(PC,PB))
- P2<- Op(2,Op(1,Tmp))
- if(abs(P1-P2)<Eps){
- Out<-c()
- return(Out)
- }
- if(P1<P2-Eps){
- Out<- Partcrv(P1,P2,Cir)
- }
- else{
- Tmp<- Numptcrv(Cir)
- Tmp1<- Partcrv(P1,Tmp,Cir)
- Tmp2<- Partcrv(1,P2,Cir)
- Out<- Joincrvs(Tmp1,Tmp2)
+ if(length(PC)>1){
+ Tmp<- IntersectcrvsPp(Cir,Listplot(PA,PC))
+ P2<- Op(2,Op(1,Tmp))
+ if(abs(P1-P2)<Eps){
+ Out<-c()
+ return(Out)
+ }
+ if(P1<P2-Eps){
+ Out<- Partcrv(P1,P2,Cir)
+ }
+ else{
+ Tmp<- Numptcrv(Cir)
+ Tmp1<- Partcrv(P1,Tmp,Cir)
+ Tmp2<- Partcrv(1,P2,Cir)
+ Out<- Joincrvs(Tmp1,Tmp2)
+ }
+ }else{
+ Tmp1=Pointoncurve(1,Cir)-PA
+ Tmp2=Pointoncurve(2,Cir)-PA
+ Tmp=Dotprod(Tmp1,Tmp2)/(Norm(Tmp1)*Norm(Tmp2))
+ Tmp=PC/acos(Tmp)
+ if(P1+Tmp<Length(Cir)){
+ Out<- Partcrv(P1,P1+Tmp,Cir)
+ }else{
+ Tmp1= Partcrv(P1,Length(Cir),Cir)
+ Tmp2= Partcrv(1,P1+Tmp-Length(Cir)+1,Cir)
+ Out<- Joincrvs(Tmp1,Tmp2)
+ }
}
+ Out
}
##############################################
@@ -876,6 +919,7 @@ Arrowdata<- function(...)
Arrowhead<-function(...)
{ ## Scaling is implemented
## 12.01.08 Kirikomi
+ Eps=10^(-3)
varargin<-list(...)
Nargs<-length(varargin)
P<-varargin[[1]]
@@ -916,15 +960,20 @@ Arrowhead<-function(...)
if(Nrow(Houkou)>1){
P<- Doscaling(P)
Houkou<- Doscaling(Houkou)
- Tmp<-Nearestpt(P,Houkou)
+ Tmp<-Nearestpt(P,Houkou)
A<-Tmp[[1]]
I<-floor(Tmp[[2]])
+ if(I==1){# 180511
+ if(Norm(Ptend(Houkou)-Ptstart(Houkou))<Eps){
+ I=Numptcrv(Houkou)
+ }
+ }
G<-Circledata(c(P,Ookisa*cos(Theta)),N=10) #17.11.29
Flg<- 0 # 13.11.13
JL<-seq(I,1,by=-1)
for (J in JL){
B<-Ptcrv(J,Houkou)
- Tmp<-IntersectcrvsPp(Listplot(list(A,B)),G)
+ Tmp<-IntersectcurvesPp(Listplot(list(A,B)),G) #180510
if(length(Tmp)>0){
Flg<- 1
break
@@ -951,7 +1000,7 @@ Arrowhead<-function(...)
}
A<-P+Ookisa*cos(Theta)*Ev+Ookisa*sin(Theta)*Nv
B<-P+Ookisa*cos(Theta)*Ev-Ookisa*sin(Theta)*Nv
- if(length(grep("l",Str))>0){
+ if(length(grep("l",Str,fixed=TRUE))>0){
Tmp<-Listplot(list(A,P,B))
Tmp1<- Unscaling(Tmp)
Drwline(Tmp1,Futosa)
@@ -973,6 +1022,7 @@ Arrowhead<-function(...)
Arrowheaddata<- function(...)
{ ## Scaling is implemented
+ Eps=10^(-3)
varargin<- list(...)
Nargs<- length(varargin)
P<- varargin[[1]]
@@ -1012,6 +1062,11 @@ Arrowheaddata<- function(...)
Tmp<-Nearestpt(P,Houkou)
A<-Tmp[[1]]
I<-floor(Tmp[[2]])
+ if(I==1){# 180511
+ if(Norm(Ptend(Houkou)-Ptstart(Houkou))<Eps){
+ I=Numptcrv(Houkou)
+ }
+ }
G<-Circledata(c(P,Ookisa*cos(Theta)),N=10) #17.11.29
Flg<- 0 # 13.11.13
JL<-seq(I,1,by=-1)
@@ -4267,9 +4322,9 @@ MakeCurves<-function(...){ ## Scaling is implemented
Eps<-10.0^(-6)
IndM<-Dataindex(Figdata)
Atos<-c()
- for (Nd in 1:Nrow(IndM)){
+ for (Nd in Looprange(1,Nrow(IndM))){ #180509
Tmp<-IndM[Nd,]
- Motos<-Figdata[Tmp[1]:Tmp[2],]
+ Motos<- Figdata[Tmp[1]:Tmp[2],]
All<-Nrow(Motos)
if(Nrow(Motos)==1){
if(InWindow(Motos)=="o"){
@@ -5046,7 +5101,9 @@ Paramplot<- function(...)
Nargs<- length(varargin)
Fnflg<- 0
Fnstr<- varargin[[1]]; Is=2
+ Fnstr=Assign(Fnstr) #180510(for KeTCindy)
Rgstr<- varargin[[Is]]; Is<- Is+1
+ Rgstr=Assign(Rgstr) #180510(for KeTCindy)
Range<- c(0,2*pi)
N<- 50 # Numpoints
E<-c() # Exclusions
@@ -5260,8 +5317,10 @@ Plotdata<- function(...)
varargin<- list(...)
Eps<- 10^(-5)
Fnstr<- varargin[[1]]; Is<- 2
+ Fnstr=Assign(Fnstr) #180510(for KeTCindy)
Fnflg<- 0
Rgstr<- varargin[[Is]]; Is<- Is+1
+ Rgstr=Assign(Rgstr) #180510(for KeTCindy)
Tmp<- strsplit(Rgstr,"=")
K<-Tmp[[1]]
if(length(K)>1){
@@ -6129,17 +6188,14 @@ Reflectdata<- function(...)
PtA<- Pts[1:2]; PtB<- Pts[3:4]
}
}
+ ML=Flattenlist(ML) #180603
OutL<- list()
- for (N in Looprange(1,length(ML))){
+ for (N in Looprange(1,Length(ML))){
GL<- Op(N,ML)
+ if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603
Out<- c()
- for (I in Looprange(1,Nrow(GL))){
- if(is.matrix(GL)){ # 10.12.07
- Tmp<- GL[I,]
- }
- else{
- Tmp<- GL
- }
+ for (I in Looprange(1,Length(GL))){
+ Tmp<- GL[I,]
X1<- Tmp[1]
Y1<- Tmp[2]
if(X1==Inf){
@@ -6389,18 +6445,15 @@ Rotatedata<- function(..., deg=FALSE)
else{
Pt<- varargin[[3]]
}
+ ML=Flattenlist(ML) #180603
Cx<- Pt[1]; Cy<- Pt[2]
OutL<- c()
- for (N in Looprange(1,length(ML))){
+ for (N in Looprange(1,Length(ML))){
GL<- Op(N,ML)
+ if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603
Out<- c()
- for (I in Looprange(1,Nrow(GL))){
- if(is.matrix(GL)){
- Tmp<- GL[I,]
- }
- else{
- Tmp<- GL
- }
+ for (I in Looprange(1,Length(GL))){
+ Tmp<- GL[I,]
X1<- Tmp[1]
Y1<- Tmp[2]
if(X1==Inf){
@@ -6443,17 +6496,14 @@ Scaledata<- function(...)
else{
Pt<- varargin[[4]]
}
+ ML=Flattenlist(ML) #180603
OutL<- list()
- for (N in Looprange(1,length(ML))){
+ for (N in Looprange(1,Length(ML))){
GL<- Op(N,ML)
+ if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603
Out<- c()
- for (I in Looprange(1,Nrow(GL))){
- if(is.matrix(GL)){ # 10.12.07
- Tmp<- GL[I,]
- }
- else{
- Tmp<- GL
- }
+ for (I in Looprange(1,Length(GL))){
+ Tmp<- GL[I,]
X1<- Tmp[1]
Y1<- Tmp[2]
if(X1==Inf){
@@ -6624,10 +6674,14 @@ Setcolor<- function(...){
}
Iro<- Ratiocmyk(Color)
if(length(Iro)==0) return(c())
- Str<- "\\color[cmyk]{" #17.09.22
- for(J in 1:4){
+ if(length(Iro)==4){ #180602from
+ Str<- "\\color[cmyk]{"
+ }else{
+ Str<- "\\color[rgb]{"
+ } #180602to
+ for(J in 1:length(Iro)){
Str<- paste(Str,as.character(Kosa*Iro[J]),sep="")
- if(J<4){
+ if(J<length(Iro)){ #180603
Str<- paste(Str,",",sep="")
}
}
@@ -7462,7 +7516,7 @@ Texsetctr<- function(Nctr,Opstr)
Va<- paste(Va,Tmp,sep="")
next
}
- if(length(grep(Tmp,OperL))==0){
+ if(length(grep(Tmp,OperL,fixed=TRUE))==0){ #180510
Va<- paste(Va,Tmp,sep="")
}
else{
@@ -7609,17 +7663,14 @@ Translatedata<- function(...)
B<- 0
}
}
+ ML=Flattenlist(ML) #180603
OutL<- list()
- for (N in Looprange(1,length(ML))){
+ for (N in Looprange(1,Length(ML))){
GL<- Op(N,ML)
+ if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603
Out<- c()
- for (I in Looprange(1,Nrow(GL))){
- if(is.matrix(GL)){ # 10.12.07
- Tmp<- GL[I,]
- }
- else{
- Tmp<- GL
- }
+ for (I in Looprange(1,Length(GL))){
+ Tmp<- GL[I,] #180603
X1<- Tmp[1]
Y1<- Tmp[2]
if(X1==Inf){
@@ -8441,7 +8492,7 @@ Kukannozoku<- function(Jokyo,KukanL){
########################################
Makeskeletondata<- function(Obj2L,Plt2L,R0,Eps2){
- Eps<- 10.0^(-3)
+ Eps<- 10.0^(-3)
Dmat<- c()
Dind<- c()
for (I in Looprange(1,Mixlength(Plt2L))){
@@ -8467,7 +8518,7 @@ Makeskeletondata<- function(Obj2L,Plt2L,R0,Eps2){
for (I in Looprange(1,Nrow(Dind))){
Tmp<- Dmat[Dind[I,1]:Dind[I,2],]
P2<- Tmp[,1:2]
- KC<- IntersectcrvsPp(P1,P2,Eps)
+ KC<- IntersectcrvsPp(P1,P2)
if(Mixlength(KC)>0){
for (J in 1:Mixlength(KC)){
P<- Op(1,Op(J,KC))
@@ -8858,8 +8909,8 @@ MakeveLfaceL<- function(VfL){
}
###########################
-#// 09.10.29
-#// 09.11.15
+# 09.10.29
+# 09.11.15
Menkakusi2<- function(Face,Nf,Ptype){
# global THETA PHI EyePoint FocusPoint VELNO VELHI
@@ -8955,7 +9006,7 @@ Menkakusi2<- function(Face,Nf,Ptype){
Tmp1<- Invparapt(P,Spaceline(Face))
}
P3<- Tmp[[1]]; Q3<- Tmp1[[1]]
- if(Ts>1-Eps){# // P3, Q3 are necessary
+ if(Ts>1-Eps){# P3, Q3 are necessary
Flg<- I
break
}
@@ -9067,8 +9118,8 @@ Parapt<- function(Plist){ # 18.02.19 changed (for point list)
Partcrv3<- function(T1,T2,Fk){
Eps0=10^(-4)
-#// Tmp=Mixop(1,Fk)
-#// new part from
+# Tmp=Mixop(1,Fk)
+# new part from
if(T1>(T2+Eps0)){
Npt<- Nrow(Fk)
Out1<- Partcrv3(T1,Npt,Fk)
@@ -10464,7 +10515,7 @@ Xyzaxpersname<- function(...){
#########################
#100815
-Zparapt<- function(P){#function Out=Zparapt(P)
+Zparapt<- function(P){
x<- P[1]; y<- P[2]; z<- P[3]
Out<- x*cos(PHI)*sin(THETA)+y*sin(PHI)*sin(THETA)+z*cos(THETA)
return(Out)
@@ -12622,7 +12673,7 @@ IntersectcurvesPp<- function(...){
for(ii in Looprange(1,length(tmp2))){
tmp=Collectsameseg(tmp1)
out=c(out,list(Op(1,tmp)))
- if(length(Op(2,tmp))==0){
+ if(length(Op(2,tmp))==0){
break
}else{
tmp1=Op(2,tmp)
@@ -13208,10 +13259,7 @@ Envelopedata<- function(...){
Eval11=Evlpfun(Uval1,Vval1)
Eval12=Evlpfun(Uval1,Vval2)
for(I in 1:(Mdv)){
-# Uval1=URNG[1]+(I-1)*Du
Uval2=URNG[1]+I*Du
-# Eval11=Evlpfun(Uval1,Vval1)
-# Eval12=Evlpfun(Uval1,Vval2)
Eval21=Evlpfun(Uval2,Vval1)
Eval22=Evlpfun(Uval2,Vval2)
a1=Uval1;b1=Vval1;c1=Eval11
@@ -13276,8 +13324,6 @@ Dropnumlistcrv<- function(QdL,Eps1){
if(Norm(P-Op(K,Pd))>Eps1){ #18.02.12 eps
PtL=c(PtL,K)
}
-# if(length(PtL)==1){ #180306
-# }
OutL=c(OutL,list(PtL))
}
return(OutL)
@@ -13460,12 +13506,8 @@ PthiddenQ<- function(PtA,Vec,Uveq,Np,Eps1,Eps2){
Uval1=URNG[1] #180306(3lines)
Eval11=Eqfun(Uval1,Vval1)
Eval12=Eqfun(Uval1,Vval2)
- Uval1=URNG[1] #180305(3lines)
for(I in Looprange(1,Np[1])){ #180227
-# Uval1=URNG[1]+(I-1)*Dx
Uval2=URNG[1]+I*Dx
-# Eval11=Eqfun(Uval1,Vval1)
-# Eval12=Eqfun(Uval1,Vval2)
Eval21=Eqfun(Uval2,Vval1)
Eval22=Eqfun(Uval2,Vval2)
a1=Uval1;b1=Vval1;c1=Eval11
@@ -13483,7 +13525,6 @@ PthiddenQ<- function(PtA,Vec,Uveq,Np,Eps1,Eps2){
next
}
if(abs(M2)<Eps0){
-# QL=Appendrow(QL,P2)
next
}
if((M1> 0) && (M2> 0)){
@@ -13547,8 +13588,8 @@ PthiddenQ<- function(PtA,Vec,Uveq,Np,Eps1,Eps2){
}
}
Tmp1=Crossprod(Pt-PtA,Vec)
- if(Norm(Tmp1)<Eps1){ #18.02.19
- if(Zparapt(Pt)>Zparapt(PtA)+Eps2){
+ if(Norm(Tmp1)<Eps1){ #18.02.19
+ if(Zparapt(Pt)>Zparapt(PtA)+Eps2){
return(list(1,Pt,Zparapt(Pt),Zparapt(PtA)))
}else{
Out=Appendrow(Out,Pt)
@@ -13599,14 +13640,14 @@ Nohiddenpara2<- function (Par,Fk,Uveq,Np,Eps1,Eps2){
PaL[length(PaL)]=tmp2
}else{
PaL=c(PaL,tmp2)
- } #18.02.26until
+ } #18.02.26to
SeL=c()
for(N in Looprange(1,length(PaL)-1)){
S=(PaL[N]+PaL[N+1])/2
Tmp=Invparapt(S,Fh,Fk)
- PtA=Op(1,Tmp)
+ PtA=Op(1,Tmp)
PtAp=Parapt(PtA)
- Vec=c(sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA))
+ Vec=c(sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA))
Flg=PthiddenQ(PtA,Vec,Uveq,Np,Eps1,Eps2)
if(Flg[[1]]==0){
SeL=c(SeL,N)
@@ -13838,9 +13879,6 @@ Sfbdparadata<- function(...){
}
}
starttime=proc.time()
-# tmp=Evlptablepara(Np)
-# Zval=tmp[[1]]; Xval=tmp[[2]]; Yval=tmp[[3]]
-# Out3=Implicitplot(Zval,Xval,Yval)
Out3=Envelopedata(Fd) #180306
tmp3=list()
pts=list() #180306
@@ -13857,7 +13895,6 @@ Sfbdparadata<- function(...){
tmp=Op(1,Nlist)
tmp=Op(tmp,tmp1)
pts=c(pts,list(tmp))
-# pts=c(pts,list(XYZfunc(tmp[1],tmp[2])))#180306until
}else{
tmp=c()
for(kk in Looprange(1,length(Nlist))){
@@ -13873,11 +13910,11 @@ Sfbdparadata<- function(...){
pts=list()
for(ii in Looprange(1,length(tmp3))){
tmp=Op(ii,tmp3)
- tmp1=XYZfunc(tmp[1],tmp2[])
+ tmp1=XYZfunc(tmp[1],tmp[2])
flg=0
for(jj in Looprange(1,length(pts))){
tmp=Op(jj,pts)
- tmp2=XYZfunc(tmp[1],tmp2[])
+ tmp2=XYZfunc(tmp[1],tmp[2]) #180517
if(Norm(tmp1-tmp2)<Eps1){
flg=1; break
}
@@ -13908,7 +13945,7 @@ Sfbdparadata<- function(...){
next
}
}
- } #180306until
+ } #180306to
IMPLICITDATA<<- Out3
Tmp=proc.time()-starttime
print(paste('ImplicitData obtained : Time =',sprintf("%6.3f",Tmp[1]),sep=''))
@@ -13950,10 +13987,7 @@ Meetpoints<- function(PtA,PtB,Uveq,Np,Eps1){
Eval11=Eqfun(Uval1,Vval1)
Eval12=Eqfun(Uval1,Vval2)
for(I in Looprange(1,Np[1])){
-# Uval1=URNG[1]+(I-1)*Dx
Uval2=URNG[1]+I*Dx
-# Eval11=Eqfun(Uval1,Vval1)
-# Eval12=Eqfun(Uval1,Vval2)
Eval21=Eqfun(Uval2,Vval1)
Eval22=Eqfun(Uval2,Vval2)
a1=Uval1;b1=Vval1;c1=Eval11
@@ -13971,7 +14005,6 @@ Meetpoints<- function(PtA,PtB,Uveq,Np,Eps1){
next
}
if(abs(M2)<Eps0){
-# QL=Appendrow(QL,P2)
next
}
if((M1> 0) && (M2> 0)){
@@ -14037,7 +14070,7 @@ Meetpoints<- function(PtA,PtB,Uveq,Np,Eps1){
Tmp1=Crossprod(Pt-PtA,Vec)
if(Norm(Tmp1)<Eps1){ #18.02.19
Tmp1=Dotprod(Pt-PtA,Vec) #18.02.21
- if((Tmp1>-Eps0)&&(Tmp1<Norm(PtB-PtA)+Eps0)){
+ if((Tmp1>-Eps0)&&(Norm(Pt-PtA)<Norm(PtB-PtA)+Eps0)){#180429
Out=c(Out,list(Pt))
}
}
@@ -14253,7 +14286,7 @@ Crv3onsfparadata<- function(...){
return(Out)
}
-Crvonsfparadata<- function(...){
+Crv2onsfparadata<- function(...){
starttime=proc.time()
varargin=list(...)
Nargs=length(varargin)
@@ -14306,7 +14339,7 @@ Wireparadata<- function(...){
DvL=varargin[[4]]
Np=c(50,50)
Eps1=0.01
- Eps2=0.05
+ Eps2=0.1
ctr=0
for(jj in Looprange(5,Nargs)){
tmp=varargin[[jj]]
@@ -14321,7 +14354,7 @@ Wireparadata<- function(...){
if(ctr==2){Eps2=tmp}
}
}
- if(is.numeric(DuL)){
+ if(length(DuL)==1){ #180430
tmp1=DuL
DuL=list()
for(jj in Looprange(1,tmp1)){
@@ -14329,7 +14362,7 @@ Wireparadata<- function(...){
DuL=c(DuL,list(tmp))
}
}
- if(is.numeric(DvL)){
+ if(length(DvL)==1){ #180430
tmp1=DvL
DvL=list()
for(jj in Looprange(1,tmp1)){
@@ -14519,10 +14552,7 @@ Sfcutparadata<- function(...){
Eval11=Eqfun(Uval1,Vval1)
Eval12=Eqfun(Uval1,Vval2)
for(I in Looprange(1,Np[1])){
-# Uval1=URNG[1]+(I-1)*Du
Uval2=URNG[1]+I*Du
-# Eval11=Eqfun(Uval1,Vval1)
-# Eval12=Eqfun(Uval1,Vval2)
Eval21=Eqfun(Uval2,Vval1)
Eval22=Eqfun(Uval2,Vval2)
a1=Uval1;b1=Vval1;c1=Eval11
@@ -14540,7 +14570,6 @@ Sfcutparadata<- function(...){
next
}
if(abs(M2)<Eps0){
-# QL=Appendrow(QL,P2)
next
}
if((M1> 0) && (M2> 0)){
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r
index 370339480ae..370339480ae 100644..100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommon.h b/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommon.h
index 27a5434fe41..84de58498f3 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommon.h
+++ b/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommon.h
@@ -108,6 +108,15 @@ void pull6(int num, double ptL[][6],double pt[6]){
pt[3]=ptL[num][3]; pt[4]=ptL[num][4]; pt[5]=ptL[num][5];
}
+int add1(double gdata[], double x){
+ int nall;
+ nall=length1(gdata);
+ nall++;
+ gdata[nall]=x;
+ gdata[0]=nall;
+ return nall;
+}
+
int add2(double gdata[][2], double x, double y){
int nall;
nall=push2(x, y, gdata);
@@ -189,6 +198,28 @@ int appendd3(int level, int from,int upto, double gdata[][3],double mat[][3]){
return nall+np;
}
+int appendd6(int level, int from,int upto, double gdata[][6],double mat[][6]){
+ int j, np, nall=length6(mat);
+ np=upto-from+1;
+ if(np<0){np=0;}
+ if(np>0){
+ if(level>0){
+ if(nall>0){
+ nall=push6(Inf,level,0,0,0,0,mat);
+ }
+ }
+ for(j=1; j<=np; j++){
+ mat[nall+j][0]=gdata[from+j-1][0];
+ mat[nall+j][1]=gdata[from+j-1][1];
+ mat[nall+j][2]=gdata[from+j-1][2];
+ mat[nall+j][3]=gdata[from+j-1][3];
+ mat[nall+j][4]=gdata[from+j-1][4];
+ mat[nall+j][5]=gdata[from+j-1][5]; }
+ }
+ mat[0][0]=nall+np;
+ return nall+np;
+}
+
int prependd2(int from,int upto, double gdata[][2],double mat[][2]){
int j,np, nall=length2(mat);
if(from<=upto){
@@ -216,7 +247,38 @@ int prependd2(int from,int upto, double gdata[][2],double mat[][2]){
return nall+np;
}
-int appendd1(double numvec[], double num){
+int prependd3(int from,int upto, double gdata[][3],double mat[][3]){
+ int j,np, nall=length3(mat);
+ if(from<=upto){
+ np=upto-from+1;
+ for(j=nall; j>=1; j--){
+ mat[np+j][0]=mat[j][0];
+ mat[np+j][1]=mat[j][1];
+ mat[np+j][2]=mat[j][2];
+ }
+ for(j=1; j<=np; j++){
+ mat[j][0]=gdata[from+j-1][0];
+ mat[j][1]=gdata[from+j-1][1];
+ mat[j][2]=gdata[from+j-1][2];
+ }
+ }else{
+ np=from-upto+1;
+ for(j=nall; j>=1; j--){
+ mat[np+j][0]=mat[j][0];
+ mat[np+j][1]=mat[j][1];
+ mat[np+j][2]=mat[j][2];
+ }
+ for(j=1; j<=np; j++){
+ mat[nall+j][0]=gdata[from-j+1][0];
+ mat[nall+j][1]=gdata[from-j+1][1];
+ mat[nall+j][2]=gdata[from-j+1][2];
+ }
+ }
+ mat[0][0]=nall+np;
+ return nall+np;
+}
+
+int appendd1(double num,double numvec[]){
int n;
n=floor(numvec[0]+0.5);
numvec[n+1]=num;
@@ -224,7 +286,7 @@ int appendd1(double numvec[], double num){
return n+1;
}
-int appendi1(int numvec[],int num){
+int appendi1(int num,int numvec[]){
int n;
n=numvec[0];
numvec[n+1]=num;
@@ -232,6 +294,17 @@ int appendi1(int numvec[],int num){
return n+1;
}
+int prependd1(double num, double numvec[]){
+ int i,n;
+ n=numvec[0];
+ for(i=n; i>=1; i--){
+ numvec[i+1]=numvec[i];
+ }
+ numvec[1]=num;
+ numvec[0]=n+1;
+ return n+1;
+}
+
int prependi1(int num, int numvec[]){
int i,n;
n=numvec[0];
@@ -259,6 +332,19 @@ int removei2(int nrmv,int mat[][2]){
}
}
+void removed3(int nrmv,double mat[][3]){
+ int j,nall=length3(mat);
+ if(nall>0){
+ for(j=nrmv; j<=nall-1; j++){
+ mat[j][0]=mat[j+1][0];
+ mat[j][1]=mat[j+1][1];
+ mat[j][2]=mat[j+1][2];
+ }
+ mat[0][0]=nall-1;
+ return;
+ }
+}
+
int dataindexd1(double out[],int din[][2]){
int n1=1, j, ctr=0, nall=floor(out[0]+0.5);
if(nall==0){
@@ -349,6 +435,29 @@ int dataindexd4(int level, double out[][4],int din[][2]){
return ctr;
}
+int dataindexd6(int level, double out[][6],int din[][2]){
+ int n1=1, j, ctr=0, nall=length6(out);
+ if(nall==0){
+ din[0][0]=0;
+ return 0;
+ }
+ for(j=1; j<=nall; j++){
+ if(out[j][0]>Inf-1){
+ if((level==0) || (out[j][1]==level)){
+ ctr++;
+ din[ctr][0]=n1;
+ din[ctr][1]=j-1;
+ n1=j+1;
+ }
+ }
+ }
+ ctr++;
+ din[ctr][0]=n1;
+ din[ctr][1]=nall;
+ din[0][0]=ctr;
+ return ctr;
+}
+
int dataindexi1(int out[],int din[][2]){
int n1=1, j, ctr=0, nall=out[0], ninfp=0;
if(nall==0){
@@ -379,6 +488,102 @@ int dataindexi1(int out[],int din[][2]){
return ctr;
}
+void replacelistd1(int ii,double out[],double rep[]){
+ int din[DsizeS][2],k,j,js,je, nall=length1(out),nr=length1(rep);
+ double tmpd1[DsizeL];
+ dataindexd1(out,din);
+ tmpd1[0]=0;
+ for(k=1;k<=din[0][0];k++){
+ if(k!=1){
+ appendd1(Inf,tmpd1);
+ }
+ if(k!=ii){
+ js=din[k][0]; je=din[k][1];
+ for(j=js;j<=je;j++){
+ appendd1(out[j],tmpd1);
+ }
+ }else{
+ for(j=1;j<=nr;j++){
+ appendd1(rep[j],tmpd1);
+ }
+ }
+ }
+ nall=length1(tmpd1);
+ out[0]=0;
+ for(j=1;j<=nall;j++){
+ appendd1(tmpd1[j],out);
+ }
+}
+
+void replacelistd2(int level,int ii,double out[][2],double rep[][2]){//180419
+ int din[DsizeS][2],k,js,je, nall=length2(out),nr=length2(rep);
+ double tmpmd2[DsizeL][2];
+ dataindexd2(level,out,din);
+ tmpmd2[0][0]=0;
+ for(k=1;k<=din[0][0];k++){
+ if(k!=ii){
+ js=din[k][0]; je=din[k][1];
+ appendd2(level,js,je,out,tmpmd2);
+ }else{
+ appendd2(level,1,nr,rep,tmpmd2);
+ }
+ }
+ nall=length2(tmpmd2);
+ out[0][0]=0;
+ appendd2(level,1,nall,tmpmd2,out);
+}
+
+void replacelistd3(int level,int ii,double out[][3],double rep[][3]){//180428
+ int din[DsizeS][2],k,js,je, nall=length3(out),nr=length3(rep);
+ double tmpmd3[DsizeL][3];
+ dataindexd3(level,out,din);
+ tmpmd3[0][0]=0;
+ for(k=1;k<=din[0][0];k++){
+ if(k!=ii){
+ js=din[k][0]; je=din[k][1];
+ appendd3(level,js,je,out,tmpmd3);
+ }else{
+ appendd3(level,1,nr,rep,tmpmd3);
+ }
+ }
+ nall=length3(tmpmd3);
+ out[0][0]=0;
+ appendd3(level,1,nall,tmpmd3,out);
+}
+
+void replacelistd6(int level,int ii,double out[][6],double rep[][6]){//180421
+ int din[DsizeS][2],k,js,je, nall=length6(out),nr=length6(rep);
+ double tmpmd6[DsizeL][6];
+ dataindexd6(level,out,din);
+ js=din[ii][0]; je=din[ii][1];
+ tmpmd6[0][0]=0;
+ for(k=1;k<=din[0][0];k++){
+ if(k!=ii){
+ js=din[k][0]; je=din[k][1];
+ appendd6(level,js,je,out,tmpmd6);
+ }else{
+ appendd6(level,1,nr,rep,tmpmd6);
+ }
+ }
+ nall=length6(tmpmd6);
+ out[0][0]=0;
+ appendd6(level,1,nall,tmpmd6,out);
+}
+
+void removelistd2(int level,int ii,double out[][2]){//180503
+ int din[DsizeS][2],k,js,je,nall=length2(out);
+ double tmpmd[DsizeL][2];
+ dataindexd2(level,out,din);
+ js=din[ii][0]; je=din[ii][1];
+ tmpmd[0][0]=0;
+ appendd2(0,je+1,nall,out,tmpmd);
+ out[0][0]=0;
+ if(js>1){
+ out[0][0]=js-2;
+ }
+ appendd2(0,1,length2(tmpmd),tmpmd,out);
+}
+
void dispvec(int n,double dt[]){
int i;
for(i=0; i<n; i++){
@@ -433,6 +638,15 @@ void dispmatd6(int from, int upto, double mat[][6]){
}
}
+void dispmatd1all(double dt[]){
+ int i,n;
+ n=length1(dt);
+ for(i=1; i<=n; i++){
+ printf("%f ",dt[i]);
+ }
+ printf("\n");
+}
+
void dispmatd2all(double mat[][2]){
int i;
if(mat[0][0]==0){printf("%s\n","no data");return;}
@@ -490,58 +704,68 @@ void dispmati1(int from, int upto, int mat[]){
}
}
+void writedata3(const char *fname, double out[][3]){
+ int i, nall;
+ FILE *fp;
+ nall=length3(out);
+ fp=fopen(fname,"w");
+ for(i=1; i<=nall; i++){
+ fprintf(fp,"%7.5f %7.5f %7.5f",out[i][0],out[i][1],out[i][2]);
+ if(i<nall){fprintf(fp,"\n");}
+ }
+ fclose(fp);
+}
+
void readdata3(const char *fname, double out[][3]){
- double data[DsizeL][4];
- int i, j, ndata, nall;
+ int n,j;
FILE *fp;
fp=fopen(fname,"r");
if(fp==NULL){
printf("file not found\n");
return;
}
- ndata=0;
- i=1;
- while( ! feof(fp) && i<DsizeL){
- for(j=0;j<4;j++){
- fscanf(fp,"%lf",&data[i][j]);
+ n=1;
+ while( ! feof(fp) && n<DsizeL){
+ for(j=0;j<3;j++){
+ fscanf(fp,"%lf",&out[n][j]);
}
- i++;
- ndata++;
+ n++;
}
- ndata--;
+ n--;
fclose(fp);
- out[0][0]=0; nall=0;
- for(i=1; i<=ndata; i++){
- nall=add3(out, data[i][0], data[i][1], data[i][2]);
+ out[0][0]=n;
+}
+
+void writedata2(const char *fname, double out[][2]){
+ int i, nall;
+ FILE *fp;
+ nall=length2(out);
+ fp=fopen(fname,"w");
+ for(i=1; i<=nall; i++){
+ fprintf(fp,"%7.5f %7.5f",out[i][0],out[i][1]);
+ if(i<nall){fprintf(fp,"\n");}
}
- return;
+ fclose(fp);
}
void readdata2(const char *fname, double out[][2]){
- double data[DsizeL][3];
- int i, j, ndata, nall;
+ int n,j;
FILE *fp;
fp=fopen(fname,"r");
if(fp==NULL){
printf("file not found\n");
return;
}
- ndata=0;
- i=1;
- while( ! feof(fp) && i<DsizeL){
- for(j=0;j<3;j++){
- fscanf(fp,"%lf",&data[i][j]);
+ n=1;
+ while( ! feof(fp) && n<DsizeL){
+ for(j=0;j<2;j++){
+ fscanf(fp,"%lf",&out[n][j]);
}
- i++;
- ndata++;
+ n++;
}
- ndata--;
+ n--;
fclose(fp);
- out[0][0]=0; nall=0;
- for(i=1; i<=ndata; i++){
- nall=add2(out, data[i][0], data[i][1]);
- }
- return;
+ out[0][0]=n;
}
int output2(const char *var, const char *fname, int level, double out[][2]){
@@ -729,6 +953,7 @@ int connectseg(double pdata[][2], double eps, double out[][2]){
int nall=length2(pdata), nout=0;
double qd[DsizeM][2], ah[2], ao[2], p[2], q[2], tmp[2];
out[0][0]=0;
+ if(length2(pdata)==0){return 0;} //180613
nd=dataindexd2(0,pdata,din);
qd[0][0]=0;
nq=appendd2(0,din[1][0],din[1][1],pdata,qd);
@@ -780,6 +1005,63 @@ int connectseg(double pdata[][2], double eps, double out[][2]){
return nout;
}
+int connectseg3(double pdata[][3], double eps, double out[][3]){
+ int din[DsizeM][2],i,j,nd,nq,flg, st, en, ntmp;
+ int nall=length3(pdata), nout=0;
+ double qd[DsizeM][3], ah[3], ao[3], p[3], q[3], tmp[3];
+ out[0][0]=0;
+ if(length3(pdata)==0){return 0;} //180613
+ nd=dataindexd3(0,pdata,din);
+ qd[0][0]=0;
+ nq=appendd3(0,din[1][0],din[1][1],pdata,qd);
+ removei2(1,din);
+ while(nd>0){
+ pull3(1,qd,ah);
+ pull3(nq,qd,ao);
+ flg=0;
+ for(j=1; j<=nd; j++){
+ st=din[j][0];
+ en=din[j][1];
+ pull3(st,pdata,p);
+ pull3(en,pdata,q);
+ if(dist(3,p,ao)<eps){
+ nq=appendd3(0,st+1,en,pdata,qd);
+ nd=removei2(j,din);
+ flg=1;
+ break;
+ }
+ if(dist(3,q,ao)<eps){
+ nq=appendd3(0,en-1,st,pdata,qd);
+ nd=removei2(j,din);
+ flg=1;
+ break;
+ }
+ if(dist(3,p,ah)<eps){
+ nq=prependd3(en,st+1,pdata,qd);
+ nd=removei2(j,din);
+ flg=1;
+ break;
+ }
+ if(dist(3,q,ah)<eps){
+ nq=prependd3(st,en-1,pdata,qd);
+ nd=removei2(j,din);
+ flg=1;
+ break;
+ }
+ }
+ if(flg==0){
+ nout=appendd3(2,1,nq,qd,out);
+ qd[0][0]=0;
+ nq=appendd3(0,din[1][0],din[1][1],pdata,qd);
+ nd=removei2(1,din);
+ }
+ }
+ if(nq>0){
+ nout=appendd3(2,1,nq,qd,out);
+ }
+ return nout;
+}
+
void koutenseg(double a[2], double b[2], double c[2], double d[2],
double eps, double eps2, double out[4]){
double v[2], epss,eps0=Eps, sv2, p1, p2, q1,q2,m1, m2, M1, M2, t;
@@ -1227,26 +1509,26 @@ int dropnumlistcrv(double qd[][2], double eps1, int out[]){
pd[0][0]=0; npd=0;
npd=appendd2(0,se,en,qd,pd);
ptL[0]=0; nptL=0;
- nptL=appendi1(ptL,1);
+ nptL=appendi1(1,ptL);
pull2(1,pd,p);
for(k=2; k<=npd-1; k++){
pull2(k,pd,tmp2d);
if(dist(2,p,tmp2d)>eps1){
- nptL=appendi1(ptL,k);
+ nptL=appendi1(k,ptL);
pull2(k,pd,p);
}
}
pull2(npd-1,pd,p);
pull2(npd,pd,tmp2d);
if(dist(2,p,tmp2d)>eps){ // eps -> eps1 ?
- nptL=appendi1(ptL,npd);
+ nptL=appendi1(npd,ptL);
}
if(nptL==1){ptL[0]=0; nptL=0;}
if(nout>0){
- nout=appendi1(out,Infint);
+ nout=appendi1(Infint,out);
}
for(i=1; i<=nptL; i++){
- nout=appendi1(out,ptL[i]);
+ nout=appendi1(ptL[i],out);
}
}
out[0]=nout;
@@ -1955,7 +2237,7 @@ void intersectpartseg(double crv1[][2],double crv2[][2],int ii, int jj,int num,d
void collectsameseg(double ptdL[][6],double rL[][6]){
double Eps00=pow(10,-8.0),tmp1d[2],tmp2d[2],tmp1d6[6],tmp2d6[6];
- int ii,jj,kk,nr,ctr,numL[40],diffL[40];
+ int ii,jj,kk,istr,nr,numL[40],diffL[40];
double s1,e1,s2,e2,dst,tmp1,tmp2,tmp1md6[40][6];
rL[0][0]=0;
if(length6(ptdL)==0){
@@ -1979,13 +2261,13 @@ void collectsameseg(double ptdL[][6],double rL[][6]){
}else{
s2=kk-Eps00; e2=s2+1+2*Eps00;
}
- ctr=1;numL[0]=0;
+ numL[0]=0;
for(ii=1;ii<=length6(rL);ii++){
pull6(ii,rL,tmp1d6);
tmp1=tmp1d6[2]; tmp2=tmp1d6[3];
if((tmp1>s1)&&(tmp1<e1)&&(tmp2>s2)&&(tmp2<e2)){
addptd6(tmp1md6,tmp1d6);
- numL[ctr]=ii;ctr++;
+ appendi1(ii,numL);
}
}
dst=100;
@@ -2005,7 +2287,7 @@ void collectsameseg(double ptdL[][6],double rL[][6]){
for(ii=0;ii<=length6(rL);ii++){
diffL[ii]=0;
}
- for(ii=1;ii<=ctr;ii++){
+ for(ii=1;ii<=numL[0];ii++){
kk=numL[ii];
diffL[kk]=1;
}
@@ -2018,12 +2300,12 @@ void collectsameseg(double ptdL[][6],double rL[][6]){
}
}
-void intersectcurvesPp(double crv1s[][2],double crv2s[][2],int num,double out[][6]){
+void intersectcurvesPp(double crv1s[][2],double crv2s[][2],int nbez,double out[][6]){
double Eps00=pow(10,-8.0),Dist=10*Eps2, crv1[DsizeL][2],crv2[DsizeL][2];
- double tmp1md6[DsizeS][6],tmp2md6[DsizeS][6];
+ double tmp1md6[DsizeS][6],tmp2md6[DsizeS][6],tmpmd1[DsizeS];
double tmpd[2],tmp1d[2],tmp2d[2],tmpd6[6],tmp1d6[6];
- double sx,sy,dst,ans[4];
- int ii,jj,kk,nall,self,js,je;
+ double sx,sy,dst,ans1[4],ans2[4];
+ int ii,jj,kk,nall,self,js,je,din[DsizeS][2];
crv1[0][0]=0;
pull2(1,crv1s,tmpd);addptd2(crv1,tmpd);
for(ii=2;ii<=length2(crv1s);ii++){
@@ -2063,7 +2345,7 @@ void intersectcurvesPp(double crv1s[][2],double crv2s[][2],int num,double out[][
js=ii+2; je=length2(crv2)-1;
}
for(jj=js;jj<=je;jj++){
- intersectpartseg(crv1,crv2,ii,jj,num,tmpd6);
+ intersectpartseg(crv1,crv2,ii,jj,nbez,tmpd6);
if(tmpd6[0]<Inf-Eps){
tmpd[0]=tmpd6[0];tmpd[1]=tmpd6[1];
if(length6(tmp1md6)==0){
@@ -2085,41 +2367,48 @@ void intersectcurvesPp(double crv1s[][2],double crv2s[][2],int num,double out[][
tmp2md6[0][0]=0;
while(length6(tmp1md6)>0){
collectsameseg(tmp1md6,tmp2md6);
- dst=100;
- for(ii=1;ii<=length6(tmp1md6);ii++){
- pull6(ii,tmp1md6,tmpd6);
- if(tmpd6[4]<dst){
- dst=tmpd6[4];
- }
+ appendd6(2,1,length6(tmp1md6),tmp1md6,out);
+ tmp1md6[0][0]=0;
+ for(ii=1;ii<=length6(tmp2md6);ii++){
+ pull6(ii,tmp2md6,tmpd6);addptd6(tmp1md6,tmpd6);
}
- sx=0; sy=0;nall=0;
- for(ii=1;ii<=length6(tmp1md6);ii++){
- pull6(ii,tmp1md6,tmpd6);
- if(tmpd6[4]<dst+Eps00){
- nall++;
- sx=sx+tmpd6[0]; sy=sy+tmpd6[1];
+ }
+ dataindexd6(2,out,din);
+ for(ii=1;ii<=length2i(din);ii++){
+ tmp1md6[0][0]=0;
+ appendd6(2,din[ii][0],din[ii][1],out,tmp1md6);
+ if(length6(tmp1md6)==1){
+ replacelistd6(2,ii,out,tmp1md6);
+ }else{
+ dst=100;
+ for(jj=1;jj<=length6(tmp1md6);jj++){
+ pull6(jj,tmp1md6,tmpd6);
+ if(tmpd6[4]<dst){
+ dst=tmpd6[4];
+ }
+ }
+ sx=0; sy=0;nall=0;
+ for(jj=1;jj<=length6(tmp1md6);jj++){
+ pull6(jj,tmp1md6,tmpd6);
+ if(tmpd6[4]<dst+Eps00){
+ nall++;
+ sx=sx+tmpd6[0]; sy=sy+tmpd6[1];
+ }
}
tmp1d[0]=sx/nall; tmp1d[1]=sy/nall;
- tmp1d6[0]=tmp1d[0];tmp1d6[1]=tmp1d[1];
- nearestptpt(tmp1d,crv1,ans);
- tmp1d6[2]=ans[2];
- nearestptpt(tmp1d,crv2,ans);
- tmp1d6[3]=ans[2];
- tmp1d6[4]=dst;
- tmp1d6[5]=tmpd6[5];
- addptd6(out,tmp1d6);
- }
- tmp1md6[0][0]=0;
- for(ii=1;ii<=length6(tmp2md6);ii++){
- pull6(ii,tmp2md6,tmpd6);addptd6(tmp1md6,tmpd6);
+ nearestptpt(tmp1d,crv1,ans1);
+ nearestptpt(tmp1d,crv2,ans2);
+ tmp2md6[0][0]=0;
+ push6(sx/nall,sy/nall,ans1[2],ans2[2],dst,tmp1md6[1][5],tmp2md6);
+ replacelistd6(2,ii,out,tmp2md6);
}
}
}
-void intersectcurves(double crv1[][2],double crv2[][2],int num,double out[][2]){
+void intersectcurves(double crv1[][2],double crv2[][2],int nbez,double out[][2]){
double out6[DsizeS][6],tmpd[2],tmpd6[6];
int jj;
- intersectcurvesPp(crv1,crv2,num,out6);
+ intersectcurvesPp(crv1,crv2,nbez,out6);
out[0][0]=0;
for(jj=1;jj<=length6(out6);jj++){
pull6(jj,out6,tmpd6);push2(tmpd6[0],tmpd6[1],out);
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommonhead.h b/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommonhead.h
index 7e83a2b9e83..7b22ddfba83 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommonhead.h
+++ b/Master/texmf-dist/scripts/ketcindy/ketlibC/ketcommonhead.h
@@ -12,6 +12,7 @@ int addptd3(double gdata[][3], double pt[3]);
int addptd4(double gdata[][4], double pt[4]);
int addptd5(double gdata[][5], double pt[5]);
int addptd6(double gdata[][6], double pt[6]);
+int add1(double gdata[], double x);
int add2(double gdata[][2], double x, double y);
int add3(double gdata[][3], double x, double y, double z);
int push2(double x, double y, double ptL[][2]);
@@ -26,18 +27,29 @@ void pull5(int num, double ptL[][5],double pt[5]);
void pull6(int num, double ptL[][6],double pt[6]);
int appendd2(int level, int from,int upto, double gdata[][2],double mat[][2]);
int appendd3(int level, int from,int upto, double gdata[][3],double mat[][3]);
+int appendd6(int level, int from,int upto, double gdata[][6],double mat[][6]);
int prependd2(int from,int upto, double gdata[][2],double mat[][2]);
-int appendd1(double numvec[], double num);
-int appendi1(int numvec[],int num);
+int prependd3(int from,int upto, double gdata[][3],double mat[][3]);
+int appendd1(double num,double numvec[]);
+int prependd1(double num, double numvec[]);
+int appendi1(int num,int numvec[]);
int prependi1(int num, int numvec[]);
int removei2(int nrmv,int mat[][2]);
+void removed3(int nrmv,double mat[][3]);
int dataindexi1(int out[],int din[][2]);
int dataindexd1(double out[],int din[][2]);
int dataindexd2(int level,double out[][2],int din[][2]);
int dataindexd3(int level, double out[][3],int din[][2]);
int dataindexd4(int level, double out[][4],int din[][2]);
+int dataindexd6(int level, double out[][6],int din[][2]);
+void replacelistd1(int ii,double out[],double rep[]);
+void replacelistd2(int level,int jj,double out[][2],double rep[][2]);
+void replacelistd3(int level,int jj,double out[][3],double rep[][3]);
+void replacelistd6(int level,int ii,double out[][6],double rep[][6]);
+void removelistd2(int level,int ii,double out[][2]);
void dispvec(int n,double dt[]);
void dispveci(int n,int dt[]);
+void dispmatd1all(double dt[]);
void dispmatd2(int from, int upto, double mat[][2]);
void dispmatd3(int from, int upto, double mat[][3]);
void dispmatd4(int from, int upto, double mat[][4]);
@@ -50,7 +62,9 @@ void dispmatd5all(double mat[][5]);
void dispmatd6all(double mat[][6]);
void dispmati2(int from, int upto, int mat[][2]);
void dispmati1(int from, int upto, int mat[]);
+void writedata3(const char *fname, double out[][3]);
void readdata3(const char *fname, double out[][3]);
+void writedata2(const char *fname, double out[][2]);
void readdata2(const char *fname, double out[][2]);
int output2(const char *var, const char *fname, int level, double out[][2]);
void simplesort(double number[]);
@@ -64,6 +78,7 @@ void pointoncurve(double t, double gdata[][2], double eps, double pt[]);
int partcrv(double a,double b,double pkL[][2], double pL[][2]);
int partcrv3(double a,double b,double pkL[][3], double pL[][3]);
int connectseg(double pdata[][2], double eps, double out[][2]);
+int connectseg3(double pdata[][3], double eps, double out[][3]);
void koutenseg(double a[2], double b[2], double c[2], double d[2],
double eps, double eps2, double out[4]);
double paramoncurve(double p[2], int n, double ptL[][2]);
@@ -90,8 +105,8 @@ void intersectseg(double seg1[][2],double seg2[][2], double out[5]);
int osplineseg(double ptlist[5][2],int num,double out[][2]);
void intersectpartseg(double crv1[][2],double crv2[][2],int ii, int jj,int num,double out[6]);
void collectsameseg(double ptdL[][6],double rL[][6]);
-void intersectcurvesPp(double crv1s[][2],double crv2s[][2],int num,double out[][6]);
-void intersectcurves(double crv1[][2],double crv2[][2],int num,double out[][2]);
+void intersectcurvesPp(double crv1s[][2],double crv2s[][2],int nbez,double out[][6]);
+void intersectcurves(double crv1[][2],double crv2[][2],int nbez,double out[][2]);
const double Inf=99999;
const int Infint=30000;
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlibC/ketlibClog.txt b/Master/texmf-dist/scripts/ketcindy/ketlibC/ketlibClog.txt
new file mode 100644
index 00000000000..414cc1e0346
--- /dev/null
+++ b/Master/texmf-dist/scripts/ketcindy/ketlibC/ketlibClog.txt
@@ -0,0 +1,18 @@
+180613
+ connectseg,connectseg3 changed ( for null data )
+ output3h debugged (case where din1[0][0]==1)
+180609
+ crv3onsfparadata debugged ( case where curve has multi parts)
+ connectseg3 added
+180601
+ wireparadata changed (for cmdflg=1)
+ sfcutparadata changed ( for cmdflg=1)
+180531
+ outputend added
+ output3,output3h changed
+ readoutdata3 changed ( varname added )
+ intersectcrvsf changed (ws added)
+180530
+ readoutdata3 added ( hidden data not included )
+180523
+ crvsfparadata debugged (npar removed)
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h b/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
index d9c0fbdc18c..7f5d9923c9a 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
+++ b/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
@@ -1,19 +1,24 @@
-// 17.06.16 crvsfparadata changed ( num of devision )
+// 180430
+// crv2sfparadata,wireparadata added
+// output3h,output3 chanded
+// 180426 readdataC,writedataC changed
+// 180420 newly rewrited
+// 170616 crvsfparadata changed ( num of devision )
-int output3(const char *var, const char *fname, int level, double out[][3]){
- int nall=floor(out[0][0]+0.5), ndin, din[DsizeM][2],i,j,ctr;
+int output3(short head, const char *wa,const char *var, const char *fname,double out[][3]){
+ int din[DsizeS][2],i,j,ctr;
double tmpd[3];
FILE *fp;
- fp=fopen(fname,"w");
+ fp=fopen(fname,wa);
if (fp == NULL) {
printf("cannot open\n");
return -1;
-// exit(1);
}
- ndin=dataindexd3(level, out,din);
- fprintf(fp,"%s//\n",var); //17.05.29
-// fprintf(fp,"%s3d//\n",var2);
- for(i=1; i<=ndin; i++){
+ dataindexd3(2, out,din);
+ if(head==1){
+ fprintf(fp,"%s//\n",var);
+ }
+ for(i=1; i<=length2i(din); i++){
fprintf(fp,"start//\n");
fprintf(fp,"[");
ctr=0;
@@ -22,32 +27,31 @@ int output3(const char *var, const char *fname, int level, double out[][3]){
fprintf(fp,"[ %7.5f, %7.5f, %7.5f]",tmpd[0],tmpd[1],tmpd[2]);
ctr++;
if(ctr==5){
- fprintf(fp,"]//\n[");
+ fprintf(fp,"]//\n");
ctr=0;
+ if(j<din[i][1]){
+ fprintf(fp,"[");
+ }
}else{
if(j<din[i][1]){
fprintf(fp,",");
+ }else{
+ fprintf(fp,"]//\n");
}
}
}
- fprintf(fp,"]//\n");
- if(i<ndin){
- fprintf(fp,"end//\n");
- }
- else{
- fprintf(fp,"end////\n");
- }
+ fprintf(fp,"end//\n");
}
fclose(fp);
return 0;
}
-int output3h(const char *var, const char *varh, const char *fname, double out[][3]){
+int output3h(const char *wa,const char *var, const char *varh, const char *fname, double out[][3]){
// 17.06.09
double out1[DsizeLL][3], tmpd[3];
int din1[DsizeM][2],din2[DsizeM][2], i, j,ctr;
FILE *fp;
- fp=fopen(fname,"w");
+ fp=fopen(fname,wa);
if (fp == NULL) {
printf("cannot open\n");
return -1;
@@ -81,7 +85,9 @@ int output3h(const char *var, const char *varh, const char *fname, double out[][
}
out1[0][0]=0;
fprintf(fp,"%s//\n",varh); //17.06.16from
- appendd3(0, din1[2][0],din1[2][1],out,out1);
+ if(din1[0][0]>1){ //180613from
+ appendd3(0, din1[2][0],din1[2][1],out,out1);
+ }//180613to
dataindexd3(2, out1,din2);
for(i=1; i<=length2i(din2); i++){
fprintf(fp,"start//\n");
@@ -102,52 +108,54 @@ int output3h(const char *var, const char *varh, const char *fname, double out[][
}
}
fprintf(fp,"]//\n");
-// if(i<ndin2){
- fprintf(fp,"end//\n");
-// }
-// else{
-// fprintf(fp,"end////\n");
-// }
+ fprintf(fp,"end//\n");
}
- fprintf(fp,"//\n");
+// fprintf(fp,"//\n"); //180531
fclose(fp);
return 0;
}
+void outputend(const char *fname){
+ FILE *fp;
+ fp=fopen(fname,"a");
+ fprintf(fp,"//\n");
+ fclose(fp);
+}
+
int writedataC(const char *fname, double out[][3]){
int i, nall;
FILE *fp;
nall=length3(out);
+ printf("123 %d\n",nall);
fp=fopen(fname,"w");
for(i=1; i<=nall; i++){
- fprintf(fp,"%7.5f %7.5f %7.5f\n",out[i][0],out[i][1],out[i][2]);
+ fprintf(fp,"%7.5f %7.5f %7.5f %6s",out[i][0],out[i][1],out[i][2],"-99999");
+ if(i<nall){
+ fprintf(fp,"\n");
+ };
}
- fprintf(fp,"%7.5f %7.5f %7.5f\n",Inf,Inf,Inf);
fclose(fp);
return nall;
}
int readdataC(const char *fname, double data[][3]){
int i, j, ndata=0;
+ double tmpd4[4];
FILE *fp;
fp=fopen(fname,"r");
if(fp==NULL){
printf("file not found\n");
return 1;
}
+ data[0][0]=0;
while( ! feof(fp) && ndata<DsizeL){
- ndata++;
- for(j=0;j<=2;j++){
- fscanf(fp,"%lf",&data[ndata][j]);
- }
- if(data[ndata][1]==Inf){
- ndata--;
- break;
+ for(j=0;j<=3;j++){
+ fscanf(fp,"%lf",&tmpd4[j]);
}
+ push3(tmpd4[0],tmpd4[1],tmpd4[2],data);
}
fclose(fp);
- data[0][0]=ndata;
- return ndata;
+ return length3(data);
}
void parapt(double pt3[3],double pt2[2]){
@@ -160,6 +168,12 @@ void parapt(double pt3[3],double pt2[2]){
}
}
+double zparapt(double p[3]){
+ double x=p[0], y=p[1], z=p[2], out;
+ out=x*cos(PHI)*sin(THETA)+y*sin(PHI)*sin(THETA)+z*cos(THETA);
+ return out;
+}
+
int projpara(double p3[][3], double p2[][2]){
double pt3[3], pt2[2];
int i, nall, nall2;
@@ -198,67 +212,17 @@ double invparapt(double ph, double fh[][2], double fk[][3],double out[3]){
return n+s0;
}
-int surfcurve(short ch,int level, double crv[][2], double pdata[][3]){
- double p2[2], pt[3];
- int i, n, nall;
- n=length2(crv);
+void surfcurve(short ch,double crv[][2], double pdata[][3]){
+ double pd2[2], pt[3];
+ int i;
pdata[0][0]=0;
- for(i=1; i<=n; i++){
- pull2(i,crv,p2);
- surffun(ch,p2[0],p2[1],pt);
- nall=addptd3(pdata,pt);
+ for(i=1; i<=length2(crv); i++){
+ pull2(i,crv,pd2);
+ surffun(ch,pd2[0],pd2[1],pt);
+ addptd3(pdata,pt);
}
- return nall;
}
-int xyzax3data(double x0, double x1, double y0, double y1, double z0, double z1,
- double out[][3]){
- int nall;
- double pd3[10][3];
- out[0][0]=0; nall=0;
- pd3[0][0]=2;
- pd3[1][0]=x0; pd3[1][1]=0; pd3[1][2]=0;
- pd3[2][0]=x1; pd3[2][1]=0; pd3[2][2]=0;
- nall=appendd3(2,1,2,pd3,out);
- pd3[1][0]=0; pd3[1][1]=y0; pd3[1][2]=0;
- pd3[2][0]=0; pd3[2][1]=y1; pd3[2][2]=0;
- nall=appendd3(2,1,2,pd3,out);
- pd3[1][0]=0; pd3[1][1]=0; pd3[1][2]=z0;
- pd3[2][0]=0; pd3[2][1]=0; pd3[2][2]=z1;
- nall=appendd3(2,1,2,pd3,out);
- return nall;
-}
-
-void evlptablepara(short ch){
- int i, j;
- double u,v,u1,u2,v1,v2,pt1[3],pt2[3],pt2d1[2],pt2d2[2],dxu,dyu,dxv,dyv;
- double du=(Urng[1]-Urng[0])/Mdv, dv=(Vrng[1]-Vrng[0])/Ndv;
- double eps=0.00001;
- for (j= 0; j < Ndv+1; j++) {
- v=Vrng[0]+j*dv;
- v1=v-eps/2; v2=v+eps/2;
- for (i = 0; i < Mdv+1; i++) {
- u=Urng[0]+i*du;
- u1=u-eps/2; u2=u+eps/2;
- surffun(ch,u1,v,pt1); parapt(pt1,pt2d1);
- surffun(ch,u2,v,pt2); parapt(pt2,pt2d2);
- dxu=(pt2d2[0]-pt2d1[0])/eps;
- dyu=(pt2d2[1]-pt2d1[1])/eps;
- surffun(ch,u,v1,pt1); parapt(pt1,pt2d1);
- surffun(ch,u,v2,pt2); parapt(pt2,pt2d2);
- dxv=(pt2d2[0]-pt2d1[0])/eps;
- dyv=(pt2d2[1]-pt2d1[1])/eps;
- Zval[j][i]=dxu*dyv-dxv*dyu;
- }
- }
- for (i = 0; i < Mdv+1; i++) {
- Xval[i]=Urng[0]+i*du;
- }
- for (j= 0; j < Ndv+1; j++) {
- Yval[j]=Vrng[0]+j*dv;
- }
-};
-
double evlpfun(short ch, double u, double v){
double u1,u2,v1,v2,pt1[3],pt2[3],pt2d1[2],pt2d2[2],dxu,dyu,dxv,dyv;
double du=(Urng[1]-Urng[0])/Mdv, dv=(Vrng[1]-Vrng[0])/Ndv;
@@ -285,7 +249,7 @@ int envelopedata(short ch, double out[][2]){
double uval1,uval2,vval1,vval2,eval11,eval12,eval21,eval22;
double pl[5][2], vl[5], ql[11][2], out2[DsizeM][2];
double du=(Urng[1]-Urng[0])/Mdv;
- double dv=(Vrng[1]-Vrng[0])/Mdv;
+ double dv=(Vrng[1]-Vrng[0])/Ndv; //180427
ctr=0;
for (j = 0; j < Ndv; j++) {
vval1=Vrng[0]+j*dv;
@@ -351,67 +315,6 @@ int envelopedata(short ch, double out[][2]){
return nall;
}
-/*
-
-int implicitplot(double out[][2]){
- int i, j, k, ctrq=0,ctr, nall;
- double pl[5][2], vl[5], ql[11][2], out2[DsizeM][2];
- ctr=0;
- for (j = 0; j < Ndv; j++) {
- for (i = 0; i < Mdv; i++) {
- pl[0][0]=Xval[i]; pl[0][1]=Yval[j]; vl[0]=Zval[j][i];
- pl[1][0]=Xval[i+1]; pl[1][1]=Yval[j]; vl[1]=Zval[j][i+1];
- pl[2][0]=Xval[i+1]; pl[2][1]=Yval[j+1]; vl[2]=Zval[j+1][i+1];
- pl[3][0]=Xval[i]; pl[3][1]=Yval[j+1]; vl[3]=Zval[j+1][i];
- pl[4][0]=Xval[i]; pl[4][1]=Yval[j]; vl[4]=Zval[j][i];
- ctrq=0;
- for (k = 0; k < 4; k++) {
- if(fabs(vl[k])<=Eps){
- ql[ctrq][0]=pl[k][0];
- ql[ctrq][1]=pl[k][1];
- ctrq++;
- }
- else if(vl[k]>Eps){
- if(vl[k+1]< -Eps){
- ql[ctrq][0]=1/(vl[k]-vl[k+1])*(-vl[k+1]*pl[k][0]+vl[k]*pl[k+1][0]);
- ql[ctrq][1]=1/(vl[k]-vl[k+1])*(-vl[k+1]*pl[k][1]+vl[k]*pl[k+1][1]);
- ctrq++;
- }
- }
- else{
- if(vl[k+1]>Eps){
- ql[ctrq][0]=1/(-vl[k]+vl[k+1])*(vl[k+1]*pl[k][0]-vl[k]*pl[k+1][0]);
- ql[ctrq][1]=1/(-vl[k]+vl[k+1])*(vl[k+1]*pl[k][1]-vl[k]*pl[k+1][1]);
- ctrq++;
- }
- }
- }
- if(ctrq==2){
- if(ctr>0){
- ctr++;
- out[ctr][0]=Inf;
- out[ctr][1]=2; // 2 <- 0 ?
- }
- ctr++;
- out[ctr][0]=ql[0][0];
- out[ctr][1]=ql[0][1];
- ctr++;
- out[ctr][0]=ql[1][0];
- out[ctr][1]=ql[1][1];
- }
- }
- }
- out[0][0]=ctr;
- if(ctr>0){
- nall=connectseg(out, Eps, out2);
- out[0][0]=0;
- nall=appendd2(2,1,nall,out2,out);
- }
- return nall;
-}
-
-*/
-
int cuspsplitpara(short ch,double pdata[][2], double outkL[][3]){
int i, j, ng, n, nd, ndd, ndrop, is, ncusp=0, ncusppt,st, en, npk,nph, cflg;
int cusp[DsizeM], cuspflg;
@@ -508,24 +411,24 @@ int cuspsplitpara(short ch,double pdata[][2], double outkL[][3]){
ntmp=trunc((i+j)*0.5);
i=j;
if(cusp[0]==0){
- ncusp=appendi1(cusp,ntmp);
+ ncusp=appendi1(ntmp,cusp);
}
else{
- ncusp=appendi1(cusp,ntmp);
+ ncusp=appendi1(ntmp,cusp);
}
}
}
}
if(cflg==0){
ncusp=prependi1(1,cusp);
- ncusp=appendi1(cusp,nph);
+ ncusp=appendi1(nph,cusp);
}
else if(ncusp==0){
ncusp=prependi1(1,cusp);
- ncusp=appendi1(cusp,nph);
+ ncusp=appendi1(nph,cusp);
}
else if(cusp[1]==1){
- ncusp=appendi1(cusp,nph);
+ ncusp=appendi1(nph,cusp);
}
else{
ntmp=cusp[1];
@@ -543,7 +446,7 @@ int cuspsplitpara(short ch,double pdata[][2], double outkL[][3]){
for(i=1; i<=cusp[0]; i++){
cusp[i]=cusp[i]-ntmp+1;
}
- ncusp=appendi1(cusp,nph);
+ ncusp=appendi1(nph,cusp);
}
if(ncusp==2){
pull2(nph,pth,tmp);
@@ -579,7 +482,7 @@ int cuspsplitpara(short ch,double pdata[][2], double outkL[][3]){
ntmp=appendd3(0,din[i][0],din[i][1],outkL,tmp3d);
tmpnum[0]=0; ntmpnum=0;
for(j=dind[i][0]; j<=dind[i][1]; j++){
- ntmpnum=appendi1(tmpnum,drop[j]);
+ ntmpnum=appendi1(drop[j],tmpnum);
}
tmp3d1[0][0]=0; ntmp1=0;
for(j=1; j<=ntmpnum; j++){
@@ -639,32 +542,32 @@ int makexybdy(short ch,double ehL[][2]){
}
void partitionseg(double fig[][2],double gL[][2], int ns, double parL[]){
- int ii,jj,kk,n,din[DsizeM][2],din2[DsizeM][2];
+ int ii,jj,kk,n,din[DsizeM][2];
double eps0=pow(10,-5.0),tmpd4[4], tmpd6[6],tmp,tmp2;
double p[2], q[2], pd3[3], ans[4], tmp1d1[DsizeM], tmp2d1[DsizeM];
double other[DsizeM], g[DsizeM][2], kouL[DsizeS][4],kouL6[DsizeS][6];
- if(ns>1){
+ if(ns>0){
dataindexd1(Otherpartition,din);
other[0]=0;
for(ii=din[ns][0]; ii<=din[ns][1]; ii++){
- appendd1(other,Otherpartition[ii]);
+ appendd1(Otherpartition[ii],other);
}
}else{
other[0]=0;
}
parL[0]=0;
- appendd1(parL,1);
- appendd1(parL,length2(fig));
+ appendd1(1,parL);
+ appendd1(length2(fig),parL);
if(length1(other)>0){
for(ii=1; ii<=length1(other); ii++){
- appendd1(parL,other[ii]);
+ appendd1(other[ii],parL);
}
}
dataindexd2(2,gL,din);
- for(n=ns; n<=din[0][0]; n++){
+ for(n=fmax(ns,1); n<=din[0][0]; n++){
g[0][0]=0;
appendd2(2,din[n][0],din[n][1],gL,g);
- intersectcurvesPp(fig,g,20,kouL6);
+ intersectcurvesPp(fig,g,20,kouL6);
kouL[0][0]=0;
for(ii=1;ii<=length6(kouL6);ii++){
pull6(ii,kouL6,tmpd6);
@@ -675,58 +578,42 @@ void partitionseg(double fig[][2],double gL[][2], int ns, double parL[]){
pull4(jj,kouL,tmpd4);
tmp=tmpd4[2];
if((tmp>1+Eps)&&(tmp<length2(fig)-Eps)){
- appendd1(tmp1d1,tmp);
+ appendd1(tmp,tmp1d1);
}
tmp=tmpd4[3];
if((tmp>1+Eps)&&(tmp<length2(g)-Eps)){
- appendd1(tmp2d1,tmp);
+ appendd1(tmp,tmp2d1);
}
}
for(jj=1;jj<=length1(tmp1d1);jj++){
- appendd1(parL,tmp1d1[jj]);
+ appendd1(tmp1d1[jj],parL);
}
if((ns>0)&&(n>ns)&&(length1(tmp2d1)>0)){
dataindexd1(Otherpartition,din);
tmp1d1[0]=0;
- for(ii=1;ii<=length2i(din);ii++){
- if(ii==n){
- for(kk=1;kk<=length1(tmp2d1);kk++){
- appendd1(tmp1d1,tmp2d1[kk]);
- }
- }
- for(jj=din[ii][0]; jj<=din[ii][1];jj++){
- appendd1(tmp1d1,Otherpartition[jj]);
- }
- if(ii<length2i(din)){
- appendd1(tmp1d1,Inf);
- }
- }
- }
- dataindexd1(tmp1d1,din);
- Otherpartition[0]=0;
- for(ii=1;ii<=length2i(din);ii++){
- for(jj=din[ii][0];jj<=din[ii][1];jj++){
- appendd1(Otherpartition,tmp1d1[jj]);
+ for(jj=din[n][0];jj<=din[n][1];jj++){
+ appendd1(Otherpartition[jj],tmp1d1);
}
+ replacelistd1(n,Otherpartition,tmp2d1);
}
}
simplesort(parL);
tmp1d1[0]=0;
for(ii=1;ii<=length1(parL);ii++){
- appendd1(tmp1d1,parL[ii]);
+ appendd1(parL[ii],tmp1d1);
}
parL[0]=0;
tmp2=-1;
for(jj=1;jj<=length1(tmp1d1);jj++){
tmp=tmp1d1[jj];
if(fabs(tmp-tmp2)>Eps1){
- appendd1(parL,tmp);
+ appendd1(tmp,parL);
tmp2=tmp;
}
}
}
-double funpthiddenQ(short ch,double u, double v, double pa[3]){
+double funpthiddenQ(short ch,double u, double v,double pa[3]){
double Vec[3]={sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA)};
double eps0=pow(10,-4.0)*(XMAX-XMIN)/10, pt[3], out;
surffun(ch,u, v, pt);
@@ -739,248 +626,120 @@ double funpthiddenQ(short ch,double u, double v, double pa[3]){
return out;
}
-void makevaltable(double pta[3]){
- double eps0=pow(10,-6.0), u, v, du, dv, p[3];
- int i, j, nx=0, ny=0; ;
- du=(Urng[1]-Urng[0])/Mdv;
- dv=(Vrng[1]-Vrng[0])/Ndv;
- for(j=0; j<=Ndv; j++){
- v=Vrng[0]+j*dv;
- for(i=0; i<=Mdv; i++){
- u=Urng[0]+i*du;
- Zval[j][i]=funpthiddenQ(Ch,u, v, pta);
- }
- }
- for(i=0; i<=Mdv; i++){
- Xval[i]=Urng[0]+i*du;
- }
- for(j=0; j<=Ndv; j++){
- Yval[j]=Vrng[0]+j*dv;
- }
-}
-
-int pthiddenQ(short ch,double pta[3], int uveq, double eps[2]){
- int i, j, k, out, nqL, nsL, nptL, flg, nxt;
+double pthiddenQ(short ch,double pta[3], int uveq){
+ int i, j, k;
double Vec[3]={sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA)};
- double eps0, epspt, vec1[3], po[3]={0,0,0}, tmpd1, tmp1d1, tmp2d1, m1, m2;
- double tmp3d1, tmp4d1, tmp5d1, tmp6d1, tmpd3[3], v1, v2, v3;
- double tmpd2[2], p1[2], p2[2], ptuv[2], puv1[2], puv2[2];
- double p1d3[3], p2d3[3], ptd3[3];
- double ptL[DsizeM][6], sL[DsizeM][7], qL[DsizeM][2], pL[5][2], vL[5];
+ double v1,v2,v3,out=-Inf;
+ double du=(Urng[1]-Urng[0])/Mdv, dv=(Vrng[1]-Vrng[0])/Ndv;
+ double uval1,uval2,vval1,vval2,eval11,eval12,eval21,eval22;
+ double pl[5][2], vl[5], ql[11][2],p1[2],p2[2],m1,m2;
+ double ptuv[2], puv1[2], puv2[2],p1d3[3], p2d3[3], ptd3[3];
+ double tmpd1, tmpd2[2],tmpd3[3],tmp1d3[3];
// Out=1 : hidden
// SL : List of segments near PtA+Vec
- eps0=pow(10,-4.0)*(XMAX-XMIN)/10.0;
- epspt=eps[0]*(XMAX-XMIN)/10.0;
- out=0;
- po[0]=0; po[1]=0; po[2]=0;
- tmpd1=1/dist(3,Vec,po);
- vec1[0]=tmpd1*Vec[0];
- vec1[1]=tmpd1*Vec[1];
- vec1[2]=tmpd1*Vec[2];
- nptL=0;
- makevaltable(pta);
- nsL=0;
for(j=0; j<=Ndv-1; j++){
+ vval1=Vrng[0]+j*dv;
+ vval2=Vrng[0]+(j+1)*dv;
+ uval1=Urng[0];
+ eval11=funpthiddenQ(ch,uval1,vval1,pta);
+ eval12=funpthiddenQ(ch,uval1,vval2,pta);
for(i=0; i<=Mdv-1; i++){
- pL[0][0]=Xval[i]; pL[0][1]=Yval[j]; vL[0]=Zval[j][i];
- pL[1][0]=Xval[i+1]; pL[1][1]=Yval[j]; vL[1]=Zval[j][i+1];
- pL[2][0]=Xval[i+1]; pL[2][1]=Yval[j+1]; vL[2]=Zval[j+1][i+1];
- pL[3][0]=Xval[i]; pL[3][1]=Yval[j+1]; vL[3]=Zval[j+1][i];
- pL[4][0]=Xval[i]; pL[4][1]=Yval[j]; vL[4]=Zval[j][i];
- qL[0][0]=0; nqL=0;
+ uval2=Urng[0]+(i+1)*du;
+ eval21=funpthiddenQ(ch,uval2,vval1,pta);
+ eval22=funpthiddenQ(ch,uval2,vval2,pta);
+ pl[0][0]=uval1; pl[0][1]=vval1; vl[0]=eval11;
+ pl[1][0]=uval2; pl[1][1]=vval1; vl[1]=eval21;
+ pl[2][0]=uval2; pl[2][1]=vval2; vl[2]=eval22;
+ pl[3][0]=uval1; pl[3][1]=vval2; vl[3]=eval12;
+ pl[4][0]=uval1; pl[4][1]=vval1; vl[4]=eval11;
+ ql[0][0]=0;
for(k=0; k<=3; k++){
- p1[0]=pL[k][0]; p1[1]=pL[k][1];
- p2[0]=pL[k+1][0]; p2[1]=pL[k+1][1];
- m1=vL[k]; m2=vL[k+1];
- if((m1>=eps0)&&(m2>=eps0)){
+ pull2(k,pl,p1);
+ pull2(k+1,pl,p2);
+ m1=vl[k]; m2=vl[k+1];
+ if(fabs(m1)<Eps){
+ addptd2(ql, p1);
continue;
}
- if((m1<=-eps0)&&(m2<=-eps0)){
+ if(fabs(m2)<Eps){
continue;
}
- if(fabs(m1)<eps0){
- tmpd2[0]=p1[0]; tmpd2[1]=p1[1];
- }
- else if(fabs(m2)<eps0){
+ if((m1>0)&&(m2>0)){
continue;
}
- else{
- tmpd2[0]=1/(m1-m2)*(-m2*p1[0]+m1*p2[0]);
- tmpd2[1]=1/(m1-m2)*(-m2*p1[1]+m1*p2[1]);
+ if((m1< 0)&&(m2< 0)){
+ continue;
}
- nqL++;
- qL[nqL][0]=tmpd2[0]; qL[nqL][1]=tmpd2[1];
+ tmpd2[0]=1/(m1-m2)*(-m2*p1[0]+m1*p2[0]);
+ tmpd2[1]=1/(m1-m2)*(-m2*p1[1]+m1*p2[1]);
+ addptd2(ql, tmpd2);
}
- if(nqL==2){
- puv1[0]=qL[1][0]; puv1[1]=qL[1][1];
- puv2[0]=qL[2][0]; puv2[1]=qL[2][1];
+ uval1=uval2;
+ eval11=eval21;
+ eval12=eval22;
+ if(length2(ql)==2){
+ puv1[0]=ql[1][0]; puv1[1]=ql[1][1];
+ puv2[0]=ql[2][0]; puv2[1]=ql[2][1];
surffun(ch,puv1[0],puv1[1],p1d3);
surffun(ch,puv2[0],puv2[1],p2d3);
- if(dist(2,p1d3,p2d3)<eps0){
- continue;
- }
- tmp1d1=dist(3,p1d3,pta);
- tmpd3[0]=p1d3[0]-pta[0];
- tmpd3[1]=p1d3[1]-pta[1];
- tmpd3[2]=p1d3[2]-pta[2];
- tmp2d1=dotprod(3,tmpd3,vec1);
- tmp3d1=sqrt(fabs(pow(tmp1d1,2.0)-pow(tmp2d1,2.0)));
- tmp4d1=dist(3,p2d3, pta);
- tmpd3[0]=p2d3[0]-pta[0];
- tmpd3[1]=p2d3[1]-pta[1];
- tmpd3[2]=p2d3[2]-pta[2];
- tmp5d1=dotprod(3,tmpd3,vec1);
- tmp6d1=sqrt(fabs(pow(tmp4d1,2.0)-pow(tmp5d1,2.0)));
- if(tmp2d1<tmp5d1){
- tmpd3[0]=p1d3[0]; tmpd3[1]=p1d3[1]; tmpd3[2]=p1d3[2];
- p1d3[0]=p2d3[0]; p1d3[1]=p2d3[1]; p1d3[2]=p2d3[2];
- p2d3[0]=tmpd3[0]; p2d3[1]=tmpd3[1]; p2d3[2]=tmpd3[2];
- tmpd1=tmp2d1; tmp2d1=tmp5d1; tmp5d1=tmpd1;
- tmpd1=tmp3d1; tmp3d1=tmp6d1; tmp6d1=tmpd1;
- }
- if((tmp3d1<eps[1]*epspt)&&(tmp6d1<eps[1]*epspt)){
- if(tmp2d1>-eps0){
- if(tmp5d1<-eps0){
- nsL++;
- sL[nsL][0]=p1d3[0]; sL[nsL][1]=p1d3[1]; sL[nsL][2]=p1d3[2];
- sL[nsL][3]=p2d3[0]; sL[nsL][4]=p2d3[1]; sL[nsL][5]=p2d3[2];
- sL[nsL][6]=-1;
- }
- else{
- nsL++;
- sL[nsL][0]=p1d3[0]; sL[nsL][1]=p1d3[1]; sL[nsL][2]=p1d3[2];
- sL[nsL][3]=p2d3[0]; sL[nsL][4]=p2d3[1]; sL[nsL][5]=p2d3[2];
- sL[nsL][6]=1;
- }
- }
- }
- v1=vec1[0]; v2=vec1[1]; v3=vec1[2];
- if(fabs(v1)>eps0){
+ v1=Vec[0]; v2=Vec[1]; v3=Vec[2];
+ if(fabs(v1)>Eps){
m1=pta[2]+v3/v1*(p1d3[0]-pta[0])-p1d3[2];
m2=pta[2]+v3/v1*(p2d3[0]-pta[0])-p2d3[2];
- }
- else if(fabs(v2)>eps0){
+ }else if(fabs(v2)>Eps){
m1=pta[2]+v3/v2*(p1d3[1]-pta[1])-p1d3[2];
m2=pta[2]+v3/v2*(p2d3[1]-pta[1])-p2d3[2];
- }
- else{
+ }else{
m1=pta[1]-p1d3[1];
- m2=pta[1]-p2d3[1];
+ m2=pta[1]-p2d3[2];
}
- if(m1*m2>=0){
- if(((m1>eps0)&&(m2>eps0))||((m1<-eps0)&&(m2<-eps0))){
+ if(m1*m2>= 0){
+ if(((m1>0) && (m2>0)) || ((m1< 0) && (m2< 0))){
continue;
}
- if(fabs(m1)<=eps0){
- ptd3[0]=p1d3[0]; ptd3[1]=p1d3[1]; ptd3[2]=p1d3[2];
+ if(m1==0){
+ ptd3[0]=p1d3[0]; ptd3[1]=p1d3[1]; ptd3[2]=p1d3[2];
ptuv[0]=puv1[0]; ptuv[1]=puv1[1];
- }
- else{
- ptd3[0]=p2d3[0]; ptd3[1]=p2d3[1]; ptd3[2]=p2d3[2];
+ }else{
+ ptd3[0]=p2d3[0]; ptd3[1]=p2d3[1]; ptd3[2]=p2d3[2];
ptuv[0]=puv2[0]; ptuv[1]=puv2[1];
}
- }
- else{
+ }else{
ptd3[0]=1/(m1-m2)*(-m2*p1d3[0]+m1*p2d3[0]);
ptd3[1]=1/(m1-m2)*(-m2*p1d3[1]+m1*p2d3[1]);
ptd3[2]=1/(m1-m2)*(-m2*p1d3[2]+m1*p2d3[2]);
- ptuv[0]=1/(m1-m2)*(-m2*puv1[0]+m1*puv2[1]);
+ ptuv[0]=1/(m1-m2)*(-m2*puv1[0]+m1*puv2[0]);
+ ptuv[1]=1/(m1-m2)*(-m2*puv1[1]+m1*puv2[1]);
}
tmpd3[0]=ptd3[0]-pta[0];
- tmpd3[1]=ptd3[1]-pta[1];
+ tmpd3[1]=ptd3[1]-pta[1];
tmpd3[2]=ptd3[2]-pta[2];
- tmp1d1=dotprod(3,tmpd3,vec1);
- tmp2d1=fabs(tmp1d1);
- tmpd3[0]=p1d3[0]-p2d3[0];
- tmpd3[1]=p1d3[1]-p2d3[1];
- tmpd3[2]=p1d3[2]-p2d3[2];
- tmp3d1=dotprod(3,tmpd3,vec1);
- tmp4d1=dist(3,p1d3,p2d3);
- tmp6d1=tmp3d1/tmp4d1;
- if(tmp1d1>eps0){
- if(fabs(tmp6d1)>0.75){
- nptL++;
- ptL[nptL][0]=ptd3[0]; ptL[nptL][1]=ptd3[1]; ptL[nptL][2]=ptd3[2];
- ptL[nptL][3]=p2d3[0]; ptL[nptL][4]=p2d3[1]; ptL[nptL][5]=p2d3[2];
- continue;
- }
- if(tmp2d1>epspt){
- return 1;
- }
- if(tmp2d1<2*epspt){
- continue;
+ crossprod(3,tmpd3,Vec, tmp1d3);
+ if(norm(3,tmp1d3)<Eps1){
+ tmpd1=zparapt(ptd3)-zparapt(pta)-Eps2;
+ if(tmpd1>0){
+ return tmpd1;
+ }else{
+ out=fmax(out,tmpd1);
}
}
}
}
}
- if(nptL==0){
- return 0;
- }
- for(i=1; i<=nsL; i++){
- p2d3[0]=sL[i][3]; p2d3[1]=sL[i][4]; p2d3[2]=sL[i][5];
- flg=0;
- for(j=1; j<=nsL; j++){
- p1d3[0]=sL[j][0]; p1d3[1]=sL[j][1]; p1d3[2]=sL[j][2];
- if(dist(3,p1d3,p2d3)<eps0){
- sL[i][6]=j;
- flg=1;
- break;
- }
- }
- if((flg==0)&&(sL[i][6]>0)){
- sL[i][6]=-2;
- }
- }
- for(i=1; i<=nptL; i++){
- p2d3[0]=ptL[i][3]; p2d3[1]=ptL[i][4]; p2d3[2]=ptL[i][5];
- flg=0;
- for(j=1; j<=nsL; j++){
- p1d3[0]=sL[j][0]; p1d3[1]=sL[j][1]; p1d3[2]=sL[j][2];
- if(dist(3,p1d3,p2d3)<eps0){
- flg=1;
- break;
- }
- }
- if(flg==0){
- ptd3[0]=ptL[i][0]; ptd3[1]=ptL[i][1]; ptd3[2]=ptL[i][2];
- tmpd1=dist(3,p2d3,ptd3);
- tmpd3[0]=p2d3[0]-ptd3[0];
- tmpd3[1]=p2d3[1]-ptd3[1];
- tmpd3[2]=p2d3[2]-ptd3[2];
- tmp1d1=fabs(dotprod(3,tmpd3,vec1));
- tmp2d1=sqrt(fabs(pow(tmpd1,2.0)-pow(tmp1d1,2.0)));
- tmp3d1=tmp2d1*dist(3,ptd3,pta)/tmpd1;
- if(tmp3d1>epspt/5){
- return 1;
- }
- else{
- continue;
- }
- }
- nxt=sL[j][6];
- while(nxt>0){
- ptd3[0]=sL[nxt][3]; ptd3[1]=sL[nxt][4]; ptd3[2]=sL[nxt][5];
- nxt=sL[nxt][6];
- }
- if(nxt==-2){
- return 1;
- }
- else{
- out=0;
- }
- }
return out;
}
-int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]){
- double eps0=pow(10,-5.0), s, p1[2], p2[2], q[2],tmpd1, tmpd2[2], epstmp[2];
- double fh[DsizeM][2], pta[3], ptap[2], vec[3];
+int nohiddenpara2(short ch,double par[], double fk[][3], int uveq, double figkL[][3]){
+ double eps0=pow(10,-4.0), s, p1[2], p2[2], q[2],tmpd1, tmpd2[2],tmp1,tmp2;
+ double paL[DsizeM], fh[DsizeM][2], pta[3], ptap[2], vec[3],flgd;
double figL[DsizeM][2], tmpmd2[DsizeM][2], tmpmd3[DsizeM][3];
double tmp1d2[2], tmp2d2[2], tmp3d2[2], tmpd3[3],tmpd4[4];
double pd2[2], qd2[2], pd3[3], qd3[3], sp, sq, tp, tq, dtmp, dtmp1, dtmp2;
- int ncusp=floor(Cusppt[0][0]+0.5), seL[DsizeM], npaL=floor(paL[0]+0.5);
- int i, n, nfh, nfk, nfigL, nfigkL, nhidden, cspflg, nseL=0, ntmp, flg, tmpi1[DsizeM];
+ int ncusp=floor(Cusppt[0][0]+0.5), seL[DsizeM];
+ int i,j,n, nfh, nfk, cspflg,tmpi1[DsizeM];
+ vec[0]=sin(THETA)*cos(PHI);
+ vec[1]=sin(THETA)*sin(PHI);
+ vec[2]=cos(THETA);
nfk=length3(fk);
nfh=projpara(fk, fh);
pull2(1,fh,p1);
@@ -1007,30 +766,34 @@ int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]){
continue;
}
}
- seL[0]=0; nseL=0;
- for(n=1; n<=npaL-1; n++){
- s=(paL[n]+paL[n+1])/2.0;
- ntmp=invparapt(s,fh,fk, pta);
+ paL[0]=0;
+ tmp2=-1;
+ for(j=1;j<=length1(par)-1;j++){
+ tmp1=par[j];
+ if(fabs(tmp1-tmp2)>Eps){
+ add1(paL,tmp1);
+ tmp2=tmp1;
+ }
+ }
+ tmp1=paL[length1(paL)];
+ tmp2=par[length1(par)];
+ if(fabs(tmp1-tmp2)<Eps){
+ paL[length1(paL)]=tmp2;
+ }else{
+ add1(paL,tmp2);
+ }
+ seL[0]=0;
+ for(n=1; n<=length1(paL)-1; n++){
+ s=(paL[n]+paL[n+1])/2.0;
+ invparapt(s,fh,fk, pta);
parapt(pta,ptap);
- epstmp[0]=Eps1; epstmp[1]=1;
- if((n==1)&&(cspflg % 2==0)){
- pull2(1,fh,p1);
- dtmp=fmin(Eps1*dist(2,ptap, p1),Eps1);
- epstmp[0]=dtmp; epstmp[1]=1;
- }
- if((n==npaL-1)&&(cspflg % 3==0)){
- pull2(nfh,fh,p1);
- dtmp=fmin(Eps1*dist(2, ptap, p1), Eps1);
- epstmp[0]=dtmp; epstmp[1]=1;
- }
- flg=pthiddenQ(Ch,pta, uveq, epstmp);
- if(flg==0){
- nseL=appendi1(seL,n);
+ flgd=pthiddenQ(ch,pta, uveq);
+ if(flgd<=0){ //180518
+ appendi1(n,seL);
}
}
- figL[0][0]=0; nfigL=0;
- figkL[0][0]=0; nfigkL=0;
- for(i=1; i<=nseL; i++){
+ figL[0][0]=0;figkL[0][0]=0;
+ for(i=1; i<=seL[0]; i++){
pointoncurve(paL[seL[i]], fh, Eps, tmp1d2);
pointoncurve(paL[seL[i]+1], fh, Eps, tmp2d2);
if(i==1){
@@ -1045,12 +808,12 @@ int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]){
sq=paL[seL[i]+1];
}
else{
- ntmp=partcrv(sp,sq,fh,tmpmd2);
- nfigL=appendd2(2,1,ntmp,tmpmd2,figL);
+ partcrv(sp,sq,fh,tmpmd2);
+ appendd2(2,1,length2(tmpmd2),tmpmd2,figL);
tp=invparapt(sp,fh,fk, tmpd3);
tq=invparapt(sq,fh,fk,tmpd3);
- ntmp=partcrv3(tp,tq,fk,tmpmd3);
- nfigkL=appendd3(2,1,ntmp,tmpmd3,figkL);
+ partcrv3(tp,tq,fk,tmpmd3);
+ appendd3(2,1,length3(tmpmd3),tmpmd3,figkL);
copyd(0,1,tmp1d2,pd2);
sp=paL[seL[i]];
copyd(0,1,tmp2d2,qd2);
@@ -1058,34 +821,34 @@ int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]){
}
}
}
- if(nseL>0){
+ if(seL[0]>0){
if(dist(2,pd2,qd2)>Eps1){
nearestptpt(pd2,fh,tmpd4);
dtmp1=tmpd4[2];
nearestptpt(qd2,fh,tmpd4);
dtmp2=tmpd4[2];
- ntmp=partcrv(dtmp1,dtmp2,fh,tmpmd2);
- nfigL=appendd2(2,1,ntmp,tmpmd2,figL);
+ partcrv(dtmp1,dtmp2,fh,tmpmd2);
+ appendd2(2,1,length2(tmpmd2),tmpmd2,figL);
tp=invparapt(sp,fh,fk,tmpd3);
tq=invparapt(sq,fh,fk,tmpd3);
- ntmp=partcrv3(tp,tq,fk,tmpmd3);
- nfigkL=appendd3(2,1,ntmp, tmpmd3, figkL);
+ partcrv3(tp,tq,fk,tmpmd3);
+ appendd3(2,1,length3(tmpmd3), tmpmd3, figkL);
}
else{
- nfigL=appendd2(2,1,nfh, fh, figL);
- nfigkL=appendd3(2,1,nfk,fk,figkL);
+ appendd2(2,1,nfh, fh, figL);
+ appendd3(2,1,nfk,fk,figkL);
}
}
- tmpi1[0]=0; ntmp=0;
- for(i=1; i<=npaL-1; i++){
+ tmpi1[0]=0;
+ for(i=1; i<=length1(paL)-1; i++){
if(memberi(i,seL)==0){
- ntmp=appendi1(tmpi1,i);
+ appendi1(i,tmpi1);
}
}
- copyi(0,ntmp,tmpi1,seL);
- seL[0]=ntmp; nseL=ntmp;
- Hiddendata[0][0]=0; nhidden=0;
- for(i=1; i<=nseL; i++){
+ copyi(0,tmpi1[0],tmpi1,seL);
+ seL[0]=tmpi1[0];
+ Hiddendata[0][0]=0;
+ for(i=1; i<=seL[0]; i++){
dtmp=paL[seL[i]];
pointoncurve(dtmp,fh,Eps,tmp1d2);
dtmp=paL[seL[i]+1];
@@ -1104,8 +867,8 @@ int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]){
else{
tp=invparapt(sp,fh,fk,tmpd3);
tq=invparapt(sq,fh,fk,tmpd3);
- ntmp=partcrv3(tp,tq,fk,tmpmd3);
- nhidden=appendd3(2,1,ntmp,tmpmd3,Hiddendata);
+ partcrv3(tp,tq,fk,tmpmd3);
+ appendd3(2,1,length3(tmpmd3),tmpmd3,Hiddendata);
copyd(0,1,tmp1d2,pd2);
sp=paL[seL[i]];
copyd(0,1,tmp2d2,qd2);
@@ -1113,106 +876,108 @@ int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]){
}
}
}
- if(nseL>0){
+ if(seL[0]>0){
if(dist(2,pd2,qd2)>Eps1){
tp=invparapt(sp,fh,fk,tmpd3);
tq=invparapt(sq,fh,fk,tmpd3);
- ntmp=partcrv3(tp,tq,fk,tmpmd3);
- nhidden=appendd3(2,1,ntmp,tmpmd3,Hiddendata);
+ partcrv3(tp,tq,fk,tmpmd3);
+ appendd3(2,1,length3(tmpmd3),tmpmd3,Hiddendata);
}
else{
- nhidden=appendd3(2,1,nfk,fk,Hiddendata);
+ appendd3(2,1,length3(fk),fk,Hiddendata);
}
}
- return nfigkL;
+ return length3(figkL);
}
-int borderparadata(short ch,double fkL[][3], double fsL[][3]){
+void borderparadata(short ch,double fkL[][3], double fsL[][3]){
double ekL[DsizeL][3], fall[DsizeL][2], fbdxy[DsizeL][2];
double tmpd3[DsizeM][3], tmpd2[DsizeM][2], p[2], p3[3];
double figkL[DsizeM][3], du, dv;
- int i, j, nall, nekL, nfsL, nfkL=length3(fkL), nfall, nfbdxy;
- int ndin, din[DsizeS][2], ndin2,din2[DsizeM][2];
- int ntmp, ntmpd3,ntmpd2, npar=0, nfigkL;
+ int i, j;
+ int din[DsizeS][2],din2[DsizeM][2];
+ int ntmp, ntmpd3,ntmpd2;
double par[DsizeM];
du=(Urng[1]-Urng[0])/Mdv;
dv=(Vrng[1]-Vrng[0])/Ndv;
fsL[0][0]=0;
- ekL[0][0]=0; nekL=0;
+ ekL[0][0]=0;;
if(DrawE==1){
- tmpd2[0][0]=0; nall=0;
+ tmpd2[0][0]=0;;
for(j=0; j<=Ndv; j++){
- nall=add2(tmpd2, Urng[1], Vrng[0]+j*dv);
+ add2(tmpd2, Urng[1], Vrng[0]+j*dv);
}
- nall=surfcurve(ch,2, tmpd2,tmpd3);
- nekL=appendd3(2,1,nall,tmpd3,ekL);
+ surfcurve(ch,tmpd2,tmpd3);
+ appendd3(2,1,length3(tmpd3),tmpd3,ekL);
}
if(DrawN==1){
- tmpd2[0][0]=0; nall=0;
+ tmpd2[0][0]=0;
for(j=0; j<=Mdv; j++){
- nall=add2(tmpd2, Urng[0]+j*du, Vrng[1]);
+ add2(tmpd2, Urng[0]+j*du, Vrng[1]);
}
- nall=surfcurve(ch,2, tmpd2,tmpd3);
- nekL=appendd3(2,1,nall,tmpd3,ekL);
+ surfcurve(ch,tmpd2,tmpd3);
+ appendd3(2,1,length3(tmpd3),tmpd3,ekL);
}
if(DrawW==1){
- tmpd2[0][0]=0; nall=0;
+ tmpd2[0][0]=0;
for(j=0; j<=Ndv; j++){
- nall=add2(tmpd2, Urng[0], Vrng[0]+j*dv);
+ add2(tmpd2, Urng[0], Vrng[0]+j*dv);
}
- nall=surfcurve(ch,2, tmpd2,tmpd3);
- nekL=appendd3(2,1,nall,tmpd3,ekL);
+ surfcurve(ch,tmpd2,tmpd3);
+ appendd3(2,1,length3(tmpd3),tmpd3,ekL);
}
if(DrawS==1){
- tmpd2[0][0]=0; nall=0;
+ tmpd2[0][0]=0;
for(j=0; j<=Mdv; j++){
- nall=add2(tmpd2, Urng[0]+j*du, Vrng[0]);
+ add2(tmpd2, Urng[0]+j*du, Vrng[0]);
}
- nall=surfcurve(ch,2, tmpd2,tmpd3);
- nekL=appendd3(2,1,nall,tmpd3,ekL);
+ surfcurve(ch,tmpd2,tmpd3);
+ appendd3(2,1,length3(tmpd3),tmpd3,ekL);
}
- if(nekL>0){
- nfkL=appendd3(2,1,nekL,ekL,fkL);
+ if(length3(ekL)>0){
+ appendd3(2,1,length3(ekL),ekL,fkL);
}
- nfall=projpara(fkL,fall);
- nfbdxy=makexybdy(ch,fbdxy);
- ndin=dataindexd2(2,fall,din);
+ projpara(fkL,fall);
+ makexybdy(ch,fbdxy);
+ dataindexd2(2,fall,din);
Borderpt[0][0]=0;
Otherpartition[0]=0;
- for(i=1; i<=ndin-1; i++){
+ for(i=1; i<=length2i(din)-1; i++){
Otherpartition[i]=Inf; Otherpartition[0]++;
}
Borderhiddendata[0][0]=0;
- ndin2=dataindexd3(2,fkL,din2);
- for(i=1; i<= ndin2; i++){
+ dataindexd3(2,fkL,din2);
+ for(i=1; i<= length2i(din2); i++){
tmpd3[0][0]=0;
- ntmpd3=appendd3(0,din2[i][0],din2[i][1],fkL,tmpd3);
- ntmpd2=projpara(tmpd3,tmpd2);
- partitionseg(tmpd2,fall, 1,par);
+ appendd3(0,din2[i][0],din2[i][1],fkL,tmpd3);
+ projpara(tmpd3,tmpd2);
+ partitionseg(tmpd2,fall,0,par);
+/*
if(length1(par)>2){
- ntmp=npar-1;
- tmpd2[0][0]=0; ntmpd2=0;
+ ntmp=length1(par)-1;
+ tmpd2[0][0]=0;
for(j=2; j<=ntmp; j++){
pull2(j,Partitionpt,p);
- ntmpd2=addptd2(tmpd2, p);
+ addptd2(tmpd2, p);
}
- ntmp=appendd2(0, 1,ntmpd2,tmpd2,Borderpt);
+ appendd2(0, 1,length2(tmpd2),tmpd2,Borderpt);
}
- tmpd3[0][0]=0;
- for(j=din2[i][0]; j<=din2[i][1]; j++){
- pull3(j,fkL,p3);
- ntmpd3=addptd3(tmpd3,p3);
- }
- nfigkL=nohiddenpara2(par,tmpd3,1, figkL);
- if(nfigkL>0){
- nfsL=appendd3(2,1,nfigkL,figkL, fsL);
+*/
+ tmpd3[0][0]=0;
+ appendd3(0,din2[i][0],din2[i][1],fkL,tmpd3);
+// for(j=din2[i][0]; j<=din2[i][1]; j++){
+// pull3(j,fkL,p3);
+// addptd3(tmpd3,p3);
+// }
+ nohiddenpara2(ch,par,tmpd3,1, figkL);
+ if(length3(figkL)>0){
+ appendd3(2,1,length3(figkL),figkL, fsL);
}
- ntmp=length3(Hiddendata);
+ ntmp=length3(Hiddendata);
if(ntmp>0){
appendd3(2,1,ntmp,Hiddendata,Borderhiddendata);
}
}
- return nfsL;
}
int dropnumlistcrv3(double qd[][3], double eps1, int out[]){
@@ -1226,48 +991,47 @@ int dropnumlistcrv3(double qd[][3], double eps1, int out[]){
pd[0][0]=0; npd=0;
npd=appendd3(0,se,en,qd,pd);
ptL[0]=0; nptL=0;
- nptL=appendi1(ptL,1);
+ nptL=appendi1(1,ptL);
pull3(1,pd,p);
for(k=2; k<=npd-1; k++){
pull3(k,pd,tmp2d);
if(dist(3,p,tmp2d)>eps1){
- nptL=appendi1(ptL,k);
+ nptL=appendi1(k,ptL);
pull3(k,pd,p);
}
}
pull3(npd-1,pd,p);
pull3(npd,pd,tmp2d);
if(dist(3,p,tmp2d)>eps){ // eps -> eps1 ?
- nptL=appendi1(ptL,npd);
+ nptL=appendi1(npd,ptL);
}
-// if(nptL==1){ptL[0]=0; nptL=0;}//180318db
if(nout>0){
- nout=appendi1(out,Infint);
+ nout=appendi1(Infint,out);
}
for(i=1; i<=nptL; i++){
- nout=appendi1(out,ptL[i]);
+ nout=appendi1(ptL[i],out);
}
}
out[0]=nout;
return nout;
}
-int sfbdparadata(short ch,double outd3[][3]){
+void sfbdparadata(short ch,double outd3[][3]){
double pdatad3[DsizeL][3];
double pts[DsizeL][2],out3md[DsizeL][2],eps;
double tmpmd[DsizeL][2],tmp1md[DsizeL][2],tmp2md[DsizeL][2],tmp3md[DsizeL][2];
double tmpd[2],tmp1d[2],tmpd3[3],tmp1d3[3],tmp2d3[3],tmp2md3[DsizeL][3];
int din[DsizeS][2],nlist[DsizeL];
int ii,jj,kk,n,nall,flg;
- envelopedata(ch, tmp3md);
- out3md[0][0]=0;
+ envelopedata(ch, out3md); //180517from
+ tmp3md[0][0]=0;
pts[0][0]=0;
- dataindexd2(2,tmp3md,din);
+ dataindexd2(2,out3md,din);
for(jj=1;jj<=length2i(din);jj++){
tmp1md[0][0]=0;
tmp2md3[0][0]=0;
for(kk=din[jj][0];kk<=din[jj][1];kk++){
- pull2(kk,tmp3md,tmpd);
+ pull2(kk,out3md,tmpd);
addptd2(tmp1md,tmpd);
surffun(ch,tmpd[0],tmpd[1],tmpd3);
addptd3(tmp2md3,tmpd3);
@@ -1283,12 +1047,14 @@ int sfbdparadata(short ch,double outd3[][3]){
addptd2(tmpmd,tmpd);
}
if(length2(tmpmd)>0){
- appendd2(2,1,length2(tmpmd),tmpmd,out3md);
+ appendd2(2,1,length2(tmpmd),tmpmd,tmp3md);
}
- }
+ }
}
+ out3md[0][0]=0;
+ appendd2(0,1,length2(tmp3md),tmp3md,out3md);
tmp3md[0][0]=0;
- appendd2(2,1,length2(pts),pts,tmp3md);
+ appendd2(0,1,length2(pts),pts,tmp3md);
pts[0][0]=0;
for(ii=1;ii<=length2(tmp3md);ii++){
pull2(ii,tmp3md,tmpd);
@@ -1307,17 +1073,12 @@ int sfbdparadata(short ch,double outd3[][3]){
}
}
for(ii=1;ii<=length2(pts);ii++){
- tmp3md[0][0]=0;
- appendd2(2,1,length2(out3md),out3md,tmp3md);
- out3md[0][0]=0;
pull2(ii,pts,tmpd);
surffun(ch,tmpd[0],tmpd[1],tmp1d3);
- dataindexd2(2,tmp3md,din);
+ dataindexd2(2,out3md,din);
for(jj=1;jj<=length2i(din);jj++){
tmp2md[0][0]=0;
- appendd2(2,din[jj][0],din[jj][1],tmp3md,tmp2md);
- pull2(jj,tmp3md,tmpd);
- surffun(ch,tmpd[0],tmpd[1],tmp2d3);
+ appendd2(0,din[jj][0],din[jj][1],out3md,tmp2md);
eps=1;
for(kk=1;kk<=length2(tmp2md)-1;kk++){
pull2(kk,tmp2md,tmpd);
@@ -1331,404 +1092,557 @@ int sfbdparadata(short ch,double outd3[][3]){
pull2(1,tmp2md,tmpd);
surffun(ch,tmpd[0],tmpd[1],tmpd3);
if(dist(3,tmp1d3,tmpd3)<eps+Eps){
- appendd2(2,ii,ii,pts,out3md);
- for(kk=1;kk<=length2(tmp2md);kk++){
- pull2(kk,tmp2md,tmpd);
- addptd2(out3md,tmpd);
- }
+ prependd2(ii,ii,pts,tmp2md);
+ replacelistd2(2,jj,out3md,tmp2md);
+ dataindexd2(2,out3md,din);//180517
continue;
}
pull2(length2(tmp2md),tmp2md,tmpd);
surffun(ch,tmpd[0],tmpd[1],tmpd3);
if(dist(3,tmp1d3,tmpd3)<eps+Eps){
- appendd2(2,1,length2(tmp2md),tmp2md,out3md);
- pull2(ii,pts,tmpd);
- addptd2(out3md,tmpd);
+ appendd2(0,ii,ii,pts,tmp2md);
+ replacelistd2(2,jj,out3md,tmp2md);
+ dataindexd2(2,out3md,din);//180517
continue;
}
}
- appendd2(2,1,length2(tmp2md),tmp2md,out3md);
}
nall=cuspsplitpara(ch,out3md, pdatad3);
n=length2(Cuspsplitpt);
Cusppt[0][0]=0;
nall=appendd2(0, 1,n,Cuspsplitpt,Cusppt);
- nall= borderparadata(ch,pdatad3, outd3);
+ borderparadata(ch,pdatad3, outd3);
push3(Inf,3,0,outd3);
nall=appendd3(0,1,length3(Borderhiddendata),Borderhiddendata,outd3);
push3(Inf,3,0,outd3);
- return nall;
}
-void makevaltablemeet(short ch,double pa[3], double vec[3], double eps0){
- double u, v, du, dv, pt[3];
- int i, j;
- du=(Urng[1]-Urng[0])/Mdv;
- dv=(Vrng[1]-Vrng[0])/Ndv;
- for(j=0; j<=Ndv; j++){
- v=Vrng[0]+j*dv;
- for(i=0; i<=Mdv; i++){
- u=Urng[0]+i*du;
- surffun(ch,u, v, pt);
- if((fabs(vec[1])>eps0)||(fabs(vec[0])>eps0)){
- Zval[j][i]=(vec[1]*(pt[0]-pa[0])-vec[0]*(pt[1]-pa[1]));
+void groupnearpt3(double qlist[][3],double plist[][3]){
+// 180428
+ int ii,jj,flg,din[DsizeS][2];
+ double p1[3],p2[3],gl[DsizeS][3];
+ while(length3(qlist)>0){
+ gl[0][0]=0;
+ appendd3(2,1,1,qlist,gl);
+ removed3(1,qlist);
+ for(ii=1;ii<=length3(qlist);ii++){
+ flg=0;
+ pull3(ii,qlist,p1);
+ for(jj=1;jj<=length3(gl);jj++){
+ pull3(jj,gl,p2);
+ if(dist(3,p1,p2)<Eps1){
+ flg=1;
+ break;
+ }
}
- else{
- Zval[j][i]=pt[0]-pa[0];
+ if(flg==1){
+ addptd3(gl,p1);
+ removed3(ii,qlist);
}
}
+ appendd3(2,1,length3(gl),gl,plist);
}
- for(i=0; i<=Mdv; i++){
- Xval[i]=Urng[0]+i*du;
- }
- for(j=0; j<=Ndv; j++){
- Yval[j]=Vrng[0]+j*dv;
+}
+
+double funmeet(short ch,double u, double v,double pa[3], double vec[3]){
+ double pt[3], out;
+ surffun(ch,u, v, pt);
+ if((fabs(vec[1])>Eps)||(fabs(vec[0])>Eps)){
+ out=(vec[1]*(pt[0]-pa[0])-vec[0]*(pt[1]-pa[1]));
+ }else{
+ out=pt[0];
}
+ return out;
}
-int meetpoints(short ch,double pta[3], double ptb[3], double eps, double ptL[][3]){
- double eps0=pow(10,-4.0), vec[3], out[DsizeM], pL[5][2], vL[5];
- double qL[DsizeM][2], p1d2[2], p2d2[2], tmpd2[2], puv1d2[2], puv2d2[2];
- double m1,m2, p1d3[3], p2d3[3], v1, v2, v3, ptd3[3], ptuvd2[2], tmp1d1;
- double po[3]={0,0,0}, tmpmd1[DsizeM], tmp1d3[3];
- int nout, nptL, ntmp, nqL, i, j, k;
- vec[0]=ptb[0]-pta[0]; vec[1]=ptb[1]-pta[1]; vec[2]=ptb[2]-pta[2];
- out[0]=0; nout=0;
- ptL[0][0]=0; nptL=0;
- makevaltablemeet(Ch,pta,vec,eps0);
- for(j=0; j<=Ndv-2; j++){
- for(i=0; i<=Mdv-2; i++){
- pL[0][0]=Xval[i]; pL[0][1]=Yval[j]; vL[0]=Zval[j][i];
- pL[1][0]=Xval[i+1]; pL[1][1]=Yval[j]; vL[1]=Zval[j][i+1];
- pL[2][0]=Xval[i+1]; pL[2][1]=Yval[j+1]; vL[2]=Zval[j+1][i+1];
- pL[3][0]=Xval[i]; pL[3][1]=Yval[j+1]; vL[3]=Zval[j+1][i];
- pL[4][0]=Xval[i]; pL[4][1]=Yval[j]; vL[4]=Zval[j][i];
- qL[0][0]=0; nqL=0;
+void meetpoints(short ch,double pta[3], double ptb[3], int uveq,double out[][3]){
+ int i, j, k,flg,din[DsizeS][2];
+ double vec[3],v1,v2,v3;
+ double du=(Urng[1]-Urng[0])/Mdv, dv=(Vrng[1]-Vrng[0])/Ndv;
+ double uval1,uval2,vval1,vval2,eval11,eval12,eval21,eval22;
+ double pl[5][2], vl[5], ql[11][2],p1[2],p2[2],m1,m2;
+ double ptuv[2], puv1[2], puv2[2],p1d3[3], p2d3[3], ptd3[3];
+ double tmpd1, tmpd2[2],tmpd3[3],tmp1d3[3],tmp1md3[DsizeS][3];
+ vec[0]=ptb[0]-pta[0]; vec[1]=ptb[1]-pta[1]; vec[2]=ptb[2]-pta[2];
+ out[0][0]=0;
+ if(norm(3,vec)<Eps){
+ return;
+ }
+ for(j=0; j<=Ndv-1; j++){
+ vval1=Vrng[0]+j*dv;
+ vval2=Vrng[0]+(j+1)*dv;
+ uval1=Urng[0];
+ eval11=funmeet(ch,uval1,vval1,pta,vec);
+ eval12=funmeet(ch,uval1,vval2,pta,vec);
+ for(i=0; i<=Mdv-1; i++){
+ uval2=Urng[0]+(i+1)*du;
+ eval21=funmeet(ch,uval2,vval1,pta,vec);
+ eval22=funmeet(ch,uval2,vval2,pta,vec);
+ pl[0][0]=uval1; pl[0][1]=vval1; vl[0]=eval11;
+ pl[1][0]=uval2; pl[1][1]=vval1; vl[1]=eval21;
+ pl[2][0]=uval2; pl[2][1]=vval2; vl[2]=eval22;
+ pl[3][0]=uval1; pl[3][1]=vval2; vl[3]=eval12;
+ pl[4][0]=uval1; pl[4][1]=vval1; vl[4]=eval11;
+ ql[0][0]=0;
for(k=0; k<=3; k++){
- pull2(k,pL,p1d2);
- pull2(k+1,pL,p2d2);
- m1=vL[k]; m2=vL[k+1];
- if((m1>=eps0)&&(m2>=eps0)){
+ pull2(k,pl,p1);
+ pull2(k+1,pl,p2);
+ m1=vl[k]; m2=vl[k+1];
+ if(fabs(m1)<Eps){
+ addptd2(ql, p1);
continue;
}
- if((m1<=-eps0)&&(m2<=-eps0)){
+ if(fabs(m2)<Eps){
continue;
}
- if(fabs(m1)<eps0){
- copyd(0,1,p1d2,tmpd2);
- }
- else if(fabs(m2)<eps0){
+ if((m1>0)&&(m2>0)){
continue;
}
- else{
- tmpd2[0]=1/(m1-m2)*(-m2*p1d2[0]+m1*p2d2[0]);
- tmpd2[1]=1/(m1-m2)*(-m2*p1d2[1]+m1*p2d2[1]);
+ if((m1< 0)&&(m2< 0)){
+ continue;
}
- nqL=addptd2(qL,tmpd2);
+ tmpd2[0]=1/(m1-m2)*(-m2*p1[0]+m1*p2[0]);
+ tmpd2[1]=1/(m1-m2)*(-m2*p1[1]+m1*p2[1]);
+ addptd2(ql, tmpd2);
}
- if(nqL==2){
- pull2(1, qL, puv1d2);
- pull2(2, qL, puv2d2);
- surffun(ch,puv1d2[0], puv1d2[1], p1d3);
- surffun(ch,puv2d2[0], puv2d2[1], p2d3);
+ uval1=uval2;
+ eval11=eval21;
+ eval12=eval22;
+ if(length2(ql)==2){
+ puv1[0]=ql[1][0]; puv1[1]=ql[1][1];
+ puv2[0]=ql[2][0]; puv2[1]=ql[2][1];
+ surffun(ch,puv1[0],puv1[1],p1d3);
+ surffun(ch,puv2[0],puv2[1],p2d3);
v1=vec[0]; v2=vec[1]; v3=vec[2];
- if(fabs(v1)>eps0){
+ if(fabs(v1)>Eps){
m1=pta[2]+v3/v1*(p1d3[0]-pta[0])-p1d3[2];
m2=pta[2]+v3/v1*(p2d3[0]-pta[0])-p2d3[2];
- }
- else if(fabs(v2)>eps0){
+ }else if(fabs(v2)>Eps){
m1=pta[2]+v3/v2*(p1d3[1]-pta[1])-p1d3[2];
m2=pta[2]+v3/v2*(p2d3[1]-pta[1])-p2d3[2];
- }
- else{
+ }else{
m1=pta[1]-p1d3[1];
- m2=pta[1]-p2d3[1];
+ m2=pta[1]-p2d3[2];
}
- if(m1*m2>=-eps0){
- if(((m1>eps0)&&(m2>eps0)) || ((m1<-eps0)&&(m2<-eps0))){
+ if(m1*m2>= 0){
+ if(((m1>0) && (m2>0)) || ((m1< 0) && (m2< 0))){
continue;
}
- if(fabs(m1)<=eps0){
- copyd(0,2,p1d3,ptd3);
- copyd(0,1,puv1d2,ptuvd2);
- }
- else{
- copyd(0,2,p2d3,ptd3);
- copyd(0,1,puv2d2,ptuvd2);
+ if(m1==0){
+ ptd3[0]=p1d3[0]; ptd3[1]=p1d3[1]; ptd3[2]=p1d3[2];
+ ptuv[0]=puv1[0]; ptuv[1]=puv1[1];
+ }else{
+ ptd3[0]=p2d3[0]; ptd3[1]=p2d3[1]; ptd3[2]=p2d3[2];
+ ptuv[0]=puv2[0]; ptuv[1]=puv2[1];
}
- }
- else{
+ }else{
ptd3[0]=1/(m1-m2)*(-m2*p1d3[0]+m1*p2d3[0]);
ptd3[1]=1/(m1-m2)*(-m2*p1d3[1]+m1*p2d3[1]);
ptd3[2]=1/(m1-m2)*(-m2*p1d3[2]+m1*p2d3[2]);
+ ptuv[0]=1/(m1-m2)*(-m2*puv1[0]+m1*puv2[0]);
+ ptuv[1]=1/(m1-m2)*(-m2*puv1[1]+m1*puv2[1]);
}
- tmp1d3[0]=ptd3[0]-pta[0]; tmp1d3[1]=ptd3[1]-pta[1];
- tmp1d3[2]=ptd3[2]-pta[2];
- tmp1d1=dotprod(3,tmp1d3,vec);
- tmp1d1=tmp1d1/pow(dist(3,vec,po),2.0);
- if((tmp1d1>-eps0)&&(tmp1d1<1+eps0)){
- nout=appendd1(out,tmp1d1);
+ tmpd3[0]=ptd3[0]-pta[0];
+ tmpd3[1]=ptd3[1]-pta[1];
+ tmpd3[2]=ptd3[2]-pta[2];
+ crossprod(3,tmpd3,vec, tmp1d3);
+ if(norm(3,tmp1d3)<Eps1){
+ tmpd1=dotprod(3,tmpd3,vec);
+ if((tmpd1>-Eps)&&(norm(3,tmpd3)<norm(3,vec)+Eps)){
+ if(length3(out)==0){
+ addptd3(out,ptd3);
+ }else{
+ pull3(length3(out),out,p1d3);
+ if(dist(3,p1d3,ptd3)>Eps){
+ addptd3(out,ptd3);
+ }
+ }
+ }
}
}
}
}
- if(nout>>0){
- simplesort(out);
- tmpmd1[1]=out[1]; ntmp=1;
- for(i=2; i<=nout; i++){
- tmp1d3[0]=(out[i]-tmpmd1[ntmp])*vec[0];
- tmp1d3[1]=(out[i]-tmpmd1[ntmp])*vec[1];
- tmp1d3[2]=(out[i]-tmpmd1[ntmp])*vec[2];
- tmp1d1=dist(3,tmp1d3,po);
- if(tmp1d1>eps){
- ntmp=appendd1(tmpmd1,out[i]);
- }
- }
- nout=ntmp;
- copyd(0,ntmp,tmpmd1,out);
- for(i=1; i<=nout; i++){
- tmp1d3[0]=pta[0]+out[i]*vec[0];
- tmp1d3[1]=pta[1]+out[i]*vec[1];
- tmp1d3[2]=pta[2]+out[i]*vec[2];
- nptL=addptd3(ptL,tmp1d3);
+ tmp1md3[0][0]=0;
+ groupnearpt3(out,tmp1md3);
+ dataindexd3(2,tmp1md3,din);
+ out[0][0]=0;
+ for(i=1;i<=din[0][0];i++){
+ p1d3[0]=0; p1d3[1]=0; p1d3[2]=0;
+ tmpd1=din[i][1]-din[i][0]+1;
+ for(j=din[i][0];j<=din[i][1];j++){
+ p1d3[0]=p1d3[0]+tmp1md3[j][0]/tmpd1;
+ p1d3[1]=p1d3[1]+tmp1md3[j][1]/tmpd1;
+ p1d3[2]=p1d3[2]+tmp1md3[j][2]/tmpd1;
}
+ addptd3(out,p1d3);
}
- return nptL;
}
-int crvsfparadata(double fkL[][3], double fbdkL[][3], int sepflg, double out[][3]){
- double fbdy[DsizeL][2], fk[DsizeM][3],fkp[DsizeM][3], outh[DsizeL][3];
+void crvsfparadata(short ch, double fkL[][3], double fbdkL[][3], int sepflg, double out[][3]){
+ double fbdy[DsizeL][2], fk[DsizeM][3],outh[DsizeL][3];
+// double fkp[DsizeM][3], dt;
double fh[DsizeM][2], parL[DsizeM], tmpmd3[DsizeM][3];
- double ptL[DsizeM][3], tmpd2[2], tmpd3[3], tmp1d1, tmp2d1, dt;
+ double ptL[DsizeM][3], tmpd2[2], tmpd3[3], tmp1d1, tmp2d1;
double po[2]={0,0}, epsd2[2]={Eps1,1}, pa[3], pb[3];
- int nbor=length3(Borderhiddendata), nfkL,nfbdkL, nfbdy, nfk, nall;
- int ncshidden, npar, ndin, din[DsizeM][2], ndin2,din2[DsizeS][2];
- int nn, i, j, k, n, nptL, nout;
- nfkL=length3(fkL);
- nfbdy=projpara(fbdkL,fbdy);
+ int nbor=length3(Borderhiddendata);
+ int ncshidden,din[DsizeM][2],din2[DsizeS][2];
+ int nn, i, j, k, n;
+ projpara(fbdkL,fbdy);
out[0][0]=0;
outh[0][0]=0;
- ndin=dataindexd3(2,fkL,din);
- for(nn=1; nn<=ndin; nn++){
- fkp[0][0]=0;
- nfk=appendd3(0,din[nn][0],din[nn][1],fkL,fkp);
- n=fmax(1,floor((fmax(Mdv,Ndv)+1)/(nfk-1)+0.5)); //17.06.16
- dt=1.0/n;
- fk[0][0]=0;
- for(i=1; i<nfk; i++){
- for(j=0; j<n; j++){
- tmpd3[0]=fkp[i][0]+(fkp[i+1][0]-fkp[i][0])*j*dt;
- tmpd3[1]=fkp[i][1]+(fkp[i+1][1]-fkp[i][1])*j*dt;
- tmpd3[2]=fkp[i][2]+(fkp[i+1][2]-fkp[i][2])*j*dt;
- addptd3(fk,tmpd3);
- }
- }
- nfk=appendd3(0,nfk,nfk,fkp,fk);
- nall=projpara(fk,fh);
- partitionseg(fh, fbdy,1, parL);
- if(sepflg>=0){
- for(i=1; i<=nfk-1; i++){
+ dataindexd3(2,fkL,din);
+ for(nn=1; nn<=length2i(din); nn++){
+ fk[0][0]=0;
+ appendd3(0,din[nn][0],din[nn][1],fkL,fk);
+ projpara(fk,fh);
+ partitionseg(fh,fbdy,0,parL);
+ if(sepflg==0){ //180522
+ for(i=1; i<=length3(fk)-1; i++){
pull3(i,fk,pa);
pull3(i+1,fk,pb);
- nptL=meetpoints(Ch,pa,pb, Eps2,ptL);
- for(j=1; j<=nptL; j++){
- pull3(j,ptL,tmpd3);
+ meetpoints(ch,pa,pb,1,ptL);
+ for(j=1; j<=length3(ptL); j++){
+ pull3(j,ptL,tmpd3);
parapt(tmpd3,tmpd2);
tmp1d1=paramoncurve(tmpd2,i,fh);
tmp2d1=Inf;
- for(k=1; k<=npar; k++){
+ for(k=1; k<=length1(parL); k++){
tmp2d1=fmin(tmp2d1,fabs(parL[k]-tmp1d1));
}
tmpd3[0]=pb[0]-pa[0]; tmpd3[1]=pb[1]-pa[1];
tmpd3[2]=pb[2]-pa[2];
if(tmp2d1*dist(3,tmpd3,po)>Eps1){
- npar=appendd1(parL,tmp1d1);
+ appendd1(tmp1d1,parL);
}
}
simplesort(parL);
}
}
- nohiddenpara2(parL,fk,1, tmpmd3);
+ nohiddenpara2(ch,parL,fk,1, tmpmd3);
appendd3(2,1,length3(tmpmd3),tmpmd3,out);
appendd3(2,1, length3(Hiddendata),Hiddendata,outh);
}
push3(Inf,3,0,out); //17.06.17
- nout=appendd3(0,1,length3(outh),outh,out);
- push3(Inf,3,0,out); //17.06.17
- return nout;
+ appendd3(0,1,length3(outh),outh,out);
}
-int wireparadata(double bdyk[][3], double udv[], double vdv[], int num,
- double fsL[][3]){
- double fbdy[DsizeL][2], udiv[DsizeM], vdiv[DsizeM], fbdxy[DsizeM][2];
- double fs[DsizeL][3], u, v, d, pdata[DsizeM][3], fkL[DsizeM][3];
- double fsLh[DsizeLL][3];
- double tmpmd2[DsizeM][2], fk[DsizeM][3], par[DsizeM], p[2];
- int nfbdy, nd, i, j, k, n, nu, nv, nfbdxy, nfsL, npdata, nfkL, nfk, npar,ntmp;
- int nwire, ndin, din[DsizeM][2], nfs, ndin2, din2[DsizeM][2];
- nfbdy=projpara(bdyk, fbdy);
- Wirept[0][0]=0;
- udiv[0]=0; nu=0;
- vdiv[0]=0; nv=0;
- n=floor(udv[0]+0.5);
- if(n==-1){
- nd=floor(udv[1]+0.5);
- d=(Urng[1]-Urng[0])/(nd+1);
- for(i=1; i<=nd; i++){
- u=Urng[0]+i*d;
- nu=appendd1(udiv,u);
+void crv3onsfparadata(short ch,double fk[][3], double fbdyd3[][3], double out[][3]){
+ // 180609 debugged(renewed)
+ double fbdy[DsizeL][2],fh[DsizeL][2],fks[DsizeL][3],fhs[DsizeL][2],par[DsizeM];
+ double tmpmd3[DsizeL][3],outh[DsizeL][3];
+ int i,j,din[DsizeS][2];
+ projpara(fbdyd3,fbdy);
+ projpara(fk,fh);
+ out[0][0]=0;
+ outh[0][0]=0;
+ dataindexd2(2,fh,din);
+ for(i=1;i<=din[0][0];i++){
+ fhs[0][0]=0; fks[0][0]=0;
+ appendd2(0,din[i][0],din[i][1],fh,fhs);
+ appendd3(0,din[i][0],din[i][1],fk,fks);
+ tmpmd3[0][0]=0;
+ if(length2(fhs)>1){
+ partitionseg(fhs,fbdy,0, par);
+ nohiddenpara2(ch,par,fks,1,tmpmd3);
+ appendd3(2,1,length3(tmpmd3),tmpmd3,out);
+ appendd3(2,1,length3(Hiddendata),Hiddendata,outh);
+ }else{
+ appendd3(2,1,1,fks,out);
}
}
- else{
- for(i=1; i<=n; i++){
- nu=appendd1(udiv,udv[i]);
- }
+ connectseg3(out, Eps1,tmpmd3);
+ out[0][0]=0;
+ appendd3(0,1,length3(tmpmd3),tmpmd3,out);
+ connectseg3(outh, Eps1,tmpmd3);
+ appendd3(3,1,length3(tmpmd3),tmpmd3,out);
+}
+
+void crv2onsfparadata(short ch,double fh[][2], double fbdyd3[][3], double out[][3]){
+ double fk[DsizeL][3];
+ surfcurve(ch,fh,fk);
+ crv3onsfparadata(ch,fk,fbdyd3,out);
+}
+
+void wireparadata(short ch,double bdyk[][3], double udata[], double vdata[],const char *fname,const char *fnameh){
+ double crv2d[DsizeL][2],out[DsizeL][3],out1[DsizeL][3],out2[DsizeL][3];
+ double du=(Urng[1]-Urng[0])/Mdv;
+ double dv=(Vrng[1]-Vrng[0])/Ndv;
+ int i,j,din[DsizeS][2];
+ short allflg=0;
+ if(strlen(fnameh)==0){
+ allflg=1;
+ }
+ char var[20]="wire3d";
+ char varh[20]="wireh3d";
+ char varnow[20]={'\0'};
+ char varhnow[20]={'\0'};
+ sprintf(var,"%s%d",var,ch);
+ sprintf(varh,"%s%d",varh,ch);
+ char dirfname[256] = {'\0'};
+ char dirfnameh[256] = {'\0'};
+ char varname[256] = {'\0'};
+ char varnameh[256] = {'\0'};
+ sprintf(varname,"%s%d",var,ch);
+ sprintf(varnameh,"%s%d",varh,ch);
+ sprintf(dirfname,"%s%s",Dirname,fname);
+ sprintf(dirfnameh,"%s%s",Dirname,fnameh);
+ if((length1(udata)==0)&&(allflg==0)){
+ out[0][0]=0;
+ output3(1,"w",varname,dirfname,out);
+ output3(1,"w",varnameh,dirfnameh,out);
}
- n=floor(vdv[0]+0.5);
- if(n==-1){
- nd=floor(vdv[1]+0.5);
- d=(Vrng[1]-Vrng[0])/(nd+1);
- for(i=1; i<=nd; i++){
- v=Vrng[0]+i*d;
- nv=appendd1(vdiv,v);
+ for(i=1;i<=length1(udata);i++){
+ crv2d[0][0]=0;
+ for(j=0; j<=Ndv; j++){
+ add2(crv2d, udata[i],Vrng[0]+j*dv);
+ }
+ if(allflg==1){out[0][0]=0;}
+ crv2onsfparadata(ch,crv2d,bdyk,out);
+ if(allflg==0){
+ dataindexd3(3,out,din);
+ out1[0][0]=0; out2[0][0]=0;
+ appendd3(0,din[1][0],din[1][1],out,out1);
+ appendd3(0,din[2][0],din[2][1],out,out2);
+ if(i==1){
+ output3(1,"w",varname,dirfname,out1);
+ output3(1,"w",varnameh,dirfnameh,out2);
+ }else{
+ output3(0,"a",varname,dirfname,out1);
+ output3(0,"a",varnameh,dirfnameh,out2);
+ }
+ }else{
+ sprintf(varnow,"%s%s%d",var,"u",i);
+ sprintf(varhnow,"%s%s%d",varh,"u",i);
+ output3h("a",varnow, varhnow,fname,out);
}
}
- else{
- for(i=1; i<=n; i++){
- nv=appendd1(vdiv,vdv[i]);
- }
- }
- nfbdxy=makexybdy(Ch,fbdxy);
- Wirept[0][0]=0;
- fsL[0][0]=0; nfsL=0;
- fsLh[0][0]=0;
- for(i=1; i<=nu; i++){
- u=udiv[i];
- d=(Vrng[1]-Vrng[0])/(num*Ndv);
- tmpmd2[0][0]=0; ntmp=0;
- for(j=1;j<=(num*Ndv)+1; j++){
- v=Vrng[0]+(j-1)*d;
- p[0]=u; p[1]=v;
- ntmp=addptd2(tmpmd2,p);
- }
- nfkL=cuspsplitpara(Ch,tmpmd2, fkL);
- ndin=dataindexd3(2,fkL,din);
- for(j=1; j<=ndin; j++){
- fk[0][0]=0;
- nfk=appendd3(0, din[j][0], din[j][1], fkL,fk);
- ntmp=projpara(fk,tmpmd2);
- partitionseg(tmpmd2, fbdy, 1, par);
- ntmp=length2(Partitionpt);
- if(ntmp>2){
- for(k=2; k<=ntmp; k++){
- pull2(k, Partitionpt, p);
- nwire=addptd3(Wirept,p);
- }
- }
- nfs=nohiddenpara2(par,fk,1, fs);
- n=length3(Hiddendata);
- ntmp=appendd3(2,1,n, Hiddendata,fsLh);
- nfsL=appendd3(2,1,nfs,fs,fsL);
- }
- }
- for(i=1; i<= nv; i++){
- v=vdiv[i];
- d=(Urng[1]-Urng[0])/(num*Mdv);
- tmpmd2[0][0]=0; ntmp=0;
- for(j=1;j<=(num*Mdv)+1; j++){
- u=Urng[0]+(j-1)*d;
- p[0]=u; p[1]=v;
- ntmp=addptd2(tmpmd2,p);
- }
- nfkL=cuspsplitpara(Ch,tmpmd2, fkL);
- ndin=dataindexd3(2,fkL,din);
- for(j=1; j<=ndin; j++){
- fk[0][0]=0;
- nfk=appendd3(0, din[j][0], din[j][1], fkL,fk);
- ntmp=projpara(fk,tmpmd2);
- partitionseg(tmpmd2, fbdy, 1, par);
- ntmp=length2(Partitionpt);
- if(ntmp>2){
- for(k=2; k<=ntmp; k++){
- pull2(k, Partitionpt, p);
- nwire=addptd3(Wirept,p);
- }
+ for(j=1;j<=length1(vdata);j++){
+ crv2d[0][0]=0;
+ for(i=0; i<=Mdv; i++){
+ add2(crv2d, Urng[0]+i*du,vdata[j]);
+ }
+ if(allflg==1){out[0][0]=0;}
+ crv2onsfparadata(ch,crv2d,bdyk,out);
+ if(allflg==0){
+ dataindexd3(3,out,din);
+ out1[0][0]=0; out2[0][0]=0;
+ appendd3(0,din[1][0],din[1][1],out,out1);
+ appendd3(0,din[2][0],din[2][1],out,out2);
+ if(i<length1(vdata)){
+ output3(0,"a",varname,dirfname,out1);
+ output3(0,"a",varnameh,dirfnameh,out2);
+ }else{
+ output3(0,"a",varname,dirfname,out1);
+ outputend(dirfname);
+ output3(0,"a",varnameh,dirfnameh,out2);
+ outputend(dirfnameh);
}
- nohiddenpara2(par,fk,1, fs);
- appendd3(2,1,length3(Hiddendata), Hiddendata,fsLh);
- appendd3(2,1,length3(fs),fs,fsL);
+ }else{
+ sprintf(varnow,"%s%s%d",var,"v",j);
+ sprintf(varhnow,"%s%s%d",varh,"v",j);
+ output3h("a",varnow, varhnow,fname,out);
}
}
- push3(Inf,3,0,fsL);
- nfsL=appendd3(0,1,length3(fsLh),fsLh,fsL);
- push3(Inf,3,0,fsL);
- return nfsL;
+ if(allflg==0){
+ outputend(dirfname);
+ outputend(dirfnameh);
+ }
}
-/*
-double cutfun(int ch, double u, double v){
- double p[3],val ;
- surffun(ch,u,v,p);
- val=p[0]+p[1]-0.5;
- return val;
+void intersectcrvsf(const char *wa, short chfd,double crv[][3],const char *fname){
+ double pa[3],pb[3],out[DsizeM][3],ptL[DsizeM][3];
+ int i;
+ short chcut;
+ char chc[10];
+ sprintf(chc,"%d",chfd);
+ char var[]="intercrvsf";
+ char dirfname[256] = {'\0'};
+ sprintf(dirfname,"%s%s",Dirname,fname);
+ char varname[256] = {'\0'};
+ sprintf(varname,"%s%s",var,chc);
+ ptL[0][0]=0;
+ for(i=1;i<length3(crv);i++){
+ pull3(i,crv,pa);
+ pull3(i+1,crv,pb);
+ meetpoints(chfd,pa,pb,1,out);
+ appendd3(0,1,length3(out),out,ptL);
+ }
+ output3(1,wa,varname,dirfname,ptL);
}
-*/
-void makevaltablecut(int chcut){
- double eps0=pow(10,-6.0), u, v, du, dv;
- int i, j, nx=0, ny=0; ;
- du=(Urng[1]-Urng[0])/Mdv;
- dv=(Vrng[1]-Vrng[0])/Ndv;
- for(j=0; j<=Ndv; j++){
- v=Vrng[0]+j*dv;
- for(i=0; i<=Mdv; i++){
- u=Urng[0]+i*du;
- Zval[j][i]=cutfun(Ch,chcut, u,v);
+void sfcutparadata(short chfd, short ncut, double fbdy3[][3],const char *fname,const char *fnameh){
+ double Vec[3]={sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA)};
+ double v1=Vec[0],v2=Vec[1],v3=Vec[2];
+ double out[DsizeM][2],out2[DsizeM][2],outd3[DsizeL][3];
+ double ekL[DsizeL][3],out1d3[DsizeL][3],out2d3[DsizeL][3];
+ double uval1,uval2,vval1,vval2,eval11,eval12,eval21,eval22;
+ double pl[5][2], vl[5], ql[11][2],diff1,diff2;
+ double tmp1md[DsizeM][2],tmp2md[DsizeM][2],tmpd[2],tmp1d[2],tmp2d[2];
+ double tmp2md3[DsizeM][3],tmpd3[3],tmp1d3[3];
+ double du=(Urng[1]-Urng[0])/Mdv;
+ double dv=(Vrng[1]-Vrng[0])/Ndv;
+ double p1[2],p2[2],m1,m2,q11,q12,q21,q22,a1,a3,b1,b3;
+ int i,j,k,din[DsizeS][2],ns,ne,rmv[DsizeS];
+ short chcut, allflg=0;
+ if(strlen(fnameh)==0){
+ allflg=1;
+ }
+ char var[20]="sfcut3d";
+ char varh[20]="sfcuth3d";
+ sprintf(var,"%s%d",var,chfd);
+ sprintf(varh,"%s%d",varh,chfd);
+ char varnow[20]={'\0'};
+ char varhnow[20]={'\0'};
+ char dirfname[256] = {'\0'};
+ char dirfnameh[256] = {'\0'};
+ char varname[256] = {'\0'};
+ char varnameh[256] = {'\0'};
+ sprintf(varname,"%s%d",var,chfd);
+ sprintf(varnameh,"%s%d",varh,chfd);
+ sprintf(dirfname,"%s%s",Dirname,fname);
+ sprintf(dirfnameh,"%s%s",Dirname,fnameh);
+ for(chcut=1;chcut<=ncut;chcut++){
+ out[0][0]=0; out2[0][0]=0;
+ for(j=0; j<=Ndv-1; j++){
+ vval1=Vrng[0]+j*dv;
+ vval2=Vrng[0]+(j+1)*dv;
+ uval1=Urng[0];
+ eval11=cutfun(chfd, chcut,uval1, vval1);
+ eval12=cutfun(chfd, chcut,uval1, vval2);
+ for(i=0; i<=Mdv-1; i++){
+ uval2=Urng[0]+(i+1)*du;
+ eval21=cutfun(chfd, chcut,uval2, vval1);
+ eval22=cutfun(chfd, chcut,uval2, vval2);
+ pl[0][0]=uval1; pl[0][1]=vval1; vl[0]=eval11;
+ pl[1][0]=uval2; pl[1][1]=vval1; vl[1]=eval21;
+ pl[2][0]=uval2; pl[2][1]=vval2; vl[2]=eval22;
+ pl[3][0]=uval1; pl[3][1]=vval2; vl[3]=eval12;
+ pl[4][0]=uval1; pl[4][1]=vval1; vl[4]=eval11;
+ ql[0][0]=0;
+ for(k=0; k<=3; k++){
+ pull2(k,pl,p1);
+ pull2(k+1,pl,p2);
+ m1=vl[k]; m2=vl[k+1];
+ if(fabs(m1)<Eps){
+ addptd2(ql, p1);
+ continue;
+ }
+ if(fabs(m2)<Eps){
+ continue;
+ }
+ if((m1>0)&&(m2>0)){
+ continue;
+ }
+ if((m1< 0)&&(m2< 0)){
+ continue;
+ }
+ tmpd[0]=1/(m1-m2)*(-m2*p1[0]+m1*p2[0]);
+ tmpd[1]=1/(m1-m2)*(-m2*p1[1]+m1*p2[1]);
+ addptd2(ql, tmpd);
+ }
+ uval1=uval2;
+ eval11=eval21;
+ eval12=eval22;
+ if(length2(ql)==2){
+ q11=ql[1][0];q12=ql[1][1];q21=ql[2][0];q22=ql[2][1];
+ a1=uval1;a3=uval2;b1=vval1;b3=vval2;
+ if(((q11==a1)&&(q21==a1))||((q11==a3)&&(q21==a3))){
+ if(((q21==b1)&&(q22==b1))||((q21==b3)&&(q22==b3))){
+ appendd2(2,1,2,ql,out2);
+ }else{
+ appendd2(2,1,2,ql,out);
+ }
+ continue;
+ }
+ if(((q12==b1)&&(q22==b1))||((q12==b3)&&(q22==b3))){
+ if(((q11==a1)&&(q21==a1))||((q11==a3)&&(q21==a3))){
+ appendd2(2,1,2,ql,out2);
+ }else{
+ appendd2(2,1,2,ql,out);
+ }
+ continue;
+ }
+ appendd2(2,1,2,ql,out);
+ }
+ }
+ }
+ dataindexd2(2,out2,din);
+ while(length2i(din)>0){
+ ns=din[1][0];ne=din[1][1];
+ tmp1md[0][0]=0;
+ appendd2(0,ns,ne,out2,tmp1md);
+ appendd2(2,ns,ne,out2,out);
+ removelistd2(2,1,out2);
+ dataindexd2(2,out2,din);
+ rmv[0]=0;
+ for(j=1;j<=length2i(din);j++){
+ ns=din[j][0];ne=din[j][1];
+ tmp2md[0][0]=0;
+ appendd2(0,ns,ne,out2,tmp2md);
+ pull2(1,tmp2md,tmp2d);pull2(1,tmp1md,tmp1d);
+ diff1=dist(2,tmp1d,tmp2d);
+ pull2(2,tmp2md,tmp2d);pull2(2,tmp1md,tmp1d);
+ diff1=diff1+dist(2,tmp1d,tmp2d);
+ pull2(1,tmp2md,tmp2d);pull2(2,tmp1md,tmp1d);
+ diff2=dist(2,tmp1d,tmp2d);
+ pull2(2,tmp2md,tmp2d);pull2(1,tmp1md,tmp1d);
+ diff2=diff2+dist(2,tmp1d,tmp2d);
+ if((diff1<Eps)||(diff2<Eps)){
+ appendi1(j,rmv);
+ continue;
+ }
+ }
+ for(j=1;j<=rmv[0];j++){
+ removelistd2(2,rmv[j],out2);
+ }
+ dataindexd2(2,out2,din);
+ }
+ connectseg(out, Eps1, out2);
+ dataindexd2(2,out2,din);
+ outd3[0][0]=0;
+ for(i=1;i<=length2i(din);i++){
+ ns=din[i][0];ne=din[i][1];
+ tmp1md[0][0]=0;
+ appendd2(0,ns,ne,out2,tmp1md);
+ tmp2md3[0][0]=0;
+ for(j=1;j<=length2(tmp1md);j++){
+ pull2(j,tmp1md,tmpd);
+ surffun(chfd,tmpd[0],tmpd[1],tmpd3);
+ if(length3(tmp2md3)>0){
+ pull3(length3(tmp2md3),tmp2md3,tmp1d3);
+ if(dist(3,tmpd3,tmp1d3)<Eps1){
+ continue;
+ }
+ }
+ addptd3(tmp2md3,tmpd3);
+ }
+ appendd3(2,1,length3(tmp2md3),tmp2md3,outd3);
+ }
+ crv3onsfparadata(chfd,outd3,fbdy3,ekL);
+ if(allflg==0){
+ dataindexd3(3,ekL,din);
+ out1d3[0][0]=0; out2d3[0][0]=0;
+ appendd3(0,din[1][0],din[1][1],ekL,out1d3);
+ appendd3(0,din[2][0],din[2][1],ekL,out2d3);
+ if(chcut==1){
+ output3(1,"w",varname,dirfname,out1d3);
+ output3(1,"w",varnameh,dirfnameh,out2d3);
+ }else{
+ output3(0,"a",varname,dirfname,out1d3);
+ output3(0,"a",varnameh,dirfnameh,out2d3);
+ }
+ }else{
+ sprintf(varnow,"%s%d",var,chcut);
+ sprintf(varhnow,"%s%d",varh,chcut);
+ output3h("a",varnow, varhnow,fname,ekL);
}
}
- for(i=0; i<=Mdv; i++){
- Xval[i]=Urng[0]+i*du;
- }
- for(j=0; j<=Ndv; j++){
- Yval[j]=Vrng[0]+j*dv;
+ if(allflg==0){
+ outputend(dirfname);
+ outputend(dirfnameh);
}
}
-int sfcutdata(int ch, double ekL[][3]){
- double cutuvL[DsizeL][2], out1[DsizeM][2], out2[DsizeM][3], pt[3];
- int i, j, nall, ndin, din[DsizeM][2], nekL,nout1,nout2;
-// makevaltablecut(ch); //180320
-// nall=implicitplot(cutuvL); //180320
- ekL[0][0]=0; nekL=0;
- ndin=dataindexd2(2,cutuvL,din);
- for(i=1; i<=ndin; i++){
- out1[0][0]=0;
- nout1=appendd2(2,din[i][0],din[i][1],cutuvL,out1);
- out2[0][0]=0;
- for(j=1; j<=nout1; j++){
- surffun(ch,out1[j][0], out1[j][1], pt);
- nout2=addptd3(out2,pt);
- }
- nekL=appendd3(2,1,nout2,out2,ekL);
- }
- return nekL;
-}
-
-int crv3onsfparadata(double fk[][3], double fbdyd3[][3], double out[][3]){
- double fbdy[DsizeL][2], fh[DsizeL][2], tmpmd2[DsizeL][2], par[DsizeM];
- int n, nall, nfbdy, nfbdxy, npar, nout;
- out[0][0]=0;
- nfbdy=projpara(fbdyd3,fbdy);
-// nall=ospline3(2,fk,2,fk1);
- projpara(fk,fh);
- partitionseg(fh,fbdy, 1, par);
- nohiddenpara2(par,fk, 1,out);
- push3(Inf,3,0,out);
- nall=appendd3(0,1,length3(Hiddendata),Hiddendata,out);
- push3(Inf,3,0,out); //17.06.16
- return nall;
-}
-
int projcoordcurve(double curve[][3], double out[][3]){
double SP=sin(PHI), CP=cos(PHI), ST=sin(THETA), CT=cos(THETA);
double pt[3], xz, yz, zz;
@@ -2058,41 +1972,80 @@ int skeletondata3(double data[][3], double r00,
return length3(allres);
}
-/*
-void writesfbd(const char *var, const char *fname, const char *fnameh,double sf[][3]){
- sfbdparadata(sf);
- output3(var, "", fname,2,sf);
- output3(var, "h", fnameh,2,Borderhiddendata);
-}
-
-void writecrv(const char *var, const char *fname, const char *fnameh,
- double crv[][3],double sf[][3]){
- crvsfparadata(crv, sf, 1,Crvdata);
- output3(var, "", fname,2,Crvdata);
- output3(var, "h", fnameh,2,Crvsfhiddendata);
-}
-
-void writewire(const char *var, const char *fname, const char *fnameh,
- double sf[][3], int num, double udv[], double vdv[]){
- wireparadata(sf, num, udv,vdv, Wiredata);
- output3(var, "", fname,2,Wiredata);
- output3(var, "h", fnameh,2,Hiddenwiredata);
-}
-
-void writesfcut(const char *var, const char *fname, const char *fnameh,
- double crv[][3], double sf[][3]){
- sfcutdata(crv);
- crv3onsfparadata(crv, sf, Crvonsfdata);
- output3(var, "", fname,2,Crvonsfdata);
- output3(var, "h", fnameh,2,Crv3onsfhiddendata);
-}
-
-void writecrvonsf(const char *var, const char *fname, const char *fnameh,
- double crv[][3],double sf[][3]){
- crv3onsfparadata(crv, sf, Crvonsfdata);
- output3(var, "", fname,2,Crvonsfdata);
- output3(var, "h", fnameh,2,Crv3onsfhiddendata);
+void readoutdata3(const char *fname, const char *var, double data[][3]){
+ double x,y,z;
+ float xx;
+ char dstr[256] = {'\0'};
+ char str[10] = {'\0'},tmp[2]={'\0'};
+ int linectr=0, start=0, jj,nn,nctr;
+ FILE *fp;
+ fp=fopen(fname,"r");
+ if(fp==NULL){
+ printf("file not found\n");
+ return;
+ }
+ data[0][0]=0;
+ nn=strlen(var);
+ while( !feof(fp)){
+ fgets(dstr,250,fp);
+ linectr++;
+ if(strncmp(dstr,var,nn)==0){
+ start=linectr;
+ }else{
+ if(start==0){
+ continue;
+ }
+ }
+ if(linectr==start){
+ continue;
+ }
+ if(strncmp(dstr,"sta",3)==0){
+ if(linectr>start+1){
+ add3(data,Inf,2,0);
+ }
+ continue;
+ }
+ if(strncmp(dstr,"end",3)==0){
+ continue;
+ }
+ if(strncmp(dstr,"[",1)!=0){
+ break;
+ }
+ str[0]='\0';
+ nctr=0;
+ for(jj=2;jj<250;jj++){
+ tmp[0]='\0'; sprintf(tmp,"%s%c",tmp,dstr[jj]);
+ if(strncmp(tmp,"/",1)==0){
+ break;
+ }
+ if(strncmp(tmp," ",1)==0){
+ continue;
+ }
+ if(strncmp(tmp,",",1)==0){
+ nctr++;
+ if(nctr==1){
+ x=atof(str); str[0]='\0';
+ continue;
+ }
+ if(nctr==2){
+ y=atof(str);str[0]='\0';
+ continue;
+ }
+ }
+ if(strncmp(tmp,"]",1)==0){
+ z=atof(str);str[0]='\0';
+ add3(data,x,y,z);
+ nctr=0;
+ jj++;
+ tmp[0]='\0'; sprintf(tmp,"%s%c",tmp,dstr[jj]);
+ if(strncmp(tmp,",",1)==0){
+ jj++;
+ }
+ continue;
+ }
+ sprintf(str,"%s%s",str,tmp);
+ }
+ }
+ fclose(fp);
}
-*/
-
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlibC/surflibhead.h b/Master/texmf-dist/scripts/ketcindy/ketlibC/surflibhead.h
index df31a4d812f..0adc7779221 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlibC/surflibhead.h
+++ b/Master/texmf-dist/scripts/ketcindy/ketlibC/surflibhead.h
@@ -8,7 +8,7 @@ short Ch=1;
double Cuspsplitpt[DsizeL][2];
double Cusppt[DsizeM][2];
double Otherpartition [DsizeM];
-double Partitionpt[DsizeM][2];
+//double Partitionpt[DsizeM][2];
double Cuspdata[DsizeM];
double Wirept[DsizeM][3];
double Hiddendata[DsizeL][3];
@@ -16,43 +16,41 @@ double Borderpt[DsizeM][2];
double Borderhiddendata[DsizeL][3];
double Surf[DsizeL][3];
double Crvdata[DsizeL][3];
-double Wiredata[DsizeLL][3];
+//double Wiredata[DsizeLL][3];
-int output3(const char *var, const char *fname, int level, double out[][3]);
-int output3h(const char *var, const char *varh, const char *fname, double out[][3]);
+int output3(short head,const char *wa,const char *var, const char *fname,double out[][3]);
+int output3h(const char *wa,const char *var, const char *varh, const char *fname, double out[][3]);
+void outputend(const char *fname);
int writedataC(const char *fname, double out[][3]);
int readdataC(const char *fname, double data[][3]);
+void readoutdata3(const char *fname, const char *var, double data[][3]);
void parapt(double pt3[3],double pt2[2]);
+double zparapt(double p[3]);
int projpara(double p3[][3], double p2[][2]);
double invparapt(double ph, double fh[][2], double fk[][3],double out[3]);
-int surfcurve(short ch,int level, double crv[][2], double pdata[][3]);
-int xyzax3data(double x0, double x1, double y0, double y1, double z0, double z1,
- double out[][3]);
+void surfcurve(short ch,double crv[][2], double pdata[][3]);
double evlpfun(short ch, double u, double v);
int envelopedata(short ch, double out[][2]);
-void evlptablepara(short ch);
-//int implicitplot(double out[][2]);
int cuspsplitpara(short ch,double pdata[][2], double outkL[][3]);
-double funpthiddenQ(short ch,double u, double v, double pa[3]);
int makexybdy(short ch,double ehL[][2]);
void partitionseg(double fig[][2],double gL[][2], int ns, double parL[]);
-void makevaltablepth(short ch,double pta[3]);
-int pthiddenQ(short ch,double pta[3], int uveq, double eps[2]);
-int nohiddenpara2(double paL[], double fk[][3], int uveq, double figkL[][3]);
-int borderparadata(short ch,double fkL[][3], double fsL[][3]);
+double funpthiddenQ(short ch,double u, double v,double pa[3]);
+double pthiddenQ(short ch,double pta[3], int uveq);
+int nohiddenpara2(short ch,double paL[], double fk[][3], int uveq, double figkL[][3]);
+void borderparadata(short ch,double fkL[][3], double fsL[][3]);
int dropnumlistcrv3(double qd[][3], double eps1, int out[]);
-int sfbdparadata(short ch,double outd3[][3]);
-void makevaltablemeet(short ch,double pa[3], double vec[3], double eps0);
-int meetpoints(short ch,double pta[3], double ptb[3], double eps, double ptL[][3]);
-int crvsfparadata(double fkL[][3], double fbdkL[][3], int sepflg, double out[][3]);
-int sfcutdata(int ch, double ekL[][3]);
-int crv3onsfparadata(double fk[][3], double fbdyd3[][3], double out[][3]);
-int wireparadata(double bdyk[][3], double udv[], double vdv[], int num,
- double fsL[][3]);
+void sfbdparadata(short ch,double outd3[][3]);
+double funmeet(short ch,double u, double v,double pa[3], double vec[3]);
+void meetpoints(short ch,double pta[3], double ptb[3], int uveq,double out[][3]);
+void crvsfparadata(short ch,double fkL[][3], double fbdkL[][3], int sepflg, double out[][3]);
+void crv3onsfparadata(short ch,double fk[][3], double fbdyd3[][3], double out[][3]);
+void crv2onsfparadata(short ch,double fh[][2], double fbdyd3[][3], double out[][3]);
+void intersectcrvsf(const char *wa, short chfd,double crv[][3],const char *fname);
+void wireparadata(short ch,double bdyk[][3], double udata[], double vdata[],const char *fname,const char *fnameh);
+void sfcutparadata(short chfd, short ncut, double fbdy3[][3],const char *fname,const char *fnameh);
int projcoordcurve(double curve[][3], double out[][3]);
int kukannozoku(double jokyo[2], double kukanL[][2], double res[][2]);
int skeletondata3(double data[][3], double r00, double eps1, double eps2,
double allres[][3]);
-double cutfun(short ch,int chcut,double u, double v);
-void makevaltablecut(int chcut);
+double cutfun(short chfd,short chcut,double u, double v);
diff --git a/Master/texmf-dist/scripts/ketcindy/ketoutset.txt b/Master/texmf-dist/scripts/ketcindy/ketoutset.txt
index 38381ef2ed3..8153d6e98c8 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketoutset.txt
+++ b/Master/texmf-dist/scripts/ketcindy/ketoutset.txt
@@ -1,68 +1,54 @@
+if(!isstring(PathThead),
+ PathThead="";
+);
+PathT=PathThead+"uplatex";
if(iswindows(),
-// PathThead="C:\kettex\texlive\bin\win32\";
-// PathThead="";
-// PathT=PathThead+"platex";
- PathT=PathThead+"uplatex";
-// PathT=PathThead+"platex";
-// PathT=PathThead+"latex";
-// PathT=PathThead+"pdflatex";
-// PathT=PathThead+"lualatex";
-// PathS="C:\Program Files\scilab-5.5.2\bin\scilex";
PathS="C:\Program Files\scilab-6.0.0\bin\scilex";
PathC="C:\MinGW\bin\gcc.exe";
-// PathC="C:\MinGW32\bin\gcc.exe";
Pathpdf="C:\Program Files\SumatraPDF\SumatraPDF.exe";
PathR="C:\Program Files\R\R-3.4.2\bin";
PathA="C:\Program Files\asir\bin\asir";
PathM="C:\maxima-5.37.3\bin\maxima.bat";
PathV3="C:\Program Files\VCG\MeshLab\meshlab";
PathF="C:\cygwin\bin";
-// PathAd="C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe";
PathAd="C:\Program Files\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe";
);
if(ismacosx(),
-// PathThead="/Applications/kettex/texlive/bin/x86_64-darwin/";
-// PathThead="/Library/TeX/texbin/";
-// PathThead="";
-// PathT=PathThead+"platex";
- PathT=PathThead+"uplatex";
-// PathT=PathThead+"latex";
-// PathT=PathThead+"xelatex";
-// PathT=PathThead+"pdflatex";
-// PathT=PathThead+"lualatex";
-// PathS="/Applications/scilab-5.5.2.app/Contents/MacOS/bin/scilab";
PathS="/Applications/scilab-6.0.0.app/Contents/MacOS/bin/scilab";
Pathpdf="preview";
-// Pathpdf="skim";
-// Pathpdf="/Applications/skim.app/Contents/MacOS/Skim";
PathC="gcc";
-// PathR="R";
-// PathR="/Library/Frameworks/R.framework/Versions/3.3/Resources/bin/R";
PathR="/Library/Frameworks/R.framework/Versions/Current/Resources/bin/R";
PathA="/Applications/cfep.app/OpenXM/rc/asir";
PathM="/Applications/Maxima.app/Contents/Resources/maxima.sh";
PathV3="/Applications/meshlab.app/Contents/MacOS/MeshLab";
PathF="/Applications/FriCAS.app/Contents/Resources/bin/fricas";
-// PathAd="Adobe Reader";
PathAd="/Applications/Adobe Acrobat Reader DC.app/Contents/MacOS/AdobeReader";
Mackc="sh";
-// Mackc="open";
);
if(islinux(),
- PathT="uplatex";
PathS="scilab";
Pathpdf="evince";
-// Pathpdf="/usr/bin/xpdf";
+ PathC="gcc";
PathR="R";
- PathA="";
+ PathA="asir";
PathM="maxima";
- PathV3="";
- PathF="";
- PathAd="";
+ PathV3="Meshlab";
+ PathF="fricas";
+ PathAd="acroread";
);
+if(iswindows(), //180420from
+ Changesetting([gethome(), gethome()+"\Desktop","C:"]);
+,
+ Changesetting([gethome(),gethome()+"/Desktop"]);
+);//180420to
+
if(indexof(PathT,"platex")>0,
Helplist(["+","+3d","+mv"],"helpJ");
,
Helplist(["+","+3d","+mv"],"helpE");
);
+
+setdirectory(Dircdy);
+
+
diff --git a/Master/texmf-dist/scripts/ketcindy/template1basic.cdy b/Master/texmf-dist/scripts/ketcindy/template1basic.cdy
index 806d69f2c34..c4cae01defe 100644
--- a/Master/texmf-dist/scripts/ketcindy/template1basic.cdy
+++ b/Master/texmf-dist/scripts/ketcindy/template1basic.cdy
Binary files differ
diff --git a/Master/texmf-dist/scripts/ketcindy/template2advanced.cdy b/Master/texmf-dist/scripts/ketcindy/template2advanced.cdy
index 3fa2e25abe4..2a5443784f5 100755..100644
--- a/Master/texmf-dist/scripts/ketcindy/template2advanced.cdy
+++ b/Master/texmf-dist/scripts/ketcindy/template2advanced.cdy
Binary files differ