R/fSombraHoriz.R

Defines functions fSombraHoriz

Documented in fSombraHoriz

fSombraHoriz<-function(angGen, distances, struct)
{
    stopifnot(is.list(struct), is.data.frame(distances))
    ## I prepare starting data 	
    d <- with(struct, distances/L)
    AzS <- angGen$AzS
    AlS <- angGen$AlS
    Beta <- angGen$Beta
    lew <- d$Lew #It must be previously normalized
    ## Calculations
    Beta0 <- atan(abs(sin(AzS)/tan(AlS)))
    FS <- 1-lew*cos(Beta0)/cos(Beta-Beta0)
    SombraCond <- (FS>0)
    ## Result
    FS <- FS*SombraCond
    FS[FS>1] <- 1
    return(FS)
}

Try the solaR2 package in your browser

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

solaR2 documentation built on April 3, 2025, 6:11 p.m.