Learn R Programming

habtools (version 1.1.1)

sim_circle: Simulate a circle

Description

Simulates xy coordinates for a circle of given radius. Created for package testing purposes, but might be useful for others.

Usage

sim_circle(r = 1, n = 100, mid = c(0, 0))

Value

A data frame of n xy-coordinates.

Arguments

r

Radius of the circle (default 1).

n

Number of xy coordinates defining the circle (default 100).

mid

Mid point of the circle (default 0, 0).

Examples

Run this code
circ <- sim_circle()
plot(circ)

circularity(circ)
perimeter(circ)

Run the code above in your browser using DataLab