Skip to content

Commit

Permalink
diagrams to moonAngle and sunAngle docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelley committed Apr 15, 2012
1 parent cf57e16 commit c7d3f32
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ issue*R
issue*dat
issue*png
man/figures/*pdf
man/figures/*png

2 changes: 1 addition & 1 deletion man/figures/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all: adpgeometry.png adpgeometry2.png adp_beams.png
all: adpgeometry.png adpgeometry2.png adp_beams.png starCoords.png
%.png:%.R
R --no-save < $<
clean:
Expand Down
31 changes: 31 additions & 0 deletions man/figures/starCoords.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
if (!interactive())
png("starCoords.png", width=3.5, height=2.5, unit="in", res=140, pointsize=8)
ellipse <- function(xc, yc, a, b, thetaStart=0, thetaEnd=2*pi,
lwd=par('lwd'), col="black", lty=1)
{
theta <- seq(thetaStart, thetaEnd, length.out=100)
x <- xc + a * cos(theta)
y <- yc + b * sin(theta)
lines(x, y, lwd=lwd, col=col, lty=lty)
}
par(mar=rep(0, 4), lwd=2, cex=1)
plot(c(-0.8, 0.8), c(-0.4, 1.1), asp=1, type='n')
lines(c(0, 1), c(0, 0))
text(1, 0, "N", pos=4)
text(0, -0.3, "E", pos=1)
text(-1, 0, "S", pos=2)
text(0, 1, "Zenith", pos=3)
ellipse(0, 0, 1, 0.3, 0, pi, col="gray")
ellipse(0, 0, 1, 0.3, pi, 2*pi)
#ellipse(0, 0, 1, 0.3)
ellipse(0, -0.25, 0.5, 1.25, 0.5*pi, 1*pi) # arc holding star
ellipse(0, 0, 1, 1, 0, pi)
points(-0.41, 0.49, pch=20, cex=2)
lines(c(0, -0.41), c(0, 0.49))
lines(c(0, -0.51), c(0, -0.25))
ellipse(0.01, 0, 0.2, 0.34, 0.82*pi, 1.08*pi, col='black', lwd=1.5*par('lwd'))
text(-0.33, 0.05, "Altitude")
ellipse(0, 0, 0.3, 0.1, 1.3*pi, 2*pi, lwd=1.5*par('lwd'))
text(0.1, -0.15, "Azimuth")
if (!interactive()) dev.off()

14 changes: 11 additions & 3 deletions man/moonAngle.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
computed using the un-numbered equation preceeding Meeus's [1982] equation
8.1. Finally, Meeus [1982] equations 8.5 and 8.6 are used to calculate the
local azimuth and altitude of the moon, using
\code{\link{equatorialToLocalHorizontal}}.}
\code{\link{equatorialToLocalHorizontal}}.
}
\section{Alternate formulations}{Formulae provide by Meeus [1982] are used for
all calculations here. Meeus [1991] provides formulae that are similar,
Expand All @@ -46,8 +49,10 @@
\value{A data frame containing the following.
\item{t}{time}
\item{azimuth}{moon azimuth, in degrees eastward of north, from 0 to 360}
\item{altitude}{moon altitude, in degrees from -90 to 90}
\item{azimuth}{moon azimuth, in degrees eastward of north, from 0 to 360.
(See diagram below.)}
\item{altitude}{moon altitude, in degrees from -90 to 90. (See diagram
below.)}
\item{rightAscension}{right ascension, in degrees}
\item{declination}{declination, in degrees}
\item{lambda}{geocentric longitude, in degrees}
Expand All @@ -56,6 +61,9 @@
\item{distance}{earth-moon distance, in kilometers)}
\item{illuminatedFraction}{fraction of moon's visible disk that is
illuminated}

\if{html}{\figure{starCoords.png}{options: width=400px alt="Figure:
starCoords.png"}}
}

\examples{
Expand Down
11 changes: 8 additions & 3 deletions man/sunAngle.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
\details{Based on NASA-provided fortran program, in turn (according to
comments in the code) based on "The Astronomical Almanac".}

\value{A data frame containing
\item{azimuth}{azimuth, in degrees eastward of north, from 0 to 360}
\item{altitude}{altitude, in degrees above the horizon, ranging from -90 to 90}
\value{A data frame containing the following .
\item{azimuth}{azimuth, in degrees eastward of north, from 0 to 360. (See
diagram below.)}
\item{altitude}{altitude, in degrees above the horizon, ranging from -90 to
90. (See diagram below.)}
\item{diameter}{solar diameter, in degrees}
\item{distance}{distance to sun, in astronomical units}

\if{html}{\figure{starCoords.png}{options: width=400px alt="Figure:
starCoords.png"}}
}

\examples{
Expand Down

0 comments on commit c7d3f32

Please sign in to comment.