A
A
Alex552017-07-01 10:35:41
PHP
Alex55, 2017-07-01 10:35:41

How to reverse matrices (perspectives)?

Hello. There is a matrix array for one image:

$matrix = array(
  1, 5, 0, 0, 
  0, 240, 0, 200, 
  120, 240, 80, 160, 
  192, 0, 106, 30
);
$image->distortImage(Imagick::DISTORTION_PERSPECTIVE, $matrix, true);

After applying the perspective, the image looks in the direction I need at the right angle. But there is a second image, which should look in the other (horizontal) direction.
Tell me how to implement reverse matrices? Are there any online services? I am not strong in mathematics (although they told me not to skip matan).
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2017-07-01
@AXP-dev

https://sourceforge.net/projects/phpmatrixlib/

include_once ("Matrix.class.php");
$matrixA = new Matrix(array(array(0, 1), array(2, 6)));
echo $matrixA->getInverse()->getMathMl();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question