[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3draw: Correct line-intersection code (78c5545)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Feb 9 10:53:15 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/78c554564a7fa5d4fb9dfd6253bbf70409d88c14

>---------------------------------------------------------------

commit 78c554564a7fa5d4fb9dfd6253bbf70409d88c14
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Feb 9 09:50:29 2018 +0000

    l3draw: Correct line-intersection code


>---------------------------------------------------------------

78c554564a7fa5d4fb9dfd6253bbf70409d88c14
 l3trial/l3draw/l3draw-points.dtx |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/l3trial/l3draw/l3draw-points.dtx b/l3trial/l3draw/l3draw-points.dtx
index 2a85aa4..b07db74 100644
--- a/l3trial/l3draw/l3draw-points.dtx
+++ b/l3trial/l3draw/l3draw-points.dtx
@@ -265,6 +265,20 @@
       \@@_point_intersect_lines:nnnnnnnn
       {#1} {#2} {#3} {#4}
   }
+%    \end{macrocode}
+%   At this stage we have all of the information we need, fully expanded:
+%   \begin{enumerate}[label = \#\arabic*, font = \ttfamily]
+%     \item $x_{3}$
+%     \item $y_{3}$
+%     \item $x_{4}$
+%     \item $y_{4}$
+%     \item $x_{1}$
+%     \item $y_{1}$
+%     \item $x_{2}$
+%     \item $y_{2}$
+%   \end{enumerate}
+%   so now just have to do all of the calculation.
+%    \begin{macrocode}
 \cs_new:Npn \@@_point_intersect_lines:nnnnnnnn #1#2#3#4#5#6#7#8
   {
     \@@_point_intersect_lines_aux:ffffff
@@ -278,14 +292,14 @@
 \cs_new:Npn \@@_point_intersect_lines_aux:nnnnnn #1#2#3#4#5#6
   {
     \@@_point_intersect_lines_aux:fnnnnnn
-      { \fp_eval:n { #3 * #6 - #5 * #4 } }
+      { \fp_eval:n { #4 * #5 - #6 * #3 } }
       {#1} {#2} {#3} {#4} {#5} {#6}
   }
 \cs_generate_variant:Nn \@@_point_intersect_lines_aux:nnnnnn { ffffff }
 \cs_new:Npn \@@_point_intersect_lines_aux:nnnnnnn #1#2#3#4#5#6#7
   {
-    { \fp_to_dim:n { (#2 * #5 - #3 * #6 ) / #1 } }
-    { \fp_to_dim:n { (#2 * #7 - #3 * #6 ) / #1 } }
+    { \fp_to_dim:n { ( #3 * #4 - #2 * #5 ) / #1 } }
+    { \fp_to_dim:n { ( #3 * #6 - #2 * #7 ) / #1 } }
   }
 \cs_generate_variant:Nn \@@_point_intersect_lines_aux:nnnnnnn { f }
 %    \end{macrocode}





More information about the latex3-commits mailing list