R/SpectralSynthesis.R

## Function to generate multidimensional fractal landscapes using an updated
## version of the spectral synthesis algorithm published in Keitt (2000) but
## also adhering to the conjugate symmetry condition of Peitgen and Saupe (1988)
#
#	DimExtents		- 	Vector of integers containing the dimensional
#					extents of the output vector
#	Hursts			- 	Vector of doubles containint the Hurst exponent
#					for each dimension
#
SpectralSynthesis <- function(DimExtents, Hursts, RescaleVals = c(0,1))
{
	out <- .External(
		"SpectralSynthesis",
		DimExtents = as.integer(DimExtents),
		Hursts = as.double(Hursts),
		PACKAGE="ecomodtools")
	if(is.null(RescaleVals) == FALSE)
	{
		range.out <- range(out)
		range.rescale <- range(RescaleVals)
		out <- range.rescale[1] + (range.rescale[2] - range.rescale[1]) * (out - range.out[1]) / (range.out[2] - range.out[1])
	}
	out
}

Try the ecomodtools package in your browser

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

ecomodtools documentation built on May 2, 2019, 4:58 p.m.