string_to_circle: Get its center, radius and angle from a circle's string

View source: R/utils.R

string_to_circleR Documentation

Get its center, radius and angle from a circle's string

Description

Get its center, radius and angle from a circle's string

Usage

string_to_circle(x, y, xend, yend, radian = NULL, radius = NULL)

Arguments

x, y, xend, yend

start and end points defining a string of a circle

radian

angle of the string.

radius

radius of the circle. Only used if radian is NULL or 2*pi.

Details

For a string, given its radian or radius, there will be two circle centers matched. This function will return both centers in a order of left center and right center. For brevity, the radian will always less than pi (0-2*pi).

Value

a list of center, radius, string.start, string.end, angle, angle.start, angle.end

Examples

string_to_circle(-1, 0, 1, 0, pi)
string_to_circle(-1, 0, 1, 0, pi/2)
string_to_circle(0, 1, 0, -1, pi/2)


zzwch/crosslink documentation built on Aug. 27, 2023, 5:57 p.m.