Learn R Programming

polarzonoid (version 0.3-0)

arcs and boundary: The Homeomorphism between the Space of \(n\) or fewer arcs, and the boundary of the Polar Zonoid

Description

This section calculates the homeomorphism from the space of \(n\) or fewer arcs on the circle, which is denoted by \(A_n\), to the boundary of the polar zonoid, and its inverse.

Usage

boundaryfromarcs( arcmat, n=NULL, gapmin=0 )
arcsfromboundary( p, tol=5.e-9 )

Value

boundaryfromarcs() maps from \(A_n\)

to \(\mathbb{R}^{2n+1}\). It returns the computed point on the boundary of the zonoid. Names are assigned indicating the corresponding term in the trigonometric polynomial.

In case of error, the function returns NULL.

If \(m\) is the length of p, then arcsfromboundary()

maps from \(\mathbb{R}^{m}\) to \(A_N\). It returns an Nx2 matrix defining N arcs as above. Because p might be in a substratum of the boundary, N might be less than expected, which is \((m-1)/2\).

In case of error, the function returns NULL.

Arguments

arcmat

an Nx2 matrix with an arc definition in each row; so the total number of arcs is N. The 1st number in the row is the center of the arc, and the 2nd number is the length of the arc; both in radians.
The length can be 0 or \(2\pi\), defining the empty arc and the full circle respectively. For these 2 improper arcs, there must be only 1 row, and the center is ignored.

n

the given set of arcs is taken to be in \(A_n\). If n is NULL, then n is set to the number of rows in arcmat, unless arcmat defines an improper arc, when n is set to 0. If n is not NULL, then we must have n \(\ge\) the default value.

The returned vector is in \(\mathbb{R}^{2n+1}\).

gapmin

the minimum gap between arcs in arcmat that is valid. The default gapmin=0 allows abutting arcs, but not overlapping arcs. If one is sure that the arcs are not overlapping, then set gapmin=-Inf and this validation check is skipped, which saves a tiny bit of time.

p

a vector in \(\mathbb{R}^{2N+1}\) or \(\mathbb{R}^{2N}\). In the latter case (an even-dimensional space), a \(\pi\) is appended to it to make p odd-dimensional. The vector must be on the boundary of the polar zonoid in \(\mathbb{R}^{2N+1}\), which usually means that it is computed by either boundaryfromarcs() or boundaryfromsphere(). In this version of the package, valid values for \(N\) are 0, 1, 2, and 3.

tol

if the approximate distance from p to a sub-stratum of the boundary is less than tol, then take p to actually be in this substratum. This step is necessary because the boundary is not smooth at the sub-strata.

Details

In boundaryfromarcs(), the calculation of the returned point is a straightforward integration of trigonometric functions over the arcs. The last component of the vector is simply the sum of the arc lengths.
Let \(h\) denote boundaryfromarcs(). If \(s\) denotes the full circle, then \(h(s)\) = (0,...,0,\(2\pi\)). If \(\phi\) denotes the empty arc, then \(h(\phi)\) = (0,...,0,0).

arcsfromboundary() first calculates the outward pointing normal at p. In this version of the package, the implicitization of the boundary, and thus the normal, is only available when \(N\) is 0, 1, 2, or 3. This normal determines a trigonometric polynomial whose roots are calculated with trigpolyroot(). These roots are the endpoints of the arcs.

These two functions are inverses of each other.

See Also

spherefromarcs(), arcsfromsphere(), boundaryfromsphere(), spherefromboundary(), complementaryarcs(), trigpolyroot()

Examples

Run this code
# make two disjoint arcs
arcmat = matrix( c(pi/4,pi/2,  pi,pi/4), 2, 2, byrow=TRUE ) ; arcmat

##           [,1]      [,2]
## [1,] 0.7853982 1.5707963
## [2,] 3.1415927 0.7853982

plotarcs( arcmat )

#  map to boundary of the zonoid
b = boundaryfromarcs( arcmat ) ;  b

##        x1        y1        x2        y2         L 
## 0.2346331 1.0000000 0.7071068 1.0000000 2.3561945 

#  map b back to arcs, and compare with original
arcsdistance( arcmat, arcsfromboundary(b) )

## [1] 2.220446e-16

# so the round trip returns to original pair of arcs, up to numerical precision

Run the code above in your browser using DataLab