R/sunpos.R

Defines functions sunpos

Documented in sunpos

sunpos <-
function(sunv) {
#  no refraction, center of disc
if (nargs() < 1 ) {cat("USAGE: sunpos(sunvector)\n 3D vector\n"); return()}
	azimuth = degrees(pi - atan2(sunv[,1],sunv[,2]  ) )
	zenith = degrees(acos(sunv[,3]))
	return(cbind(azimuth,zenith))
}

Try the insol package in your browser

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

insol documentation built on Feb. 10, 2021, 5:08 p.m.