$SPAD/src/input dhmatrix.input

Timothy Daly December 3, 2016

Abstract

Contents

2

— * —

)set break resume
)spool dhmatrix.output
)set message test on
)set message auto off
)clear all

———-

We create a target domain — * —

--S 1 of 16
t1:=DHMATRIX(DoubleFloat)
--R
--R   (1)  DenavitHartenbergMatrix(DoubleFloat)
--R                                                                 Type: Domain
--E 1

———-

This creates an identity element from the target domain.

— * —

--S 2 of 16
t2:=identity()$t1
--R
--R        +1.  0.  0.  0.+
--R        |              |
--R        |0.  1.  0.  0.|
--R   (2)  |              |
--R        |0.  0.  1.  0.|
--R        |              |
--R        +0.  0.  0.  1.+
--R                                   Type: DenavitHartenbergMatrix(DoubleFloat)
--E 2

———-

This is the rotation matrix around the X axis for 30 degrees — * —

--S 3 of 16
t3:=rotatex(30)
--R
--R        +1   0     0    0+
--R        |                |
--R        |    +-+         |
--R        |   \|3     1    |

--R        |0  ----  - -   0|
--R        |     2     2    |
--R   (3)  |                |
--R        |          +-+   |
--R        |    1    \|3    |
--R        |0   -    ----  0|
--R        |    2      2    |
--R        |                |
--R        +0   0     0    1+
--R                           Type: DenavitHartenbergMatrix(Expression(Integer))
--E 3

———-

This is the rotation matrix around the Y axis for 30 degrees — * —

--S 4 of 16
t4:=rotatey(30)
--R
--R        + +-+            +
--R        |\|3       1     |
--R        |----  0   -    0|
--R        |  2       2     |
--R        |                |
--R        | 0    1   0    0|
--R   (4)  |                |
--R        |          +-+   |
--R        |  1      \|3    |
--R        |- -   0  ----  0|
--R        |  2        2    |
--R        |                |
--R        + 0    0   0    1+
--R                           Type: DenavitHartenbergMatrix(Expression(Integer))
--E 4

———-

This is the rotation matrix around the Z axis for 30 degrees — * —

--S 5 of 16
t5:=rotatez(30)
--R
--R        + +-+            +
--R        |\|3     1       |
--R        |----  - -   0  0|
--R        |  2     2       |
--R        |                |
--R        |       +-+      |
--R   (5)  | 1    \|3       |

--R        | -    ----  0  0|
--R        | 2      2       |
--R        |                |
--R        | 0     0    1  0|
--R        |                |
--R        + 0     0    0  1+
--R                           Type: DenavitHartenbergMatrix(Expression(Integer))
--E 5

———-

This scales along X, Y, and Z by 1/2 — * —

--S 6 of 16
t6:=scale(0.5,0.5,0.5)
--R
--R        +0.5  0.0  0.0  0.0+
--R        |                  |
--R        |0.0  0.5  0.0  0.0|
--R   (6)  |                  |
--R        |0.0  0.0  0.5  0.0|
--R        |                  |
--R        +0.0  0.0  0.0  1.0+
--R                                         Type: DenavitHartenbergMatrix(Float)
--E 6

———-

This translates along the X, Y, and Z axis by 2 units — * —

--S 7 of 16
t7:=translate(2.0,2.0,2.0)
--R
--R        +1.0  0.0  0.0  2.0+
--R        |                  |
--R        |0.0  1.0  0.0  2.0|
--R   (7)  |                  |
--R        |0.0  0.0  1.0  2.0|
--R        |                  |
--R        +0.0  0.0  0.0  1.0+
--R                                         Type: DenavitHartenbergMatrix(Float)
--E 7

———-

This is a point on the X axis can move around the plane — * —

--S 8 of 16

t8:Point(DoubleFloat):=[4.0,0.0,0.0]$List(DoubleFloat)
--R
--R   (8)  [4.,0.,0.]
--R                                                     Type: Point(DoubleFloat)
--E 8

———-

First, we construct a translation along the X axis by 3 units — * —

--S 9 of 16
t9:=translate(4.0,0.0,0.0)
--R
--R        +1.0  0.0  0.0  4.0+
--R        |                  |
--R        |0.0  1.0  0.0  0.0|
--R   (9)  |                  |
--R        |0.0  0.0  1.0  0.0|
--R        |                  |
--R        +0.0  0.0  0.0  1.0+
--R                                         Type: DenavitHartenbergMatrix(Float)
--E 9

———-

and we apply the transformation so t8 is now moved — * —

--S 10 of 16
t10:=t9*t8
--R
--R   (10)  [8.,0.,0.]
--R                                                     Type: Point(DoubleFloat)
--E 10

———-

Now we rotate the point 90 degrees around the Z axis which will move the point from the X axis to the Y axis.

— * —

--S 11 of 16
t11:=rotatez(90)*t10
--R
--R   (11)  [0.,8.,0.]
--R                                         Type: Point(Expression(DoubleFloat))
--E 11

———- and we can scale the point by 1/2 to shorten along the Y axis

— * —

--S 12 of 16
t12:=scale(0.0,0.5,0.0)*t11
--R
--R   (12)  [0.,4.,0.]
--R                                         Type: Point(Expression(DoubleFloat))
--E 12

———-

Now we rotate the point 90 degrees around the X axis which will move the point from the Y axis to the Z axis.

— * —

--S 13 of 16
t13:=rotatex(90)*t12
--R
--R   (13)  [0.,0.,4.]
--R                                         Type: Point(Expression(DoubleFloat))
--E 13

———-

Now we rotate the point 90 degrees around the Y axis which will move the point from the Z axis to the X axis. We are now back to the original point

— * —

--S 14 of 16
t14:=rotatey(90)*t13
--R
--R   (14)  [4.,0.,0.]
--R                                         Type: Point(Expression(DoubleFloat))
--E 14

———-

We can do all of the translations, rotations, and scaling and create a single matrix that will apply them all at once.

— * —

--S 15 of 16
t15:=rotatey(90)*rotatex(90)*scale(0.0,0.5,0.0)*_
     rotatez(90)*translate(4.0,0.0,0.0)
--R
--R         +0.5  0.0  0.0  2.0+
--R         |                  |
--R         |0.0  0.0  0.0  0.0|
--R   (15)  |                  |
--R         |0.0  0.0  0.0  0.0|

--R         |                  |
--R         +0.0  0.0  0.0  1.0+
--R                             Type: DenavitHartenbergMatrix(Expression(Float))
--E 15

———-

We can do all of the translations, rotations, and scaling and create a single matrix that will apply them all at once. The original point is moved around the space back to its original point.

— * —

--S 16 of 16
t16:=t15*t8
--R
--R   (16)  [4.,0.,0.]
--R                                         Type: Point(Expression(DoubleFloat))
--E 16
)spool
)lisp (bye)

———-

References^{[1] nothing}

9