# How can I make a list of exercises from a list of triples to write equation of the plan passing through three points?

I use proflycee to make a tex file like this

    \documentclass[12pt,a4paper]{article}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{nicefrac}
\usepackage[build]{ProfLycee}
\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}
\begin{document}
\begin{ex}
Une équation cartésienne du plan  passant par le points
$A\AffPoint(3/2,-2/3,-4/5)$,
$B\AffPoint(8,1,5)$ et $C\AffPoint(9,3,6)$ est
$\mathcal{R} \text{ : } \TrouveEqCartPlan[SimplifCoeffs,Facteur=-1](3/2,-2/3,-4/5)(8,1,5)(9,3,6).$
\end{ex}

$$\begin{ex} Une équation cartésienne du plan passant par le points A\AffPoint(1,0,0), B\AffPoint(0,1,0) et C\AffPoint(0,0,1) est $\mathcal{R} \text{ : } \TrouveEqCartPlan[SimplifCoeffs](1,0,0)(0,1,0)(0,0,1).$ \end{ex}$$
\end{document}


I got

With Mathematica, I tried

SetDirectory[NotebookDirectory[]];
Clear["Global*"];
pA = {3/2, -2/3, -4/5};
pB = {8, 1, 5};
pC = {9, 3, 6};
Subtract @@ Expand[CoplanarPoints[{pA, pB, pC, {x, y, z}}]]] ==
0;
toX[e_] :=
StringReplace[ToString[TeXForm[e]], {"\\}" -> ")", "\\{" -> "("}];
rep[s_String] := StringReplace[s, "," -> ";"];

fileName = FileNameJoin[{Directory[], "three_points_24_06_2024.tex"}]
If[FileExistsQ[fileName], DeleteFile[fileName]];
file = OpenWrite[fileName, PageWidth -> Infinity];
WriteString[file,
"\\documentclass[12pt,a4paper]{article}\n" <>
"\\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}\n\
" <> "\\usepackage{amsmath}\n" <> "\\usepackage{amsthm}\n" <>
"\\usepackage{esvect}\n" <> "\\theoremstyle{definition}\n" <>
"\\newtheorem{ex}{Exercise}\n" <> "\\begin{document}\n"];
WriteString[file,
"\\begin{ex}\n Une équation cartésienne du plan  passant par le \
points  $$A" <> rep@toX[pA] <> "$$ et $$B" <> rep@toX[pB] <> "$$, $$C" <> rep@toX[pC] <> "$$ est $$(P):" <> toX[myeq] <> ".$$ \n\\end{ex}\n"
];
WriteString[file, "\\end{document}\n"];
Close[file]


The TeX file I got

    \documentclass[12pt,a4paper]{article}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{esvect}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}
\begin{document}
\begin{ex}
Une e'quation carte'sienne du plan  passant par le points  $A\left(\frac{3}{2};-\frac{2}{3};-\frac{4}{5}\right)$ et $B(8;1;5)$, $C(9;3;6)$ est $(P):298 x+21 y-340 z-705=0.$
\end{ex}
\end{document}


and PDF file

With two Exercises, I tried

SetDirectory[NotebookDirectory[]];
Clear["Global*"];
pA = {3/2, -2/3, -4/5};
pB = {8, 1, 5};
pC = {9, 3, 6};
Subtract @@ Expand[CoplanarPoints[{pA, pB, pC, {x, y, z}}]]] ==
0;
pA1 = {1, 0, 0};
pB1 = {0, 1, 0};
pC1 = {0, 0, 1};
Subtract @@
Expand[CoplanarPoints[{pA1, pB1, pC1, {x, y, z}}]]] == 0;
toX[e_] :=
StringReplace[ToString[TeXForm[e]], {"\\}" -> ")", "\\{" -> "("}];
rep[s_String] := StringReplace[s, "," -> ";"];
fileName = FileNameJoin[{Directory[], "three_points_24_06_2024.tex"}]
If[FileExistsQ[fileName], DeleteFile[fileName]];
file = OpenWrite[fileName, PageWidth -> Infinity];
WriteString[file,
"\\documentclass[12pt,a4paper]{article}\n" <>
"\\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}\n\
" <> "\\usepackage{amsmath}\n" <> "\\usepackage{amsthm}\n" <>
"\\usepackage{esvect}\n" <> "\\theoremstyle{definition}\n" <>
"\\newtheorem{ex}{Exercise}\n" <> "\\begin{document}\n"];
WriteString[file,
"\\begin{ex}\n Une équation cartésienne du plan  passant par le \
points  $$A" <> rep@toX[pA] <> "$$ et $$B" <> rep@toX[pB] <> "$$, $$C" <> rep@toX[pC] <> "$$ est $$(P):" <> toX[myeq] <> ".$$ \n\\end{ex}\n
\\begin{ex}\n Une équation cartésienne du plan  passant par le points \
$$A" <> rep@toX[pA1] <> "$$ et $$B" <> rep@toX[pB1] <> "$$, $$C" <> rep@toX[pC1] <> "$$ est $$(P):" <> toX[myeq1] <> ".$$ \n\\end{ex}\n
"
];
WriteString[file, "\\end{document}\n"];
Close[file]


