polarToCart
import { polarToCart } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calculates x and y coordinates of 2D vectors from their magnitude and angle.
The function cv::polarToCart calculates the Cartesian coordinates of each 2D vector represented by the corresponding elements of magnitude and angle:
\begin{array}{l} \texttt{x} (I) = \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) = \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}
The relative accuracy of the estimated coordinates is about 1e-6.
See: cartToPolar, magnitude, phase, exp, log, pow, sqrt
polarToCart(magnitude: Mat, angle: Mat, x: Mat, y: Mat, angleInDegrees: boolean): void;2 available overloads
polarToCart(magnitude: Mat, angle: Mat, x: Mat, y: Mat): void;polarToCart(magnitude: Mat, angle: Mat, x: Mat, y: Mat, angleInDegrees: boolean): void;magnitudeinput 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.
angleinput floating-point array of angles of 2D vectors.
xOutput destination, filled by the native operation. output array of x-coordinates of 2D vectors; it has the same size and type as angle.
yOutput destination, filled by the native operation. output array of y-coordinates of 2D vectors; it has the same size and type as angle.
angleInDegreeswhen true, the input angles are measured in degrees, otherwise, they are measured in radians.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.