pgirmess (version 2.0.3)

polycirc2: Computes the polygon coordinates of a circle sector

Description

Computes the polygon coordinates of a circle sector

Usage

polycirc2(radius = 1, center = c(0, 0), edges = 50, init = pi/2, angle = pi/2)

Value

A matrix of coordinates

Arguments

radius

the circle radius

center

the centre coordinates (defaut to x=0, y=0)

edges

the circular outline of the sector is approximated by a polygon with this many edges

init

number (in radian) specifying the starting angle

angle

number (in radian) specifying the sector angle

Details

The matrix of coordinates obtained is intended to be passed to the function polygon

See Also

polygon,polycirc, floating.pie

Examples

Run this code
plot(c(-1,+1),c(-1,+1),type="n",asp=1)
polygon(polycirc2(),col="red")
polygon(polycirc2(init=pi,angle=pi/4),col="green")
polygon(polycirc2(init=1.5*pi,angle=pi/4),col="violet")
polygon(polycirc2(radius=0.5,center=c(0.5,1)),col="blue")

polycirc2(init=pi,angle=pi/4)

Run the code above in your browser using DataLab