R/sunvector.R

Defines functions sunvector

Documented in sunvector

sunvector <-
function (jd,latitude,longitude,timezone) {
if (nargs() < 4 ) {cat("USAGE: sunvector(jd,latitude,longitude,timezone)\n values in jd, degrees, hours\n"); return()}
	omegar = hourangle(jd,longitude,timezone)
	deltar = radians(declination(jd))
	lambdar = radians(latitude)	
	svx = -sin(omegar)*cos(deltar)
	svy = sin(lambdar)*cos(omegar)*cos(deltar)-cos(lambdar)*sin(deltar)
	svz = cos(lambdar)*cos(omegar)*cos(deltar)+sin(lambdar)*sin(deltar) 
	return(cbind(svx,svy,svz))
}

Try the insol package in your browser

Any scripts or data that you put into this service are public.

insol documentation built on May 29, 2017, 3:22 p.m.