0

I want to compute f(x,y) to generate points in a plane (Affine transformation). My function has the equation:

enter image description here

when I write the code:

f = np.array([[self.a, self.b], [self.c, self.d]]) * \
    np.array([[x], [y]]) + np.array([[self.e], [self.f]])

an (2,2) arrays is returned when it should have been a (1,2).

I have tried to solve it with this code:

    A = np.array([[self.a, self.b], [self.c, self.d]])
    B = np.array(([x, y]))
    C = np.dot(A, B) + np.array([[self.e, self.f]])

But I want to know why the first code doesnt return a (1,2) array for points.

N.A.
  • 103
  • 6
  • 1
    _"But I want to know why the first code doesnt return a (1,2) array"_ because arrays, in Numpy, are not matrices and array multiplication, in Numpy, is not matrix multiplication. You may want to use the inner multiplication operator, `@`. – gboffi Nov 11 '21 at 12:23

0 Answers0