Skip to contents

Shorthand function to return the @faceCenters slot of an icosahedral grid or a grid linked to a facelayer.

Usage

centers(x, ...)

# S4 method for trigrid
centers(x, output = "polar")

# S4 method for facelayer
centers(x, output = "polar")

Arguments

x

(trigrid, hexagrid or facelayer). The grid or linked data layer object.

...

Arguments passed to the class specific methods.

output

(character) The coordinate system of the output. Either "polar" or "cartesian".

Value

The coordinates of the face centers as a numeric matrix.

Examples

a <- trigrid()
centers(a)
#>     long       lat
#> F1  -126  52.62263
#> F2   -54  52.62263
#> F3    18  52.62263
#> F4    90  52.62263
#> F5   162  52.62263
#> F6   162  10.81232
#> F7  -162 -10.81232
#> F8  -126  10.81232
#> F9   -90 -10.81232
#> F10  -54  10.81232
#> F11  -18 -10.81232
#> F12   18  10.81232
#> F13   54 -10.81232
#> F14   90  10.81232
#> F15  126 -10.81232
#> F16  126 -52.62263
#> F17 -162 -52.62263
#> F18  -90 -52.62263
#> F19  -18 -52.62263
#> F20   54 -52.62263