The transformation module allow to calculate global or local coordinates while an XML export. Let’s define a matrix representing the transformation (translation and rotation) of a location in an environment or building.
arguments:
x (type integer)
y (type integer)
z (type integer)
- angle (type float)
rotation between local and global coordinates
exemple
>>> x = 20 >>> y = 12 >>> z = 3 >>> angle = 90 >>> T = Transformation(x,y,z,angle)"
- To calculate global coordinates, the local ones are multiplicated by the transformation matrix.Pour calculer les coordonnées (X’, Y’, Z’) dans le repère global, on multiplie les coordonées (X, Y, Z) dans le repère local par la matrice de transformation associée.
- cos a -sin a 0 x X X’ sin a cos a 0 y * Y = Y’ 0 0 1 z Z Z’ 0 0 0 1 1 1
x, y, z are the global coordinates of the location and a the angle of the rotation.
For a local point (a, b, c) the global transformation function is called that way : >>> coor_globales = T.trans(a,b,c)