I got

    \documentclass[12pt,a4paper]{article}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{esvect}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}
\begin{document}
\begin{ex}
Une e'quation carte'sienne du plan  passant par le points  $A\left(\frac{3}{2};-\frac{2}{3};-\frac{4}{5}\right)$ et $B(8;1;5)$, $C(9;3;6)$ est $(P):\text{myeq}.$
\end{ex}

$$\begin{ex} Une e'quation carte'sienne du plan passant par le points A(1;0;0) et B(0;1;0), C(0;0;1) est (P):x+y+z-1=0. \end{ex}$$

\end{document}


How can I make a list of exercises from a list of triples?

list = {{{3/2, -2/3, -4/5}, {8, 1, 5}, {9, 3, 6}}, {{1, 0, 0}, {0, 1,
0}, {0, 0, 1}}};


It is almost here

SetDirectory[NotebookDirectory[]]
lis = {{{3/2, -2/3, -4/5}, {8, 1, 5}, {9, 3, 6}}, {{1, 0, 0}, {0, 1,
0}, {0, 0, 1}}};
data = Table[{pA, pB, pC} = points;
mylist = {pA, pB, pC,
Subtract @@ Expand[CoplanarPoints[{pA, pB, pC, {x, y, z}}]] ==
0}, {points, lis}]
toX[e_] :=
StringReplace[
ToString[TeXForm[e]], {"\\}" -> ")", "\\{" -> "(",
"\\frac" -> "\\dfrac"}];
rep[s_String] := StringReplace[s, "," -> ";"];
fileName = FileNameJoin[{Directory[], "three_points_24_06_2024.tex"}]
If[FileExistsQ[fileName], DeleteFile[fileName]];
file = OpenWrite[fileName, PageWidth -> Infinity];
WriteString[file,
"\\documentclass[12pt,a4paper]{article}\n" <>
"\\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}\n\
" <> "\\usepackage{amsmath}\n" <> "\\usepackage{amsthm}\n" <>
"\\usepackage{esvect}\n" <> "\\theoremstyle{definition}\n" <>
"\\newtheorem{ex}{Exercise}\n" <> "\\begin{document}\n"]; Do[
WriteString[file,
"\\begin{ex}\n" <>
"Une e'quation carte'sienne du plan  passant par le points $$A" <> rep@toX[data[[n, 1]]] <> "$$, $$B" <> rep@toX[data[[n, 2]]] <> "$$ et $$C" <> rep@toX[data[[n, 3]]] <> "$$ est $$" <> toX[data[[n, 4]]] <> ".$$\n\\end{ex}\n"], {n, 1, Length@data}];
WriteString[file, "\\end{document}\n"];
Close[file]


The TeX file

    \documentclass[12pt,a4paper]{article}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{esvect}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}
\begin{document}
\begin{ex}
Une e'quation carte'sienne du plan  passant par le points $A\left(\dfrac{3}{2};-\dfrac{2}{3};-\dfrac{4}{5}\right)$, $B(8;1;5)$ et $C(9;3;6)$ est $298 x+21 y-340 z-705=0.$
\end{ex}
\begin{ex}
Une e'quation carte'sienne du plan  passant par le points $A(1;0;0)$, $B(0;1;0)$ et $C(0;0;1)$ est $x+y+z-1=0.$
\end{ex}
\end{document}


Are you looking for a list of equations for the plane?

plane[pts_] :=
Det[ Prepend[
Append[#, 1] & /@ pts, {\[FormalX], \[FormalY], \[FormalZ], 1}]]

plane /@ list