Displaying 1 result from an estimated 1 matches for "tillsolstice".
2013 Dec 02
1
Days to solstice calculation
...th
#L = Latitude in Degrees
#J = Day of the year (Julian)
P <- asin(.39795*cos(.2163108 + 2*atan(.9671396*tan(.00860*(J-186)))))
A <- sin(0.8333*pi/180)+sin(L*pi/180)*sin(P)
B <- cos(L*pi/180)*cos(P)
D <- 24 - (24/pi)* acos(A/B)
return(D)
}
#Example today and here
Daylength(2,39.7505)
TillSolstice <- function(date,solstice){
Yr <- as.POSIXlt(date)$year+1900
a <- as.Date(paste(as.character(Yr),as.character(rep("-01-01", length(Yr))),sep = ""))
b <- as.Date(paste(as.character(Yr),as.character(rep("-12-31", length(Yr))),sep = ""))
Winter <-...