Learn R Programming

elliptic (version 1.4-0)

fpp: Fundamental period parallelogram

Description

Reduce \(z=x+iy\) to a congruent value within the fundamental period parallelogram (FPP). Function mn() gives (real, possibly noninteger) \(m\) and \(n\) such that \(z=m\cdot p_1+n\cdot p_2\).

Usage

fpp(z, p, give=FALSE)
mn(z, p)

Arguments

z

Primary complex argument

p

Vector of length two with first element the first period and second element the second period. Note that \(p\) is the period, so \(p_1=2\omega_1\), where \(\omega_1\) is the half period

give

Boolean, with TRUE meaning to return M and N, and default FALSE meaning to return just the congruent values

Author

Robin K. S. Hankin

Details

Function fpp() is fully vectorized.

Use function mn() to determine the “coordinates” of a point.

Use floor(mn(z,p)) %*% p to give the complex value of the (unique) point in the same period parallelogram as z that is congruent to the origin.

Examples

Run this code
p <- c(1.01+1.123i, 1.1+1.43i)
mn(z=1:10,p) %*% p  ## should be close to 1:10

 #Now specify some periods:
 p2 <- c(1+1i,1-1i)

 #Define a sequence of complex numbers that zooms off to infinity:
 u <- seq(from=0,by=pi+1i*exp(1),len=2007)

 #and plot the sequence, modulo the periods:
 plot(fpp(z=u,p=p2))

 #and check that the resulting points are within the qpp:
polygon(c(-1,0,1,0),c(0,1,0,-1))
 

Run the code above in your browser using DataLab