角座標からデカルト座標

  • 予定パッケージ名
    • SphereAndSimplex
  • 関数名
    • Angular2Cartesian
  • タイトル
Angular2Cartesian
  • 説明
角座標をデカルト座標に変換する
  • 使用例
Angular2Cartesian(r=2,t=c(1,2,3))
  • ソース
# 角座標からデカルト座標へ
Angular2Cartesian<-function(r,t){
	n<-length(t)+1
	C<-cos(t)
	S<-sin(t)
	C2<-cumprod(C[length(C):1])
	x<-c(1,S)
	x[1:(n-1)]<-x[1:(n-1)]*C2[length(C):1]
	x<-x*r
	x
}
  • Rdファイル
\name{Angular2Cartesian}
\alias{Angular2Cartesian}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Angular2Cartesian
}
\description{
translate angular coordinate to Cartesian coordinates
デカルト座標から角座標へ
}
\usage{
Angular2Cartesian(1,c(1,2,3))
}
%- maybe also 'usage' for other objects documented here.
\details{
%%  ~~ If necessary, more details than the description above ~~
}
\value{
n values for n-dimensional vector
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%%  ~~who you are~~
}
\note{
%%  ~~further notes~~
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
Cartesian2Angular
}
\examples{
x<-runif(4)
a<-Cartesian2Angular(x)
a$r
a$t
a[[1]]
a[[2]]
x2<-Angular2Cartesian(a$r,a$t)
x
a
x2
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line