BasicOperations/Matrix.py

BasicOperations/Matrix.py
1 # Copyright 2009 Autodesk, Inc. All rights reserved.
2 # Use of this software is subject to the terms of the Autodesk license agreement
3 # provided at the time of installation or download, or which otherwise accompanies
4 # this software in either electronic or hard copy form.
5 #
6 # Script description:
7 # Create matrix using all 3 different constructors.
8 #
9 # Topic: FBMatrix
10 #
11 
12 from pyfbsdk import *
13 
14 # create a matrix using a 16 values list
15 m = FBMatrix([1, 2.0, 3.3, 4.0, 5.6, 6.4, 7, 8, 9, 10.0, 11, 12., 13.0, 14.1, 15.8, 16])
16 
17 # create a matrix using 4 list of 4 values
18 m2 = FBMatrix([ [1,2,3,4], [5.0, 6.2, 7.0, 8], [9, 10, 11, 12], [13, 14, 15, 16] ])
19 
20 # create a matrix from another matrix
21 m3 = FBMatrix(m2)
22 print m
23 print m2
24 print m3
25