!trans08.bas
!同次変換行列 Local U ==> Global X

dim R(4,4),T(4,4),iT(4,4),X(4,1),U(4,1)
dim R1(4,4),R2(4,4),R3(4,4)

let t1=pi/4
let t2=pi/5
let t3=pi/6

let L=2
!let x2=2
!let y2=3
!let z3=4

let c1=cos(t1)
let c2=cos(t2)
let c3=cos(t3)
let s1=sin(t1)
let s2=sin(t2)
let s3=sin(t3)

let R1(1,1)=cos(t1)
let R1(1,2)=-sin(t1)
let R1(2,1)=sin(t1)
let R1(2,2)=cos(t1)
let R1(3,3)=1
let R1(4,4)=1

let R2(1,1)=cos(t2)
let R2(1,3)=sin(t2)
let R2(2,2)=1
let R2(3,1)=-sin(t2)
let R2(3,3)=cos(t2)
let R2(4,4)=1

let R3(1,1)=cos(t3)
let R3(1,2)=-sin(t3)
let R3(2,1)=sin(t3)
let R3(2,2)=cos(t3)
let R3(3,3)=1
let R3(4,4)=1

let T(1,1)=1
let T(2,2)=1
let T(3,3)=1
let T(4,4)=1
let T(3,4)=L

mat T=T*R3
mat T=R2*T
mat T=R1*T

let X(1,1)=1
let X(2,1)=2
let X(3,1)=3
let X(4,1)=1
mat X=T*X

mat print X

END