File: cart2sph.Rd

package info (click to toggle)
r-cran-geometry 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,964 kB
  • sloc: ansic: 20,610; cpp: 328; xml: 203; sh: 13; makefile: 5
file content (34 lines) | stat: -rw-r--r-- 887 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cart2sph.R
\name{cart2sph}
\alias{cart2sph}
\title{Transform Cartesian to spherical coordinates}
\usage{
cart2sph(x, y = NULL, z = NULL)
}
\arguments{
\item{x}{x-coordinates or matrix with three columns}

\item{y}{y-coordinates (optional, if \code{x}) is a matrix}

\item{z}{z-coordinates (optional, if \code{x}) is a matrix}
}
\value{
Matrix with columns:
\item{\code{theta}}{the angle relative to the positive x-axis}
\item{\code{phi}}{the angle relative to the xy-plane}
\item{\code{r}}{the distance to the origin \code{(0, 0, 0)}}
}
\description{
If called with a single matrix argument then each row of \code{c}
represents the Cartesian coordinate (\code{x}, \code{y}, \code{z}).
}
\seealso{
\code{\link{sph2cart}}, \code{\link{cart2pol}},
  \code{\link{pol2cart}}
}
\author{
Kai Habel

David Sterratt
}