diff options
Diffstat (limited to 'macros/latex/contrib/l3experimental/l3draw-points.dtx')
-rw-r--r-- | macros/latex/contrib/l3experimental/l3draw-points.dtx | 201 |
1 files changed, 104 insertions, 97 deletions
diff --git a/macros/latex/contrib/l3experimental/l3draw-points.dtx b/macros/latex/contrib/l3experimental/l3draw-points.dtx index f722873237..19e69d4b38 100644 --- a/macros/latex/contrib/l3experimental/l3draw-points.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-points.dtx @@ -2,7 +2,7 @@ % %% File: l3draw-points.dtx % -% Copyright (C) 2018-2023 The LaTeX Project +% Copyright (C) 2018-2024 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-12-08} +% \date{Released 2024-01-04} % % \maketitle % @@ -70,10 +70,10 @@ % \item \cs{pgfpointadd}, \cs{pgfpointdiff}, % \cs{pgfpointscale}: Can be given explicitly. % \item \cs{pgfextractx}, \cs{pgfextracty}: Available by applying -% \cs{use_i:nn}/\cs{use_ii:nn} or similar to the \texttt{x}-type +% \cs{use_i:nn}/\cs{use_ii:nn} or similar to the \texttt{e}-type % expansion of a point expression. % \item \cs{pgfgetlastxy}: Unused in the entire \pkg{pgf} core, may be -% emulated by \texttt{x}-type expansion of a point expression, then using +% emulated by \texttt{e}-type expansion of a point expression, then using % the result. % \end{itemize} % In addition, equivalents of the following \emph{may} be added in future but @@ -93,16 +93,18 @@ % \subsection{Support functions} % % \begin{macro}[EXP]{\@@_point_process:nn} -% \begin{macro}[EXP]{\@@_point_process_auxi:nn} +% \begin{macro}[EXP]{\@@_point_process_auxi:nn, \@@_point_process_auxi:en} % \begin{macro}[EXP]{\@@_point_process_auxii:nw} % \begin{macro}[EXP]{\@@_point_process:nnn} -% \begin{macro}[EXP]{\@@_point_process_auxiii:nnn} +% \begin{macro}[EXP]{\@@_point_process_auxiii:nnn, \@@_point_process_auxiii:een} % \begin{macro}[EXP]{\@@_point_process_auxiv:nw} % \begin{macro}[EXP]{\@@_point_process:nnnn} -% \begin{macro}[EXP]{\@@_point_process_auxv:nnnn} +% \begin{macro}[EXP] +% {\@@_point_process_auxv:nnnn, \@@_point_process_auxv:eeen} % \begin{macro}[EXP]{\@@_point_process_auxvi:nw} % \begin{macro}[EXP]{\@@_point_process:nnnnn} -% \begin{macro}[EXP]{\@@_point_process_auxvii:nnnnn} +% \begin{macro}[EXP] +% {\@@_point_process_auxvii:nnnnn, \@@_point_process_auxvii:eeeen} % \begin{macro}[EXP]{\@@_point_process_auxviii:nw} % Execute whatever code is passed to extract the $x$ and $y$ co-ordinates. % The first argument here should itself absorb two arguments. There is @@ -111,28 +113,30 @@ % \begin{macrocode} \cs_new:Npn \@@_point_process:nn #1#2 { - \exp_args:Nf \@@_point_process_auxi:nn + \@@_point_process_auxi:en { \draw_point:n {#2} } {#1} } \cs_new:Npn \@@_point_process_auxi:nn #1#2 { \@@_point_process_auxii:nw {#2} #1 \s_@@_stop } +\cs_generate_variant:Nn \@@_point_process_auxi:nn { e } \cs_new:Npn \@@_point_process_auxii:nw #1 #2 , #3 \s_@@_stop { #1 {#2} {#3} } \cs_new:Npn \@@_point_process:nnn #1#2#3 { - \exp_args:Nff \@@_point_process_auxiii:nnn + \@@_point_process_auxiii:een { \draw_point:n {#2} } { \draw_point:n {#3} } {#1} } \cs_new:Npn \@@_point_process_auxiii:nnn #1#2#3 { \@@_point_process_auxiv:nw {#3} #1 \s_@@_mark #2 \s_@@_stop } +\cs_generate_variant:Nn \@@_point_process_auxiii:nnn { ee } \cs_new:Npn \@@_point_process_auxiv:nw #1 #2 , #3 \s_@@_mark #4 , #5 \s_@@_stop { #1 {#2} {#3} {#4} {#5} } \cs_new:Npn \@@_point_process:nnnn #1#2#3#4 { - \exp_args:Nfff \@@_point_process_auxv:nnnn + \@@_point_process_auxv:eeen { \draw_point:n {#2} } { \draw_point:n {#3} } { \draw_point:n {#4} } @@ -140,12 +144,13 @@ } \cs_new:Npn \@@_point_process_auxv:nnnn #1#2#3#4 { \@@_point_process_auxvi:nw {#4} #1 \s_@@_mark #2 \s_@@_mark #3 \s_@@_stop } +\cs_generate_variant:Nn \@@_point_process_auxv:nnnn { eee } \cs_new:Npn \@@_point_process_auxvi:nw #1 #2 , #3 \s_@@_mark #4 , #5 \s_@@_mark #6 , #7 \s_@@_stop { #1 {#2} {#3} {#4} {#5} {#6} {#7} } \cs_new:Npn \@@_point_process:nnnnn #1#2#3#4#5 { - \exp_args:Nffff \@@_point_process_auxvii:nnnnn + \@@_point_process_auxvii:eeeen { \draw_point:n {#2} } { \draw_point:n {#3} } { \draw_point:n {#4} } @@ -157,6 +162,7 @@ \@@_point_process_auxviii:nw {#5} #1 \s_@@_mark #2 \s_@@_mark #3 \s_@@_mark #4 \s_@@_stop } +\cs_generate_variant:Nn \@@_point_process_auxvii:nnnnn { eeee } \cs_new:Npn \@@_point_process_auxviii:nw #1 #2 , #3 \s_@@_mark #4 , #5 \s_@@_mark #6 , #7 \s_@@_mark #8 , #9 \s_@@_stop { #1 {#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} } @@ -177,15 +183,15 @@ % \subsection{Basic points} % % \begin{macro}[EXP]{\draw_point:n} -% \begin{macro}[EXP]{\@@_point_to_dim:n, \@@_point_to_dim:f} +% \begin{macro}[EXP]{\@@_point_to_dim:n, \@@_point_to_dim:e} % \begin{macro}[EXP]{\@@_point_to_dim:w} % Co-ordinates are always returned as two dimensions. % \begin{macrocode} \cs_new:Npn \draw_point:n #1 - { \@@_point_to_dim:f { \fp_eval:n {#1} } } + { \@@_point_to_dim:e { \fp_eval:n {#1} } } \cs_new:Npn \@@_point_to_dim:n #1 { \@@_point_to_dim:w #1 } -\cs_generate_variant:Nn \@@_point_to_dim:n { f } +\cs_generate_variant:Nn \@@_point_to_dim:n { e } \cs_new:Npn \@@_point_to_dim:w ( #1 , ~ #2 ) { #1pt , #2pt } % \end{macrocode} % \end{macro} @@ -195,7 +201,7 @@ % % \begin{macro}[EXP]{\draw_point_polar:nn} % \begin{macro}[EXP]{\draw_point_polar:nnn} -% \begin{macro}[EXP]{\@@_draw_polar:nnn, \@@_draw_polar:fnn} +% \begin{macro}[EXP]{\@@_draw_polar:nnn, \@@_draw_polar:enn} % Polar co-ordinates may have either one or two lengths, so there is a need % to do a simple split before the calculation. As the angle gets used twice, % save on any expression evaluation there and force expansion. @@ -203,10 +209,10 @@ \cs_new:Npn \draw_point_polar:nn #1#2 { \draw_point_polar:nnn {#1} {#1} {#2} } \cs_new:Npn \draw_point_polar:nnn #1#2#3 - { \@@_draw_polar:fnn { \fp_eval:n {#3} } {#1} {#2} } + { \@@_draw_polar:enn { \fp_eval:n {#3} } {#1} {#2} } \cs_new:Npn \@@_draw_polar:nnn #1#2#3 { \draw_point:n { cosd(#1) * (#2) , sind(#1) * (#3) } } -\cs_generate_variant:Nn \@@_draw_polar:nnn { f } +\cs_generate_variant:Nn \@@_draw_polar:nnn { e } % \end{macrocode} % \end{macro} % \end{macro} @@ -218,7 +224,7 @@ % % \begin{macro}[EXP]{\draw_point_unit_vector:n} % \begin{macro}[EXP]{\@@_point_unit_vector:nn} -% \begin{macro}[EXP]{\@@_point_unit_vector:nnn} +% \begin{macro}[EXP]{\@@_point_unit_vector:nnn, \@@_point_unit_vector:enn} % The outcome is the normalised vector from $(0,0)$ in the direction of % the point, \emph{i.e.} % \[ @@ -232,7 +238,7 @@ { \@@_point_process:nn { \@@_point_unit_vector:nn } {#1} } \cs_new:Npn \@@_point_unit_vector:nn #1#2 { - \exp_args:Nf \@@_point_unit_vector:nnn + \@@_point_unit_vector:nnn { \fp_eval:n { (sqrt(#1 * #1 + #2 * #2)) } } {#1} {#2} } @@ -245,6 +251,7 @@ { ( #2 , #3 ) / #1 } } } +\cs_generate_variant:Nn \@@_point_unit_vector:nnn { e } % \end{macrocode} % \end{macro} % \end{macro} @@ -256,7 +263,7 @@ % \begin{macro}[EXP]{\@@_point_intersect_lines:nnnnnn} % \begin{macro}[EXP]{\@@_point_intersect_lines:nnnnnnnn} % \begin{macro}[EXP] -% {\@@_point_intersect_lines_aux:nnnnnn, \@@_point_intersect_lines_aux:ffffff} +% {\@@_point_intersect_lines_aux:nnnnnn, \@@_point_intersect_lines_aux:eeeeee} % The intersection point~$P$ between a line joining points $(x_{1}, y_{1})$ % and $(x_{2}, y_{2})$ with a second line joining points $(x_{3}, y_{3})$ % and $(x_{4}, y_{4})$ can be calculated using the formulae @@ -300,7 +307,7 @@ % \begin{macrocode} \cs_new:Npn \@@_point_intersect_lines:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_lines_aux:ffffff + \@@_point_intersect_lines_aux:eeeeee { \fp_eval:n { #1 * #4 - #2 * #3 } } { \fp_eval:n { #5 * #8 - #6 * #7 } } { \fp_eval:n { #1 - #3 } } @@ -316,7 +323,7 @@ / ( #4 * #5 - #6 * #3 ) } } -\cs_generate_variant:Nn \@@_point_intersect_lines_aux:nnnnnn { ffffff } +\cs_generate_variant:Nn \@@_point_intersect_lines_aux:nnnnnn { eeeeee } % \end{macrocode} % \end{macro} % \end{macro} @@ -328,29 +335,29 @@ % \begin{macro}[EXP] % { % \@@_point_intersect_circles_auxii:nnnnnnn, -% \@@_point_intersect_circles_auxii:ffnnnnn, +% \@@_point_intersect_circles_auxii:eennnnn, % \@@_point_intersect_circles_auxiii:nnnnnnn, -% \@@_point_intersect_circles_auxiii:ffnnnnn +% \@@_point_intersect_circles_auxiii:eennnnn % } % \begin{macro}[EXP] % { % \@@_point_intersect_circles_auxiv:nnnnnnnn, -% \@@_point_intersect_circles_auxiv:fnnnnnnn +% \@@_point_intersect_circles_auxiv:ennnnnnn % } % \begin{macro}[EXP] % { % \@@_point_intersect_circles_auxv:nnnnnnnnn, -% \@@_point_intersect_circles_auxv:ffnnnnnnn +% \@@_point_intersect_circles_auxv:eennnnnnn % } % \begin{macro}[EXP] % { % \@@_point_intersect_circles_auxvi:nnnnnnnn, -% \@@_point_intersect_circles_auxvi:fnnnnnnn +% \@@_point_intersect_circles_auxvi:ennnnnnn % } % \begin{macro}[EXP] % { % \@@_point_intersect_circles_auxvii:nnnnnnn, -% \@@_point_intersect_circles_auxvii:fffnnnn +% \@@_point_intersect_circles_auxvii:eeennnn % } % Another long expansion chain to get the values in the right places. % We have two circles, the first with center $(a, b)$ and radius~$r$, @@ -383,7 +390,7 @@ } \cs_new:Npn \@@_point_intersect_circles_auxi:nnnnnnn #1#2#3#4#5#6#7 { - \@@_point_intersect_circles_auxii:ffnnnnn + \@@_point_intersect_circles_auxii:eennnnn { \fp_eval:n {#1} } { \fp_eval:n {#2} } {#4} {#5} {#6} {#7} {#3} } % \end{macrocode} @@ -403,19 +410,19 @@ % \begin{macrocode} \cs_new:Npn \@@_point_intersect_circles_auxii:nnnnnnn #1#2#3#4#5#6#7 { - \@@_point_intersect_circles_auxiii:ffnnnnn + \@@_point_intersect_circles_auxiii:eennnnn { \fp_eval:n { #5 - #3 } } { \fp_eval:n { #6 - #4 } } {#1} {#2} {#3} {#4} {#7} } -\cs_generate_variant:Nn \@@_point_intersect_circles_auxii:nnnnnnn { ff } +\cs_generate_variant:Nn \@@_point_intersect_circles_auxii:nnnnnnn { ee } \cs_new:Npn \@@_point_intersect_circles_auxiii:nnnnnnn #1#2#3#4#5#6#7 { - \@@_point_intersect_circles_auxiv:fnnnnnnn + \@@_point_intersect_circles_auxiv:ennnnnnn { \fp_eval:n { sqrt( #1 * #1 + #2 * #2 ) } } {#1} {#2} {#3} {#4} {#5} {#6} {#7} } -\cs_generate_variant:Nn \@@_point_intersect_circles_auxiii:nnnnnnn { ff } +\cs_generate_variant:Nn \@@_point_intersect_circles_auxiii:nnnnnnn { ee } % \end{macrocode} % We now have $p$: we pre-calculate $1/p$ as it is needed a few times and % is relatively expensive. We also need $r^{2}$ twice so deal with that @@ -423,19 +430,19 @@ % \begin{macrocode} \cs_new:Npn \@@_point_intersect_circles_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_circles_auxv:ffnnnnnnn + \@@_point_intersect_circles_auxv:eennnnnnn { \fp_eval:n { 1 / #1 } } { \fp_eval:n { #4 * #4 } } {#1} {#2} {#3} {#5} {#6} {#7} {#8} } -\cs_generate_variant:Nn \@@_point_intersect_circles_auxiv:nnnnnnnn { f } +\cs_generate_variant:Nn \@@_point_intersect_circles_auxiv:nnnnnnnn { e } \cs_new:Npn \@@_point_intersect_circles_auxv:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { - \@@_point_intersect_circles_auxvi:fnnnnnnn + \@@_point_intersect_circles_auxvi:ennnnnnn { \fp_eval:n { 0.5 * #1 * ( #2 + #3 * #3 - #6 * #6 ) } } {#1} {#2} {#4} {#5} {#7} {#8} {#9} } -\cs_generate_variant:Nn \@@_point_intersect_circles_auxv:nnnnnnnnn { ff } +\cs_generate_variant:Nn \@@_point_intersect_circles_auxv:nnnnnnnnn { ee } % \end{macrocode} % We now have all of the intermediate values we require, with one division % carried out up-front to avoid doing this expensive step twice: @@ -455,19 +462,19 @@ % \begin{macrocode} \cs_new:Npn \@@_point_intersect_circles_auxvi:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_circles_auxvii:fffnnnn + \@@_point_intersect_circles_auxvii:eeennnn { \fp_eval:n { #1 * #2 } } { \int_if_odd:nTF {#8} { 1 } { -1 } } { \fp_eval:n { sqrt ( #3 - #1 * #1 ) * #2 } } {#4} {#5} {#6} {#7} } -\cs_generate_variant:Nn \@@_point_intersect_circles_auxvi:nnnnnnnn { f } +\cs_generate_variant:Nn \@@_point_intersect_circles_auxvi:nnnnnnnn { e } \cs_new:Npn \@@_point_intersect_circles_auxvii:nnnnnnn #1#2#3#4#5#6#7 { \draw_point:n { #6 + #4 * #1 + #2 * #3 * #5 , #7 + #5 * #1 + -1 * #2 * #3 * #4 } } -\cs_generate_variant:Nn \@@_point_intersect_circles_auxvii:nnnnnnn { fff } +\cs_generate_variant:Nn \@@_point_intersect_circles_auxvii:nnnnnnn { eee } % \end{macrocode} % \end{macro} % \end{macro} @@ -482,19 +489,19 @@ % \begin{macro}[EXP] % { % \@@_point_intersect_line_circle_auxii:nnnnnnnn, -% \@@_point_intersect_line_circle_auxii:fnnnnnnn, +% \@@_point_intersect_line_circle_auxii:ennnnnnn, % \@@_point_intersect_line_circle_auxiii:nnnnnnnn, -% \@@_point_intersect_line_circle_auxiii:fffnnnnn +% \@@_point_intersect_line_circle_auxiii:eeennnnn % } % \begin{macro}[EXP] % { % \@@_point_intersect_line_circle_auxiv:nnnnnnnn, -% \@@_point_intersect_line_circle_auxiv:ffnnnnnn +% \@@_point_intersect_line_circle_auxiv:eennnnnn % } % \begin{macro}[EXP] % { % \@@_point_intersect_line_circle_auxv:nnnnn, -% \@@_point_intersect_line_circle_auxv:fnnnn +% \@@_point_intersect_line_circle_auxv:ennnn % } % The intersection points~$P_{1}$ and~$P_{2}$ between % a line joining points $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$ @@ -531,7 +538,7 @@ } \cs_new:Npn \@@_point_intersect_line_circle_auxi:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_line_circle_auxii:fnnnnnnn + \@@_point_intersect_line_circle_auxii:ennnnnnn { \fp_eval:n {#1} } {#3} {#4} {#5} {#6} {#7} {#8} {#2} } % \end{macrocode} @@ -552,24 +559,24 @@ % \begin{macrocode} \cs_new:Npn \@@_point_intersect_line_circle_auxii:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_line_circle_auxiii:fffnnnnn + \@@_point_intersect_line_circle_auxiii:eeennnnn { \fp_eval:n { (#4-#2)*(#4-#2)+(#5-#3)*(#5-#3) } } { \fp_eval:n { 2*((#4-#2)*(#2-#6)+(#5-#3)*(#3-#7)) } } { \fp_eval:n { (#6*#6+#7*#7)+(#2*#2+#3*#3)-(2*(#6*#2+#7*#3))-(#1*#1) } } {#2} {#3} {#4} {#5} {#8} } -\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxii:nnnnnnnn { f } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxii:nnnnnnnn { e } % \end{macrocode} % then we can get $d = b^{2} - 4\times a \times c$ and the usage of $n$. % \begin{macrocode} \cs_new:Npn \@@_point_intersect_line_circle_auxiii:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_line_circle_auxiv:ffnnnnnn + \@@_point_intersect_line_circle_auxiv:eennnnnn { \fp_eval:n { #2 * #2 - 4 * #1 * #3 } } { \int_if_odd:nTF {#8} { 1 } { -1 } } {#1} {#2} {#4} {#5} {#6} {#7} } -\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxiii:nnnnnnnn { fff } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxiii:nnnnnnnn { eee } % \end{macrocode} % We now have all of the intermediate values we require, with one division % carried out up-front to avoid doing this expensive step twice: @@ -590,17 +597,17 @@ % \begin{macrocode} \cs_new:Npn \@@_point_intersect_line_circle_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_intersect_line_circle_auxv:fnnnn + \@@_point_intersect_line_circle_auxv:ennnn { \fp_eval:n { (-1 * #4 + #2 * sqrt(#1)) / (2 * #3) } } {#5} {#6} {#7} {#8} } -\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxiv:nnnnnnnn { ff } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxiv:nnnnnnnn { ee } \cs_new:Npn \@@_point_intersect_line_circle_auxv:nnnnn #1#2#3#4#5 { \draw_point:n { #2 + #1 * (#4 - #2), #3 + #1 * (#5 - #3) } } -\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxv:nnnnn { f } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxv:nnnnn { e } % \end{macrocode} % \end{macro} % \end{macro} @@ -614,30 +621,30 @@ % \begin{macro}[EXP] % { % \@@_point_interpolate_line_aux:nnnnn, -% \@@_point_interpolate_line_aux:fnnnn, +% \@@_point_interpolate_line_aux:ennnn, % } % \begin{macro}[EXP] % { % \@@_point_interpolate_line_aux:nnnnnn, -% \@@_point_interpolate_line_aux:fnnnnn, +% \@@_point_interpolate_line_aux:ennnnn, % } % Simple maths after expansion. % \begin{macrocode} \cs_new:Npn \draw_point_interpolate_line:nnn #1#2#3 { \@@_point_process:nnn - { \@@_point_interpolate_line_aux:fnnnn { \fp_eval:n {#1} } } + { \@@_point_interpolate_line_aux:ennnn { \fp_eval:n {#1} } } {#2} {#3} } \cs_new:Npn \@@_point_interpolate_line_aux:nnnnn #1#2#3#4#5 { - \@@_point_interpolate_line_aux:fnnnnn { \fp_eval:n { 1 - #1 } } + \@@_point_interpolate_line_aux:ennnnn { \fp_eval:n { 1 - #1 } } {#1} {#2} {#3} {#4} {#5} } -\cs_generate_variant:Nn \@@_point_interpolate_line_aux:nnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_line_aux:nnnnn { e } \cs_new:Npn \@@_point_interpolate_line_aux:nnnnnn #1#2#3#4#5#6 { \draw_point:n { #2 * #3 + #1 * #5 , #2 * #4 + #1 * #6 } } -\cs_generate_variant:Nn \@@_point_interpolate_line_aux:nnnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_line_aux:nnnnnn { e } % \end{macrocode} % \end{macro} % \end{macro} @@ -648,7 +655,7 @@ % \begin{macro}[EXP] % { % \@@_point_interpolate_distance:nnnnnn, -% \@@_point_interpolate_distance:fnnnnn, +% \@@_point_interpolate_distance:ennnnn, % } % Same idea but using the normalised length to obtain the scale factor. % The start point is needed twice, so we force evaluation, but the end @@ -664,14 +671,14 @@ { \@@_point_process:nn { - \@@_point_interpolate_distance:fnnnn + \@@_point_interpolate_distance:ennnn { \fp_eval:n {#1} } {#3} {#4} } { \draw_point_unit_vector:n { ( #2 ) - ( #3 , #4 ) } } } \cs_new:Npn \@@_point_interpolate_distance:nnnnn #1#2#3#4#5 { \draw_point:n { #2 + #1 * #4 , #3 + #1 * #5 } } -\cs_generate_variant:Nn \@@_point_interpolate_distance:nnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_distance:nnnnn { e } % \end{macrocode} % \end{macro} % \end{macro} @@ -683,17 +690,17 @@ % \begin{macro}[EXP] % { % \@@_point_interpolate_arcaxes_auxii:nnnnnnnnn, -% \@@_point_interpolate_arcaxes_auxii:fnnnnnnnn +% \@@_point_interpolate_arcaxes_auxii:ennnnnnnn % } % \begin{macro}[EXP] % { % \@@_point_interpolate_arcaxes_auxiii:nnnnnnn, -% \@@_point_interpolate_arcaxes_auxiii:fnnnnnn +% \@@_point_interpolate_arcaxes_auxiii:ennnnnn % } % \begin{macro}[EXP] % { % \@@_point_interpolate_arcaxes_auxiv:nnnnnnnn, -% \@@_point_interpolate_arcaxes_auxiv:ffnnnnnn +% \@@_point_interpolate_arcaxes_auxiv:eennnnnn % } % Finding a point on an ellipse arc is relatively easy: find the correct % angle between the two given, use the sine and cosine of that angle, @@ -708,7 +715,7 @@ } \cs_new:Npn \@@_point_interpolate_arcaxes_auxi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { - \@@_point_interpolate_arcaxes_auxii:fnnnnnnnn + \@@_point_interpolate_arcaxes_auxii:ennnnnnnn { \fp_eval:n {#1} } {#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} } % \end{macrocode} @@ -730,25 +737,25 @@ % \begin{macrocode} \cs_new:Npn \@@_point_interpolate_arcaxes_auxii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { - \@@_point_interpolate_arcaxes_auxiii:fnnnnnn + \@@_point_interpolate_arcaxes_auxiii:ennnnnn { \fp_eval:n { #1 * (#3) + ( 1 - #1 ) * (#2) } } {#4} {#5} {#6} {#7} {#8} {#9} } -\cs_generate_variant:Nn \@@_point_interpolate_arcaxes_auxii:nnnnnnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_arcaxes_auxii:nnnnnnnnn { e } \cs_new:Npn \@@_point_interpolate_arcaxes_auxiii:nnnnnnn #1#2#3#4#5#6#7 { - \@@_point_interpolate_arcaxes_auxiv:ffnnnnnn + \@@_point_interpolate_arcaxes_auxiv:eennnnnn { \fp_eval:n { cosd (#1) } } { \fp_eval:n { sind (#1) } } {#2} {#3} {#4} {#5} {#6} {#7} } -\cs_generate_variant:Nn \@@_point_interpolate_arcaxes_auxiii:nnnnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_arcaxes_auxiii:nnnnnnn { e } \cs_new:Npn \@@_point_interpolate_arcaxes_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 { \draw_point:n { #3 + #1 * #5 + #2 * #7 , #4 + #1 * #6 + #2 * #8 } } -\cs_generate_variant:Nn \@@_point_interpolate_arcaxes_auxiv:nnnnnnnn { ff } +\cs_generate_variant:Nn \@@_point_interpolate_arcaxes_auxiv:nnnnnnnn { ee } % \end{macrocode} % \end{macro} % \end{macro} @@ -761,25 +768,25 @@ % \begin{macro}[EXP] % { % \draw_point_interpolate_curve_auxii:nnnnnnnnn, -% \draw_point_interpolate_curve_auxii:fnnnnnnnn, +% \draw_point_interpolate_curve_auxii:ennnnnnnn, % } % \begin{macro}[EXP] % { % \draw_point_interpolate_curve_auxiii:nnnnnn, -% \draw_point_interpolate_curve_auxiii:fnnnnn, +% \draw_point_interpolate_curve_auxiii:ennnnn, % } % \begin{macro}[EXP]{\draw_point_interpolate_curve_auxiv:nnnnnn} % \begin{macro}[EXP] % { % \draw_point_interpolate_curve_auxv:nnw, -% \draw_point_interpolate_curve_auxv:ffw, +% \draw_point_interpolate_curve_auxv:eew, % } % \begin{macro}[EXP]{\draw_point_interpolate_curve_auxvi:n} % \begin{macro}[EXP]{\draw_point_interpolate_curve_auxvii:nnnnnnnn} % \begin{macro}[EXP] % { % \draw_point_interpolate_curve_auxviii:nnnnnn, -% \draw_point_interpolate_curve_auxviii:ffnnnn, +% \draw_point_interpolate_curve_auxviii:eennnn, % } % Here we start with a proportion of the curve ($p$) and four points % \begin{enumerate} @@ -798,7 +805,7 @@ } \cs_new:Npn \@@_point_interpolate_curve_auxi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { - \@@_point_interpolate_curve_auxii:fnnnnnnnn + \@@_point_interpolate_curve_auxii:ennnnnnnn { \fp_eval:n {#1} } {#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} } @@ -831,15 +838,15 @@ \cs_new:Npn \@@_point_interpolate_curve_auxii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { - \@@_point_interpolate_curve_auxiii:fnnnnn + \@@_point_interpolate_curve_auxiii:ennnnn { \fp_eval:n { 1 - #1 } } {#1} { {#2} {#3} } { {#4} {#5} } { {#6} {#7} } { {#8} {#9} } } -\cs_generate_variant:Nn \@@_point_interpolate_curve_auxii:nnnnnnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_curve_auxii:nnnnnnnnn { e } % \begin{macrocode} % We need to do the first cycle, but haven't got enough arguments to keep -% everything in play at once. So her ewe use a but of argument re-ordering +% everything in play at once. So here we use a bit of argument re-ordering % and a single auxiliary to get the job done. % \begin{macrocode} \cs_new:Npn \@@_point_interpolate_curve_auxiii:nnnnnn #1#2#3#4#5#6 @@ -850,10 +857,10 @@ \prg_do_nothing: \@@_point_interpolate_curve_auxvi:n { {#1} {#2} } } -\cs_generate_variant:Nn \@@_point_interpolate_curve_auxiii:nnnnnn { f } +\cs_generate_variant:Nn \@@_point_interpolate_curve_auxiii:nnnnnn { e } \cs_new:Npn \@@_point_interpolate_curve_auxiv:nnnnnn #1#2#3#4#5#6 { - \@@_point_interpolate_curve_auxv:ffw + \@@_point_interpolate_curve_auxv:eew { \fp_eval:n { #1 * #3 + #2 * #5 } } { \fp_eval:n { #1 * #4 + #2 * #6 } } } @@ -864,7 +871,7 @@ \prg_do_nothing: #4 { #5 {#1} {#2} } } -\cs_generate_variant:Nn \@@_point_interpolate_curve_auxv:nnw { ff } +\cs_generate_variant:Nn \@@_point_interpolate_curve_auxv:nnw { ee } % \begin{macrocode} % Get the arguments back into the right places and to the second and % third cycles directly. @@ -873,7 +880,7 @@ { \@@_point_interpolate_curve_auxvii:nnnnnnnn #1 } \cs_new:Npn \@@_point_interpolate_curve_auxvii:nnnnnnnn #1#2#3#4#5#6#7#8 { - \@@_point_interpolate_curve_auxviii:ffffnn + \@@_point_interpolate_curve_auxviii:eeeenn { \fp_eval:n { #1 * #5 + #2 * #3 } } { \fp_eval:n { #1 * #6 + #2 * #4 } } { \fp_eval:n { #1 * #7 + #2 * #5 } } @@ -885,7 +892,7 @@ \draw_point:n { #5 * #3 + #6 * #1 , #5 * #4 + #6 * #2 } } -\cs_generate_variant:Nn \@@_point_interpolate_curve_auxviii:nnnnnn { ffff } +\cs_generate_variant:Nn \@@_point_interpolate_curve_auxviii:nnnnnn { eeee } % \end{macrocode} % \end{macro} % \end{macro} @@ -954,14 +961,14 @@ % \end{macrocode} % % \begin{macro}[EXP]{\draw_point_vec:nn} -% \begin{macro}[EXP]{\@@_point_vec:nn, \@@_point_vec:ff} +% \begin{macro}[EXP]{\@@_point_vec:nn, \@@_point_vec:ee} % \begin{macro}[EXP]{\draw_point_vec:nnn} -% \begin{macro}[EXP]{\@@_point_vec:nnn, \@@_point_vec:fff} +% \begin{macro}[EXP]{\@@_point_vec:nnn, \@@_point_vec:eee} % Force a single evaluation of each factor, then use these to work out the % underlying point. % \begin{macrocode} \cs_new:Npn \draw_point_vec:nn #1#2 - { \@@_point_vec:ff { \fp_eval:n {#1} } { \fp_eval:n {#2} } } + { \@@_point_vec:ee { \fp_eval:n {#1} } { \fp_eval:n {#2} } } \cs_new:Npn \@@_point_vec:nn #1#2 { \draw_point:n @@ -970,26 +977,26 @@ #1 * \l_@@_xvec_y_dim + #2 * \l_@@_yvec_y_dim } } -\cs_generate_variant:Nn \@@_point_vec:nn { ff } +\cs_generate_variant:Nn \@@_point_vec:nn { ee } \cs_new:Npn \draw_point_vec:nnn #1#2#3 { - \@@_point_vec:fff + \@@_point_vec:eee { \fp_eval:n {#1} } { \fp_eval:n {#2} } { \fp_eval:n {#3} } } \cs_new:Npn \@@_point_vec:nnn #1#2#3 { \draw_point:n { - #1 * \l_@@_xvec_x_dim - + #2 * \l_@@_yvec_x_dim - + #3 * \l_@@_zvec_x_dim + #1 * \l_@@_xvec_x_dim + + #2 * \l_@@_yvec_x_dim + + #3 * \l_@@_zvec_x_dim , #1 * \l_@@_xvec_y_dim + #2 * \l_@@_yvec_y_dim + #3 * \l_@@_zvec_y_dim } } -\cs_generate_variant:Nn \@@_point_vec:nnn { fff } +\cs_generate_variant:Nn \@@_point_vec:nnn { eee } % \end{macrocode} % \end{macro} % \end{macro} @@ -998,22 +1005,22 @@ % % \begin{macro}[EXP]{\draw_point_vec_polar:nn} % \begin{macro}[EXP]{\draw_point_vec_polar:nnn} -% \begin{macro}[EXP]{\@@_point_vec_polar:nnn, \@@_point_vec_polar:fnn} +% \begin{macro}[EXP]{\@@_point_vec_polar:nnn, \@@_point_vec_polar:enn} % Much the same as the core polar approach. % \begin{macrocode} \cs_new:Npn \draw_point_vec_polar:nn #1#2 { \draw_point_vec_polar:nnn {#1} {#1} {#2} } \cs_new:Npn \draw_point_vec_polar:nnn #1#2#3 - { \@@_draw_vec_polar:fnn { \fp_eval:n {#3} } {#1} {#2} } + { \@@_draw_vec_polar:enn { \fp_eval:n {#3} } {#1} {#2} } \cs_new:Npn \@@_draw_vec_polar:nnn #1#2#3 { \draw_point:n { cosd(#1) * (#2) * \l_@@_xvec_x_dim , sind(#1) * (#3) * \l_@@_yvec_y_dim - } + } } -\cs_generate_variant:Nn \@@_draw_vec_polar:nnn { f } +\cs_generate_variant:Nn \@@_draw_vec_polar:nnn { e } % \end{macrocode} % \end{macro} % \end{macro} |