sectionSchrodingerColors: compute sections of a Schrodinger color surface by...

View source: R/colorSpec.optimal.R

sectionSchrodingerColorsR Documentation

compute sections of a Schrodinger color surface by hyperplanes

Description

Consider a colorSpec object x with type equal to 'responsivity.material'. The set of all possible material reflectance functions (or transmittance functions) that take the value 0 or 1, and with 2 or 0 transitions is called the 2-transition spectrum space. When there are 2 transitions, there are 2 types of spectra: bandpass and bandstop. When there are 0 transitions, the spectrum is either identically 0 or identically 1. When x is applied to this space, the corresponding surface in response space is called the 2-transition surface. The special points 0 and W (the response to the perfect reflecting diffuser) are on this surface. The surface is symmetrical about the neutral gray midpoint G=W/2. Following West and Brill, colors on the surface are called Schrödinger colors. Denote the surface by S_2. For details see: zonohedra::raytrace2trans(). This function only supports x with 3 channels.

Let the equation of a hyperplane be given by:

<v,normal> = \beta

where normal is orthogonal to the hyperplane, and \beta is the plane constant, and v is a variable. The purpose of the function sectionSchrodingerColors() is to compute the intersection of the hyperplane and S_2. The intersection is generically a single polygon, which is not necessarily convex.

In pathological cases, the intersection can be many polygons, but this function only returns one of them, with a warning that there are more. Of course, the intersection can also be empty.

The function is essentially a wrapper around zonohedra::section2trans().

Usage

## S3 method for class 'colorSpec'
sectionSchrodingerColors( x, normal, beta )

Arguments

x

a colorSpec object with type equal to 'responsivity.material' and 3 spectra.

normal

a nonzero vector of dimension 3, that is the normal to the family of parallel hyperplanes

beta

a vector of numbers of positive length. The number beta[k] defines the k'th plane <v,normal> = beta[k].

.

Value

The function returns a list with an item for each value in vector beta. Each item in the output is a list with these items:

beta

the value of the plane constant \beta

section

an Nx3 matrix, where N is the number of points in the section. The points of the section are the rows of the matrix. If the intersection is empty, then N=0.

In case of global error, the function returns NULL.

References

West, G. and M. H. Brill. Conditions under which Schrödinger object colors are optimal. Journal of the Optical Society of America. 73. pp. 1223-1225. 1983.

See Also

vignette Plotting Chromaticity Loci of Optimal and Schrodinger Colors, sectionOptimalColors(), zonohedra::section2trans()

Examples

wave = seq(420,680,by=5)
Flea2.scanner = product( A.1nm, "material", Flea2.RGB, wavelength=wave )
seclist = sectionSchrodingerColors( Flea2.scanner, normal=c(0,1,0), beta=10 )
nrow( seclist[[1]]$section )
##  [1] 106


seclist[[1]]$section[ 1:5, ]
##  the polygon has 106 vertices, and the first 5 are:
##              Red Green     Blue
##  [1,]  0.4054689    10 28.09329
##  [2,]  5.2833637    10 27.76564
##  [3,] 10.9896471    10 27.45328
##  [4,] 17.2285339    10 27.17679
##  [5,] 23.7280652    10 26.94359

colorSpec documentation built on April 4, 2025, 1:59 a.m.