diff options
author | Karl Berry <karl@freefriends.org> | 2020-12-21 22:02:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-12-21 22:02:51 +0000 |
commit | c95edccc8198456a8a1a43c7b2c70a02ca8d84ac (patch) | |
tree | 7b75eb11432c27bc72182e261983078fd196620a /Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 | |
parent | 88e74ca1539a00a016c46ca3ac678158efe5286e (diff) |
circuit-macros (21dec20)
git-svn-id: svn://tug.org/texlive/trunk@57189 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4')
-rw-r--r-- | Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 b/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 index e4698410363..81bde54de0d 100644 --- a/Master/texmf-dist/doc/latex/circuit-macros/lib3D.m4 +++ b/Master/texmf-dist/doc/latex/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')') |