rcosmo (version 1.1.2)

triangulate: Triangulate a polygonal CMBWindow

Description

Triangulate a polygonal CMBWindow

Usage

triangulate(win)

Arguments

win

a CMBWindow object

Value

a list of CMBWindow polygons or minus.polygons, each having 3 vertices and representing a triangle. If winType of win does not include "minus" then these triangles have pairwise disjoint interiors and their union is equal to the original polygon, win. Otherwise, if winType of win does include "minus" the triangles are the same as for the non-minus type above, but have "minus" types.

Examples

Run this code
# NOT RUN {
## Example 1

win <- CMBWindow(theta = c(2*pi/3,3*pi/4,3*pi/4, 2*pi/3),
                 phi = c(pi/4,pi/4,pi/3,pi/3))
win
plot(win)
win1 <- triangulate(win)
win1
summary(win1[[1]])
plot(win1[[1]], add= FALSE, col="green")
plot(win1[[2]], col="blue")

## Example 2: triangilation minus-type polygon

win <- CMBWindow(theta = c(pi/5,pi/3,pi/4, pi/3, pi/5),
                 phi = c(pi/5,pi/5, pi/4 ,pi/3,pi/3), set.minus =TRUE)
win
plot(win)
summary(win)
win1 <- triangulate(win)
win1
plot(win1[[1]], add= FALSE, col="green")
plot(win1[[2]], col="blue")
plot(win1[[3]], col="yellow")
summary(win1[[1]])
summary(win1[[2]])
summary(win1[[3]])

# }

Run the code above in your browser using DataLab