[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generic Givens Rotation Matrix in EQN
From: |
Damian McGuckin |
Subject: |
Re: Generic Givens Rotation Matrix in EQN |
Date: |
Mon, 1 Mar 2021 11:34:28 +1100 (AEDT) |
User-agent: |
Alpine 2.02 (LRH 1266 2009-07-14) |
On Mon, 1 Mar 2021, Tadziu Hoffmann wrote:
This is fairly straightforward with a few suitable eqn definitions to
simplify entering the equation.
The attached PDF was created with the following code and my own
paragraph and section macros. (Use "left [" and "right ]" instead of my
bracket macro if you want to use the equation with some other macro
package.)
Done. Works flawlessly. See below.
Note that since I've entered the matrix column-wise it appears
transposed in the text editor display.
Yes.
define ... % roman " . . . " %
define vdots % roman "\v'-.6m'\z.\v'.5m'\z.\v'.5m'.\v'-.4m'" %
define ddots % roman "\v'-.6m' .\v'.5m' .\v'.5m' .\v'-.4m' " %
Exactly what I needed. I was having brain fade trying to do this.
Thanks heaps
.\" Begin example using -MM
.S 12 14
.EQ
define ... % roman " . . . " %
define vdots % roman "\v'-.6m'\z.\v'.5m'\z.\v'.5m'.\v'-.4m'" %
define ddots % roman "\v'-.6m' .\v'.5m' .\v'.5m' .\v'-.4m' " %
define Gjj % G sub back 30 jj %
define Gji % G sub back 30 ji %
define Gii % G sub back 10 ii %
define Gij % G sub back 10 ij %
define Gkk % G sub back 10 kk %
define | % above %
delim $$
.EN
.DS 1
.EQ
set column_sep 20
G ( i, j, theta ) ~~ = ~~
left [
matrix {
ccol { 1 | vdots | 0 | vdots | 0 | vdots | 0 }
ccol { ... | ddots | ... | "" | ... | "" | ... }
ccol { 0 | vdots | c | vdots | s | vdots | 0 }
ccol { ... | "" | ... | ddots | ... | "" | ... }
ccol { 0 | vdots | -s | vdots | c | vdots | 0 }
ccol { ... | "" | ... | "" | ... | ddots | ... }
ccol { 0 | vdots | 0 | vdots | 0 | vdots | 1 }
}
right ]
.EN
.DE
which is, when $i > j$,
.DS 1
.EQ
set column_sep 100
Gkk = 1 roman " for " k != i, j , fwd 100
Gii = Gjj = + c = + cos ( theta ) , fwd 100
Gji = - Gij = - s = - sin ( theta ) .
.EN
.DE
(See https://en.wikipedia.org/wiki/Givens_rotation.)
.\" End of example using -MM
Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer