View Source Transform (idmlx v0.1.0)
Summary
Functions
Calculates a 2x3 transformation matrix that maps the old coordinates to the new coordinates.
Functions
Calculates a 2x3 transformation matrix that maps the old coordinates to the new coordinates.
Parameters
old_coords: A list of four elements representing the old coordinates[x1_old, x2_old, y1_old, y2_old].new_coords: A list of four elements representing the new coordinates[x1_new, x2_new, y1_new, y2_new].
Returns
- A list of six elements representing the transformation matrix
[a, b, c, d, e, f]where:ais the scaling factor in the x direction multiplied by the cosine of the rotation angle.bis the scaling factor in the x direction multiplied by the sine of the rotation angle.cis the negative scaling factor in the y direction multiplied by the sine of the rotation angle.dis the scaling factor in the y direction multiplied by the cosine of the rotation angle.eis the translation in the x direction.fis the translation in the y direction.
Example
iex> Transform.calculate_transform_matrix([0, 2, 0, 2], [1, 3, 1, 3])
[1.0, 0.0, 0.0, 1.0, 1.0, 1.0]