as_complex: Coerce two dimensional points to complex

View source: R/cspline.R

as_complexR Documentation

Coerce two dimensional points to complex

Description

Convenience function for allowing any of the usual ways two dimensional points can be specified in traditional graphics to define a complex variable

Usage

as_complex(x, y = NULL)

Arguments

x, y

A two dimensional specification, as allowed by grDevices::xy.coords

Value

A complex vector

Examples

loc <- cbind(runif(20), runif(20))
z <- as_complex(loc)
z <- z-mean(z)
Mod(z) <- 1
z <- z[order(Arg(z))]
plot(closed_curve(z), asp = 1, col = 2)
lines(z, col = 4)
points(z, pch=16)

frenchCurve documentation built on June 18, 2022, 9:05 a.m.