Learn R Programming

spherepc (version 0.1.7)

GenerateCircle: Generating circle on sphere

Description

This function makes a circle on the unit 2-sphere.

Usage

GenerateCircle(center, radius, T = 1000)

Arguments

center

center of circle with spatial locations (longitude and latitude denoted by degrees).

radius

radius of circle. It should be in [0, pi].

T

the number of points that make up circle. The points in circle are equally spaced. The default is 1000.

Value

matrix consisting of spatial locations with two columns.

Details

This function makes a circle on the unit 2-sphere.

See Also

PrincipalCircle.

Examples

Run this code
# NOT RUN {
library(rgl)
library(sphereplot)
library(geosphere)
circle <- GenerateCircle(c(0, 0), 1)
# plot (It requires to load 'rgl', 'sphereplot', and 'geosphere' R package.)
sphereplot::rgl.sphgrid()
sphereplot::rgl.sphpoints(circle[, 1], circle[, 2], radius = 1, col = "blue", size = 12)
# }

Run the code above in your browser using DataLab