polarToCart | R Documentation |
polarToCart
calculates x and y coordinates of vector
field from their polar representation (magnitude and angle).
polarToCart(magnitude, angle, x = "new", y = "new", degree = FALSE)
magnitude |
A 32- or 64-bit (32F or 64F) |
angle |
A 32- or 64-bit (32F or 64F) |
x |
The location where the x coordinates should be stored. It can take 2 values:
|
y |
The location where the y coordinates should be stored. It can take 2 values:
|
degree |
A logical indicating whether the angles are measured in radians (the default) or degrees. |
If x="new"
and y="new"
, the function returns a list
containing two Image
objects. If x
and y
are
Image
objects, the function returns nothing and modifies these
Image
objects in place.
Simon Garnier, garnier@njit.edu
polarToCart
, spatialGradient
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
field <- spatialGradient(balloon)
lapply(field, changeBitDepth, bitdepth = "32F", target = "self")
field_converted <- cartToPolar(field$dx, field$dy)
field_deconverted <- polarToCart(field_converted$magnitude, field_converted$angle)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.