arcs and boundary | R Documentation |
n
or fewer arcs,
and the boundary of the Polar Zonoid
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.
boundaryfromarcs( arcmat, n=NULL, gapmin=0 )
arcsfromboundary( p, tol=5.e-9 )
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. |
n |
the given set of arcs is taken to be in The returned vector is in |
gapmin |
the minimum gap between arcs in |
p |
a vector in |
tol |
if the approximate distance from |
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.
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
.
spherefromarcs()
,
arcsfromsphere()
,
boundaryfromsphere()
,
spherefromboundary()
,
complementaryarcs()
,
trigpolyroot()
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.