Function polarToCart

  • Calculates x and y coordinates of 2D vectors from their magnitude and angle.

    Parameters

    • magnitude: Mat

      input floating-point array of magnitudes of 2D vectors; it can be an empty matrix (=Mat()), in this case, the function assumes that all the magnitudes are =1; if it is not empty, it must have the same size and type as angle.

    • angle: Mat

      input floating-point array of angles of 2D vectors.

    • Optional angleInDegrees: boolean

      when true, the input angles are measured in degrees, otherwise, they are measured in radians.

    Returns {
        x: Mat;
        y: Mat;
    }