cartToPolar | R Documentation |
cartToPolar
converts the x and y coordinates of a vector
field (for instance, as generated by spatialGradient
) and
computes their polar representation (magnitude and angle).
cartToPolar(x, y, magnitude = "new", angle = "new", degree = FALSE)
x |
A 32- or 64-bit (32F or 64F) |
y |
A 32- or 64-bit (32F or 64F) |
magnitude |
The location where the magnitude should be stored. It can take 2 values:
|
angle |
The location where the angle should be stored. It can take 2 values:
|
degree |
A logical indicating whether the angles are measured in radians (the default) or degrees. |
If magnitude="new"
and angle="new"
, the function returns
a list containing two Image
objects. If magnitude
and
angle
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.