Table of Contents
• 1. Affine transformation
• 2. Solve linear equations
• 3. Norm in
n
ℂ
• 4. Polynomial functions
• 5. Determinant, Generalized
• Bibliography
1. Affine transformation
u a b c x
[ v ] = [ d e f ] [ y ]
1 0 0 1 1
Equation 1. Affine equations
Where
( u , v )
is the new coordinate and
( x , y )
is the old coordinate.
The APL code mapping an image by this transformation is like:
| affine←{
| ⍝ affine transformation
| ⎕IO←0 ⋄ s←⍴⍵
| g←¯1↓⍉⌊0.5+⍺+.×⍤2 1⊢1,⍨⍉s⊤⍳×/s
5 | m←∧⌿(s>⍤0 1⊢g)∧0<g
| s⍴(0,,⍵)[m×1+s⊥g]
| }
2. Solve linear equations
For coefficient matrix
A
, variable matrix
X
and constant matrix
B
, then
AX = B
− 1
X = ( A ) B
Then the APL code is just (⌹A)+.×B, or even simpler, B⌹A. As the APL2
specification writes:
If Z←L⌹R is executable, Z is determined to minimize the value of the least
squares expression:
|+/,(L-R+.×Z)*2
In J the matrix division is B %. A. Note that, if possible, using exact number
can produce more accurate result.
3. Norm in
n
ℂ
The norm of inner product space,
_______________
‾ _ | ‾ ‾
‖ a ‖ = \| ⟨ a , a ⟩
, is:
|2*∘÷⍨+.×⍨
4. Use linear transformation to define polynomial functions
Due to the "superposition" principle, for
ℙ
4
that basis
2 3
B = [ 1 , x , x , x ]
,
' ''
L ( p ) = x + x
find
M
that
[ L ( p ) ] = M [ p ]
B B