polar2cart: Turns polar coordinates (EPosSphere) into Cartesian...

View source: R/EMEGShelper.R

polar2cartR Documentation

Turns polar coordinates (EPosSphere) into Cartesian coordinates

Description

This function takes polar coordinates (EPosSphere in EMEGS) and turns them into Cartesian 3d coordinates. Assumes radius of one, X is right ear (negative) to left ear (positive), Y positive toward nose, and Z is 1 at Cz. Spherical coordinates are returned in radians and degrees. Theta is 0 at Cz pi at other pole. Phi is zero at right ear, pi/2 (90°) at nose, pi (180°) at left ear, 3/2*pi (270°) at Oz.

Usage

polar2cart(theta_radians, phi_radians)

Arguments

theta_radians

angle in radians from north pole Cz

phi_radians

angle in radians from right ear to nose

Value

Returns a named vector with X, Y, and Z coordinates

Author(s)

Andrew H Farkas, andrewhfarkas at g mail dot com


AndrewHFarkas/EMEGShelper documentation built on Oct. 20, 2023, 9:57 a.m.