発言者: 石原 守
発言日: 2013 04/29 18:47
ちょっと改良できたかな?
\documentclass[a4j]{jarticle}
\usepackage{emathPp}
\usepackage{emathW}
\def\Qsyndiv#1#2{%
\def\seq{#1}
\csvhairetu*\seq{foo}
\def\seq{#2}
\csvhairetu*\seq{bar}
\hairetusyokika{bb}
\hairetusyokika{cc}
\hairetusyokika{dd}
\Ifor*\i{1}{\fooN}\Do{\hairetutuika{bb}{0}}
\Ifor*\i{1}{\fooN}\Do{\hairetutuika{cc}{0}}
\Ifor*\i{1}{\fooN}\Do{\hairetutuika{dd}{0}}
%
\calcval[d]{\fooi}\ddi
%
\calcval[d]{\ddi*\bari}\bbii
\calcval[d]{\fooii+\bbii}\ddii
%
\Ifor*\i{3}{\fooN}\Do{%
\ISub\i{2}\j
\ISub\i{1}\k
\calcval[d]{\hairetu{dd}{\k}*\bari}\tmp
\edefhairetu{bb}{\i}{\tmp}
\calcval[d]{\hairetu{dd}{\j}*\barii}\tmp
\edefhairetu{cc}{\i}{\tmp}
\edefhairetu{bb}{\fooN}{0}
\calcval[d]{\hairetu{foo}{\i}+\hairetu{bb}{\i}+\hairetu{cc}{\i}}\tmp
\edefhairetu{dd}{\i}{\tmp}
}
\IAdd\fooN{1}\a
\ISub\fooN{1}\jj
%\noindent
$\begin{array}{*{\a}{r}}
\multicolumn{1}{r|}{\bari}&
\Cfor{\gdef\i{1}}{\i<\fooN}{\xIncr\i}\do{%
\hairetu{foo}{\i}&
} \hairetu{foo}{\fooN} \\\cline{1-1}
%
\multicolumn{1}{r|}{\barii} &&
\Cfor{\gdef\i{2}}{\i<\fooN}{\xIncr\i}\do{%
\hairetu{bb}{\i}&}
\\\cline{1-1}
%
&&
\Cfor{\gdef\i{3}}{\i<\a}{\xIncr\i}\do{%
&\hairetu{cc}{\i}}
\\\hline
%
\Cfor{\gdef\i{1}}{\i<\jj}{\xIncr\i}\do{%
&\hairetu{dd}{\i}}&
\multicolumn{1}{|r}{\hairetu{dd}{\jj}}
& \hairetu{dd}{\fooN} \\\cline{\fooN-\a}
\end{array}$
}
\begin{document}
\Qsyndiv{1,-2,3,-4}{1,1}
\Qsyndiv{1,-2,3,-4}{-1,1}
\Qsyndiv{1,-2,3,-4,-1,2}{1,-2}
\Qsyndiv{1,-2,3,-4}{-1,-1}
\Qsyndiv{1,-3,5,-6}{-2,2}
\Qsyndiv{1,-3,5,-6}{2,-2}
\end{document}
▼関連発言
│
└◆1116:3次式を2次式で割る組立除法 [石原 守] 04/29 10:09
└◆1117:Re:3次式を2次式で割る組立除法 [石原 守] 04/29 18:47
└◆1118:Re[2]:3次式を2次式で割る組立除法 [田中徹] 04/29 21:31
└◆1119:Re[3]:3次式を2次式で割る組立除法 [石原 守] 04/30 07:38
└◆1120:Re[4]:3次式を2次式で割る組立除法 [石原 守] 05/01 09:01
└◆1121:文字係数の場合 [tDB] 05/06 09:47
└◆1124:Re:文字係数の場合 [石原 守] 05/06 11:08<-last