[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3build: Polar vectors (653fcb6)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Feb 8 15:01:06 CET 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/653fcb680f18c4b022977ce00a38729e9c010c1b
>---------------------------------------------------------------
commit 653fcb680f18c4b022977ce00a38729e9c010c1b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Feb 8 14:01:06 2018 +0000
l3build: Polar vectors
At the moment, I'll leave cylinder/sphere based approached.
>---------------------------------------------------------------
653fcb680f18c4b022977ce00a38729e9c010c1b
l3trial/l3draw/l3draw-points.dtx | 16 ++++++++++++++++
l3trial/l3draw/l3draw.dtx | 6 ++++++
2 files changed, 22 insertions(+)
diff --git a/l3trial/l3draw/l3draw-points.dtx b/l3trial/l3draw/l3draw-points.dtx
index abdd20c..33be0bd 100644
--- a/l3trial/l3draw/l3draw-points.dtx
+++ b/l3trial/l3draw/l3draw-points.dtx
@@ -403,6 +403,22 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}[EXP]{\draw_point_vec_polar:nn}
+% \begin{macro}[EXP]{\@@_point_vec_polar:nn, \@@_point_vec_polar:ff}
+% Much the same as the core polar approach.
+% \begin{macrocode}
+\cs_new:Npn \draw_point_vec_polar:nn #1#2
+ { \@@_draw_vec_polar:fw { \fp_eval:n {#1} } #2 ~ and ~ #2 ~ \q_stop }
+\cs_new:Npn \@@_draw_vec_polar:nw #1#2 ~ and ~ #3 ~ #4 \q_stop
+ {
+ { \fp_to_dim:n { cosd(#1) * (#2) * \l_@@_xvec_x_dim } }
+ { \fp_to_dim:n { sind(#1) * (#3) * \l_@@_xvec_y_dim } }
+ }
+\cs_generate_variant:Nn \@@_draw_polar:nw { f }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/l3trial/l3draw/l3draw.dtx b/l3trial/l3draw/l3draw.dtx
index 819660f..5aafbfb 100644
--- a/l3trial/l3draw/l3draw.dtx
+++ b/l3trial/l3draw/l3draw.dtx
@@ -110,6 +110,12 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}[EXP]{\draw_point_vec_polar:nn}
+% \begin{syntax}
+% \cs{draw_point_vec_polar:nn} \marg{angle} \marg{length}
+% \end{syntax}
+% \end{function}
+%
% \begin{function}[EXP]{\draw_point_linejoin:nnnn}
% \begin{syntax}
% \cs{draw_point_linejoin:nn} \marg{P1} \marg{P2} \marg{P3} \marg{P4}
More information about the latex3-commits
mailing list