emath saloon

新規発言一覧最新記事過去一覧検索HOME

No.897  メネラウスの定理とチェバの定理
発言者: 田中徹
発言日: 2011 01/30 19:02
センター試験も終了しまして皆様いかがお過ごしでしょうか。

数年来、仕掛かりにしていた上記の作図スタイルファイルを
不細工なコピーペーストで仕上げたので掲載させていただきます。
(気に入ったら Menelaus.sty Ceva.sty として使用していただければ幸いです。)

Menelaus 〜   は頂点の計算のみ
Menelaus* 〜  はラベルなしの描画あり
Menelaus** 〜 はラベルを含めた描画あり

引数は 8個あり {頂点1}{頂点2}{頂点3}{比1}{比2}{比3}{解答比1}{解答比2} です。

{比1},{比2},{比3}のいずれか 1つ以外は 数字以外の文字を用いてください。
x:y だけでなく m:n でも可です。

メネラウスの外分点が 3個、チェバの外分点が 2個のものは
頂点の計算はできますが描画の体裁は保証外です。

いじり倒していただければ本望です。

\documentclass[a4j]{jarticle}

\usepackage[notMy,papersize]{emathP}
%\usepackage{Menelaus}
%\usepackage{Ceva}

\pagestyle{empty}


\makeatletter%
%--- Menelaus.sty -------------------------------------------------------------------
\RequirePackage{emathB}
%
\def\Menelaus{\@ifstar{\let\if@描画\iftrue{}\@Menelaus}{\let\if@描画\iffalse\@Menelaus}}%
\def\@Menelaus{\@ifstar{\let\if@ラベル\iftrue{}\@@Menelaus}{\let\if@ラベル\iffalse\@@Menelaus}}%
\def\@@Menelaus#1#2#3#4#5#6#7#8{%
\strsep{#4}{:}\@LabelABi\@LabelABii%
\strsep{#5}{:}\@LabelBCi\@LabelBCii%
\strsep{#6}{:}\@LabelCAi\@LabelCAii%
\Strstr{0123456789}{\@LabelABi}\@AB%
\Strstr{0123456789}{\@LabelBCi}\@BC%
\Strstr{0123456789}{\@LabelCAi}\@CA%
\ifnum\@AB=0{%
\IMul{\@LabelBCi}{\@LabelCAi}{\@分子積}%
\IMul{\@LabelBCii}{\@LabelCAii}{\@分母積}%
\BYakubun{\@分母積}{\@分子積}\@分子\@分母
\xdef#7{\@分子}%
\xdef#8{\@分母}%
\Bunten{#1}{#2}{-\@分子}{\@分母}\@AB%
\Bunten{#2}{#3}{\@LabelBCi}{\@LabelBCii}\@BC%
\Bunten{#3}{#1}{\@LabelCAi}{\@LabelCAii}\@CA%
\xdef\MenelausPos{\@AB}%
\xdef\分点AB{\@AB}%
\xdef\分点BC{\@BC}%
\xdef\分点CA{\@CA}%
\if@ラベル%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#1\@AB{$\@LabelABi$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@AB#2{$\@LabelABii$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#2\@BC{$\maru{\@LabelBCi}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@BC#3{$\maru{\@LabelBCii}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#3\@CA{\fbox{$\@LabelCAi$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@CA#1{\fbox{$\@LabelCAii$}}%
\fi%
\if@描画%
\calcval[d]{(\@LabelCAi)*(\@LabelBCi)-(\@LabelCAii)*(\@LabelBCii)}\@Result%
{\thinlines%
\ifnum\@Result<\z@{
\hamidasisenbun{\MenelausPos}{\@CA}{0}{0}%
\Drawlines{\MenelausPos{#2}}%
}
\else{
\hamidasisenbun{\MenelausPos}{\@BC}{0}{0}%
\Drawlines{\MenelausPos{#1}}%
}
\fi%
}%
\Takakkei{#1#2#3}%
\fi%
}%
\fi% End of \@AB=0
\ifnum\@BC=0{%
\IMul{\@LabelCAi}{\@LabelABi}{\@分子積}%
\IMul{\@LabelCAii}{\@LabelABii}{\@分母積}%
\BYakubun{\@分母積}{\@分子積}\@分子\@分母
\xdef#7{\@分子}%
\xdef#8{\@分母}%
\Bunten{#1}{#2}{\@LabelABi}{\@LabelABii}\@AB%
\Bunten{#2}{#3}{-\@分子}{\@分母}\@BC%
\Bunten{#3}{#1}{\@LabelCAi}{\@LabelCAii}\@CA%
\xdef\MenelausPos{\@BC}%
\xdef\分点AB{\@AB}%
\xdef\分点BC{\@BC}%
\xdef\分点CA{\@CA}%
\if@ラベル%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#1\@AB{\fbox{$\@LabelABi$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@AB#2{\fbox{$\@LabelABii$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#2\@BC{$\@LabelBCi$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@BC#3{$\@LabelBCii$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#3\@CA{$\maru{\@LabelCAi}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@CA#1{$\maru{\@LabelCAii}$}%
\fi%
\if@描画%
\calcval[d]{(\@LabelABi)*(\@LabelCAi)-(\@LabelABii)*(\@LabelCAii)}\@Result%
{\thinlines%
\ifnum\@Result<\z@{
\hamidasisenbun{\MenelausPos}{\@AB}{0}{0}%
\Drawlines{\MenelausPos{#3}}%
}
\else{
\hamidasisenbun{\MenelausPos}{\@CA}{0}{0}%
\Drawlines{\MenelausPos{#2}}%
}
\fi%
}%
\Takakkei{#1#2#3}%
\fi%
}%
\fi% End of \@BC=0
\ifnum\@CA=0{%
\IMul{\@LabelABi}{\@LabelBCi}{\@分子積}%
\IMul{\@LabelABii}{\@LabelBCii}{\@分母積}%
\BYakubun{\@分母積}{\@分子積}\@分子\@分母
\xdef#7{\@分子}%
\xdef#8{\@分母}%
\Bunten{#1}{#2}{\@LabelABi}{\@LabelABii}\@AB%
\Bunten{#2}{#3}{\@LabelBCi}{\@LabelBCii}\@BC%
\Bunten{#3}{#1}{-\@分子}{\@分母}\@CA%
\xdef\MenelausPos{\@CA}%
\xdef\分点AB{\@AB}%
\xdef\分点BC{\@BC}%
\xdef\分点CA{\@CA}%
\if@ラベル%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#1\@AB{$\maru{\@LabelABi}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@AB#2{$\maru{\@LabelABii}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#2\@BC{\fbox{$\@LabelBCi$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@BC#3{\fbox{$\@LabelBCii$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#3\@CA{$\@LabelCAi$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@CA#1{$\@LabelCAii$}%
\fi%
\if@描画%
\calcval[d]{(\@LabelABi)*(\@LabelBCi)-(\@LabelABii)*(\@LabelBCii)}\@Result%
{\thinlines%
\ifnum\@Result<\z@{
\hamidasisenbun{\MenelausPos}{\@BC}{0}{0}%
\Drawlines{\MenelausPos{#1}}%
}
\else{
\hamidasisenbun{\MenelausPos}{\@AB}{0}{0}%
\Drawlines{\MenelausPos{#3}}%
}
\fi%
}%
\Takakkei{#1#2#3}%
\fi%
}%
\fi% End of \@CA=0
}%
%--- File End ------------------------------------------------------------------------
%--- Ceva.sty -------------------------------------------------------------------
\RequirePackage{emathB}
%
\def\Ceva{\@ifstar{\let\if@描画\iftrue{}\@Ceva}{\let\if@描画\iffalse\@Ceva}}%
\def\@Ceva{\@ifstar{\let\if@ラベル\iftrue{}\@@Ceva}{\let\if@ラベル\iffalse\@@Ceva}}%
\def\@@Ceva#1#2#3#4#5#6#7#8{%
\strsep{#4}{:}\@LabelABi\@LabelABii%
\strsep{#5}{:}\@LabelBCi\@LabelBCii%
\strsep{#6}{:}\@LabelCAi\@LabelCAii%
\Strstr{0123456789}{\@LabelABi}\@AB%
\Strstr{0123456789}{\@LabelBCi}\@BC%
\Strstr{0123456789}{\@LabelCAi}\@CA%
\ifnum\@AB=0{%
\IMul{\@LabelBCi}{\@LabelCAi}{\@分子積}%
\IMul{\@LabelBCii}{\@LabelCAii}{\@分母積}%
\BYakubun{\@分母積}{\@分子積}\@分子\@分母
\xdef#7{\@分子}%
\xdef#8{\@分母}%
\Bunten{#1}{#2}{\@分子}{\@分母}\@AB%
\Bunten{#2}{#3}{\@LabelBCi}{\@LabelBCii}\@BC%
\Bunten{#3}{#1}{\@LabelCAi}{\@LabelCAii}\@CA%
\LandL{#1}{\@BC}{#2}{\@CA}\@Kouten%
\xdef\CevaPos{\@Kouten}%
\xdef\分点AB{\@AB}%
\xdef\分点BC{\@BC}%
\xdef\分点CA{\@CA}%
\if@ラベル%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#1\@AB{$\@LabelABi$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@AB#2{$\@LabelABii$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#2\@BC{$\maru{\@LabelBCi}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@BC#3{$\maru{\@LabelBCii}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#3\@CA{\fbox{$\@LabelCAi$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@CA#1{\fbox{$\@LabelCAii$}}%
\fi%
\if@描画%
{\thinlines%
\Hasen{#1\@BC}%
\Hasen{#2\@CA}%
\Hasen{#3\@AB}%
\Takakkei{#1#2#3}%
}%
\fi%
}%
\fi% End of \@AB=0
\ifnum\@BC=0{%
\IMul{\@LabelCAi}{\@LabelABi}{\@分子積}%
\IMul{\@LabelCAii}{\@LabelABii}{\@分母積}%
\BYakubun{\@分母積}{\@分子積}\@分子\@分母
\xdef#7{\@分子}%
\xdef#8{\@分母}%
\Bunten{#1}{#2}{\@LabelABi}{\@LabelABii}\@AB%
\Bunten{#2}{#3}{\@分子}{\@分母}\@BC%
\Bunten{#3}{#1}{\@LabelCAi}{\@LabelCAii}\@CA%
\LandL{#1}{\@BC}{#2}{\@CA}\@Kouten%
\xdef\CevaPos{\@Kouten}%
\xdef\分点AB{\@AB}%
\xdef\分点BC{\@BC}%
\xdef\分点CA{\@CA}%
\if@ラベル%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#1\@AB{\fbox{$\@LabelABi$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@AB#2{\fbox{$\@LabelABii$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#2\@BC{$\@LabelBCi$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@BC#3{$\@LabelBCii$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#3\@CA{$\maru{\@LabelCAi}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@CA#1{$\maru{\@LabelCAii}$}%
\fi%
\if@描画%
{\thinlines%
\Hasen{#1\@BC}%
\Hasen{#2\@CA}%
\Hasen{#3\@AB}%
\Takakkei{#1#2#3}%
}%
\fi%
}%
\fi% End of \@BC=0
\ifnum\@CA=0{%
\IMul{\@LabelABi}{\@LabelBCi}{\@分子積}%
\IMul{\@LabelABii}{\@LabelBCii}{\@分母積}%
\BYakubun{\@分母積}{\@分子積}\@分子\@分母
\xdef#7{\@分子}%
\xdef#8{\@分母}%
\Bunten{#1}{#2}{\@LabelABi}{\@LabelABii}\@AB%
\Bunten{#2}{#3}{\@LabelBCi}{\@LabelBCii}\@BC%
\Bunten{#3}{#1}{\@分子}{\@分母}\@CA%
\LandL{#1}{\@BC}{#2}{\@CA}\@Kouten%
\xdef\CevaPos{\@Kouten}%
\xdef\分点AB{\@AB}%
\xdef\分点BC{\@BC}%
\xdef\分点CA{\@CA}%
\if@ラベル%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#1\@AB{$\maru{\@LabelABi}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@AB#2{$\maru{\@LabelABii}$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#2\@BC{\fbox{$\@LabelBCi$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@BC#3{\fbox{$\@LabelBCii$}}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>#3\@CA{$\@LabelCAi$}%
\HenKo<henkoH=8pt,hasenLG={2pt,2pt}>\@CA#1{$\@LabelCAii$}%
\fi%
\if@描画%
{\thinlines%
\Hasen{#1\@BC}%
\Hasen{#2\@CA}%
\Hasen{#3\@AB}%
\Takakkei{#1#2#3}%
}%
\fi%
}%
\fi% End of \@CA=0
}%
%--- File End ------------------------------------------------------------------------
\makeatother%

\begin{document}
\begin{zahyou*}[haiti=t,ul=5mm](-6,6)(0,7)%
\def\B{(0,0)}%
\def\C{(6,0)}%
\def\A{(2,5)}
\Menelaus**\A\B\C{2:3}{x:y}{1:2}\X\Y%
{\Thicklines%
%\Takakkei{\A\B\C}%
}%
\end{zahyou*}%

$x:y=\X:\Y$

\begin{zahyou*}[haiti=t,ul=5mm](-6,6)(0,7)%
\def\B{(0,0)}%
\def\C{(6,0)}%
\def\A{(2,5)}
\Ceva**\A\B\C{3:1}{4:3}{x:y}\X\Y%
{\Thicklines%
%\Takakkei{\A\B\C}%
}%
\end{zahyou*}%

$x:y=\X:\Y$

\end{document}
 



▼関連発言

897:メネラウスの定理とチェバの定理 [田中徹] 01/30 19:02<-last

Pass 保存


CGIROOM