This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 181
using (29.1) and (29.2) to deﬁne x(λ) and y (λ).
These formulas fail when z1 = 0 or z2 = 0. There are two points to check, depending on whether it is shorter to move horizontally or vertically to the boundary.
When z = 0, for example, then the solution is either (x, y ) = (0, β ) or (α, 0), depending on whether β or α is smaller. Full details are given in the sample program
for Challenge 3 and also in a description by David Eberly . CHALLENGE 29.3. A sample program appears on the website as dist to ellipse.m.
The testing program plots the distances on a grid of points in the ellipse. Note that
it is important to test points that are near zero. To validate the program, we might
repeat the runs with various values of α and β , and also test the program for a
point bf z outside the ellipse. CHALLENGE 29.4. The results are shown in Figures 29.3 and 29.4, created
with a program on the website. The meshes we used had the same reﬁnement
as that determined for the circular domain of Challenge 1. A sensitivity analysis
should be done by reﬁning the mesh once to see how much the solution changes in
order to obtain an error estimate.
Note that it would be more computationally eﬃcient to take advantage of the
sequence of problems being solved by using the solution at the previous value of αθ
as an initial guess for the next value. See Chapter 24 for more information on such
 David Eberly, Distance from a Point to an Ellipse in 2D, Magic Software, Inc.
View Full Document
- Fall '11