From 4cc7922324b7a08ba0418e8f245cf1dcfa1891ac Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 21 Dec 2020 03:01:35 +0000 Subject: CTAN sync 202012210301 --- graphics/circuit_macros/lib3D.m4 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'graphics/circuit_macros/lib3D.m4') diff --git a/graphics/circuit_macros/lib3D.m4 b/graphics/circuit_macros/lib3D.m4 index e469841036..81bde54de0 100644 --- a/graphics/circuit_macros/lib3D.m4 +++ b/graphics/circuit_macros/lib3D.m4 @@ -3,7 +3,7 @@ lib3D.m4 Macros for rotation, projection, and other operations on argument triples representing 3D vectors. -* Circuit_macros Version 9.3, copyright (c) 2020 J. D. Aplevich under * +* Circuit_macros Version 9.4, copyright (c) 2020 J. D. Aplevich under * * the LaTeX Project Public Licence in file Licence.txt. The files of * * this distribution may be redistributed or modified provided that this * * copyright notice is included and provided that modifications are clearly * @@ -92,8 +92,9 @@ define(`dcosine3D',`(ifelse(`$1',1,`$2',`$1',2,`$3',`$4'))') define(`length3D',`sqrt((`$1')^2+(`$2')^2+(`$3')^2)') Unit vector define(`unit3D',`sprod3D(1/length3D(`$1',`$2',`$3'),`$1',`$2',`$3')') - Assign the direction cosines to variables - `assign3D([u],[v],[w],x,y,z); eg + + `Assign the direction cosines to variables + assign3D([u],[v],[w],x,y,z); eg assign3D(u,v,w,cross3D(x1,y1,z1,x2,y2,z2)) assigns the 4th arg to u, the 5th to v, and the 6th to w as u, v,or w are nonblank' @@ -101,6 +102,11 @@ define(`assign3D', `ifelse(`$1',,,`$1' = `$4') ifelse(`$2',,,`$2' = `$5') ifelse(`$3',,,`$3' = `$6')') + `vassign3D(name,x,y,z); eg + vassign3D(u,x,y,z) + assigns u[1] to x, u[2] to y, u[3] to z' +define(`vassign3D',`for i_vassign3D = 1 to 3 do { + exec sprintf("`$1'[i_vassign3D] = $%g",i_vassign3D+3) }') Write out the 3 arguments for debug define(`print3D',`print sprintf("`$1'(%g,%g,%g)",`$2',`$3',`$4')') -- cgit v1.2.3