Triangles, 2 per tile-face.

tri_graticule(n = 12, xlim = c(-180, 180), ylim = c(-90, 90),
  hull = FALSE, crs = "+proj=geocent +datum=WGS84", sub = 0, ...)

hull_graticule(n_coords = 360, ..., coords = NULL,
  crs = "+proj=geocent +datum=WGS84", sub = 0)

quad_graticule(n = 12, xlim = c(-180, 180), ylim = c(-90, 90),
  hull = FALSE, crs = "+proj=geocent +datum=WGS84", sub = 0)

Arguments

n

number of tile faces in x and y directions (give 2-elements for independent x, y)

xlim

longitude range (phi, azimuth)

ylim

latitude range (theta, elevation)

hull

if TRUE use the convex hull (assuming full sphere)

crs

projection of globe in PROJ.4 form

sub

depth of subdivision to apply, no subdivision by default ('sub = 0')

...

unused

n_coords

number of coordinates to use for the random sample in hull_coordinates()

coords

an optional input set of coordinates to build the hull

Value

mesh3d object

Details

The hull form can be used to close a mesh with the convex hull method that is the Delaunay triangulation of points on a sphere. If the full sphere is not included then a segment can be created. Otherwise, if hull = FALSE then an actual Delaunay triangulation mesh is created.

tri_graticule() uses Delaunay triangulation via convex hull or directly, quad_graticule() creates a quadmesh and uses that, there's no hull method. We use the termniology longitude (phi, azimuth) and latitude (theta, elevation) in the range -180, 180 degrees and -90, 90 degrees. Longitude range is defined by xlim, latitude range by ylim.

We use the Geocentric XYZ projection by default, on WGS84. For spherical forms use 'crs = "+proj=sphere +a=1' for a sphere of radius 1.

For hull_graticule() coords must be a matrix of 2 or 3 columns of lon, lat, (degrees), elevation (metres) - if z is not present it is set to 0. Use of n_coords and coords is mutually exclusive.

Examples

library(rgl) x <- tri_graticule(n = c(12, 9)) clear3d() shade3d(x) aspect3d(1, 1, 1) #rglwidget() library(rgl) qx <- quad_graticule(n = c(12, 9)) clear3d() shade3d(qx) aspect3d(1, 1, 1) #rglwidget()