as_complex {frenchCurve}R 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)

[Package frenchCurve version 0.2.0 Index]