coordinates: Transformation between spherical, cartesian and geographical...

Description Usage Arguments Value

Description

This package contains several functions which require a data.frame of the exact channel positions (e.g., plot2dview, chanNb). To facilitate the transformation between various coordinate systems, sph2cart, sph2geo, cart2sph, cart2geo, geo2sph, geo2cart transform spherical (sph), cartesian (cart), or geographical (geo) coordinates into the respective coordinate system.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
sph2cart(ch_pos, r = 1, deg = TRUE)

cart2sph(ch_pos, deg = TRUE)

sph2geo(
  ch_pos,
  r = 1,
  deg = TRUE,
  long360 = TRUE,
  orient = c("northpole", "equatorial")
)

geo2sph(ch_pos, r = 1, deg = TRUE)

geo2cart(ch_pos, r = 1, deg = TRUE)

cart2geo(ch_pos, deg = TRUE)

Arguments

ch_pos

a data frame or matrix containing the spherical, cartesian, or geographical coordinates of the electrode positions. It should contain at least the following (named) columns, respectively: theta and phi; x, y, and z; or lat and long. The rownames attribute of ch_pos is interpreted as the names of the electrodes.

r

radius (default = 1)

deg

logical variable indicating whether spherical or geographical coordinates are or should be given in degrees (TRUE, default)

long360

logical variable; if TRUE (default), longitudes range from 0 to 360 (otherwise from -180 to 180)

orient

a character value specifying the orientation in the geographical coordinate system; "northpole" (default) or "equatorial"

Value

A data.frame with converted coordinates


tdeenes/eegR documentation built on April 19, 2021, 4:17 p.m.