Distance Between Two Ellipses in 3D

Similar documents
dy dx = xey (a) y(0) = 2 (b) y(1) = 2.5 SOLUTION: See next page

AP Calculus BC Chapter 10 Part 1 AP Exam Problems

MATH 128A, SUMMER 2009, FINAL EXAM SOLUTION

!!"#"$%&#'()!"#&'(*%)+,&',-)./0)1-*23)

THE 2-BODY PROBLEM. FIGURE 1. A pair of ellipses sharing a common focus. (c,b) c+a ROBERT J. VANDERBEI

3, so θ = arccos

Solutions for homework 12

Math 334 Fall 2011 Homework 11 Solutions

Chapter 6. Systems of First Order Linear Differential Equations

Some Basic Information about M-S-D Systems

Parametrics and Vectors (BC Only)

Kinematics and kinematic functions

10. State Space Methods

Y 0.4Y 0.45Y Y to a proper ARMA specification.

THE BERNOULLI NUMBERS. t k. = lim. = lim = 1, d t B 1 = lim. 1+e t te t = lim t 0 (e t 1) 2. = lim = 1 2.

a. Show that these lines intersect by finding the point of intersection. b. Find an equation for the plane containing these lines.

Chapter 3 Boundary Value Problem

15. Vector Valued Functions

Solutionbank Edexcel AS and A Level Modular Mathematics

System of Linear Differential Equations

Solutions of Sample Problems for Third In-Class Exam Math 246, Spring 2011, Professor David Levermore

Math 116 Practice for Exam 2

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

Math 315: Linear Algebra Solutions to Assignment 6

The motions of the celt on a horizontal plane with viscous friction

Let us start with a two dimensional case. We consider a vector ( x,

PENALIZED LEAST SQUARES AND PENALIZED LIKELIHOOD

10.1 EXERCISES. y 2 t 2. y 1 t y t 3. y e

Chapter 2. First Order Scalar Equations

GENERALIZATION OF THE FORMULA OF FAA DI BRUNO FOR A COMPOSITE FUNCTION WITH A VECTOR ARGUMENT

Chapter 7: Solving Trig Equations

Concourse Math Spring 2012 Worked Examples: Matrix Methods for Solving Systems of 1st Order Linear Differential Equations

MATH 2050 Assignment 9 Winter Do not need to hand in. 1. Find the determinant by reducing to triangular form for the following matrices.

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Chapters 6 & 7: Trigonometric Functions of Angles and Real Numbers. Divide both Sides by 180

From Particles to Rigid Bodies

1 1 + x 2 dx. tan 1 (2) = ] ] x 3. Solution: Recall that the given integral is improper because. x 3. 1 x 3. dx = lim dx.

Basilio Bona ROBOTICA 03CFIOR 1

Innova Junior College H2 Mathematics JC2 Preliminary Examinations Paper 2 Solutions 0 (*)

The equation to any straight line can be expressed in the form:

CERTAIN CLASSES OF SOLUTIONS OF LAGERSTROM EQUATIONS

2.7. Some common engineering functions. Introduction. Prerequisites. Learning Outcomes

AP Calculus BC - Parametric equations and vectors Chapter 9- AP Exam Problems solutions

Math 1. Two-Hours Exam December 10, 2017.

2.1: What is physics? Ch02: Motion along a straight line. 2.2: Motion. 2.3: Position, Displacement, Distance

Roller-Coaster Coordinate System

Chapter #1 EEE8013 EEE3001. Linear Controller Design and State Space Analysis

MATH 5720: Gradient Methods Hung Phan, UMass Lowell October 4, 2018

Linear Dynamic Models

Lecture 20: Riccati Equations and Least Squares Feedback Control

23.2. Representing Periodic Functions by Fourier Series. Introduction. Prerequisites. Learning Outcomes

Solutions to Assignment 1

An Introduction to Malliavin calculus and its applications

Oscillation of an Euler Cauchy Dynamic Equation S. Huff, G. Olumolode, N. Pennington, and A. Peterson

( ) 2. Review Exercise 2. cos θ 2 3 = = 2 tan. cos. 2 x = = x a. Since π π, = 2. sin = = 2+ = = cotx. 2 sin θ 2+

Laplace Transforms. Examples. Is this equation differential? y 2 2y + 1 = 0, y 2 2y + 1 = 0, (y ) 2 2y + 1 = cos x,

Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

ON THE DEGREES OF RATIONAL KNOTS

BEng (Hons) Telecommunications. Examinations for / Semester 2

Math Week 14 April 16-20: sections first order systems of linear differential equations; 7.4 mass-spring systems.

Operators related to the Jacobi setting, for all admissible parameter values

MEI Mechanics 1 General motion. Section 1: Using calculus

6.2 Transforms of Derivatives and Integrals.

Robust estimation based on the first- and third-moment restrictions of the power transformation model

Lecture 23 Damped Motion

ADDITIONAL MATHEMATICS PAPER 1

Answers to 1 Homework

where the coordinate X (t) describes the system motion. X has its origin at the system static equilibrium position (SEP).

LAPLACE TRANSFORM AND TRANSFER FUNCTION

2. Nonlinear Conservation Law Equations

KINEMATICS IN ONE DIMENSION

Week #13 - Integration by Parts & Numerical Integration Section 7.2

Differential Equations

The expectation value of the field operator.

k 1 k 2 x (1) x 2 = k 1 x 1 = k 2 k 1 +k 2 x (2) x k series x (3) k 2 x 2 = k 1 k 2 = k 1+k 2 = 1 k k 2 k series

Application 5.4 Defective Eigenvalues and Generalized Eigenvectors

Math 116 Second Midterm March 21, 2016

Unsteady Flow Problems

The average rate of change between two points on a function is d t

Elements of Computer Graphics

Georey E. Hinton. University oftoronto. Technical Report CRG-TR February 22, Abstract

Two Coupled Oscillators / Normal Modes

Tracking Adversarial Targets

Mathcad Lecture #8 In-class Worksheet Curve Fitting and Interpolation

d 1 = c 1 b 2 - b 1 c 2 d 2 = c 1 b 3 - b 1 c 3

translational component of a rigid motion appear to originate.

Math 10B: Mock Mid II. April 13, 2016

ODEs II, Lecture 1: Homogeneous Linear Systems - I. Mike Raugh 1. March 8, 2004

(1) (2) Differentiation of (1) and then substitution of (3) leads to. Therefore, we will simply consider the second-order linear system given by (4)

Directional Tubular Surfaces

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

SINUSOIDAL WAVEFORMS

Matlab and Python programming: how to get started

MTH Feburary 2012 Final term PAPER SOLVED TODAY s Paper

Fractional Method of Characteristics for Fractional Partial Differential Equations

Let ( α, β be the eigenvector associated with the eigenvalue λ i

Wavelet Methods for Time Series Analysis. What is a Wavelet? Part I: Introduction to Wavelets and Wavelet Transforms. sines & cosines are big waves

EE 315 Notes. Gürdal Arslan CLASS 1. (Sections ) What is a signal?

Lie Derivatives operator vector field flow push back Lie derivative of

Week 1 Lecture 2 Problems 2, 5. What if something oscillates with no obvious spring? What is ω? (problem set problem)

Transcription:

Disance Beween Two Ellipses in 3D David Eberly Magic Sofware 6006 Meadow Run Cour Chapel Hill, NC 27516 eberly@magic-sofware.com 1 Inroducion An ellipse in 3D is represened by a cener C, uni lengh axes U and V wih corresponding axis lenghs a and b, and a plane conaining he ellipse, N ( X C) = 0 where N is a uni lengh normal o he plane. The vecors U, V, and N form a righ handed orhonormal coordinae sysem (he marix wih hese vecors as columns is orhonormal wih deerminan 1). The ellipse is parameerized as X = C + a cos(θ) U + b sin(θ) V for angles θ [0, 2π). The ellipse is also defined by he wo polynomial equaions N ( X C) = 0 ( X C) ( U U a 2 + V V b 2 ) ( X C) = 1 where he las equaion is wrien as a quadraic form. The firs equaion defines a plane and he second equaion defines an ellipsoid. The inersecion of plane and ellipsoid is an ellipse. 2 Soluion as Polynomial Sysem The wo ellipses are N 0 ( X C 0 ) = 0 and ( X C 0 ) A 0 ( X C 0 ) = 1 where A 0 = U 0U 0 /a 2 0 + V 0V 0 /b 2 0 and N 1 ( Y C 1 ) = 0 and ( Y C 1 ) A 1 ( Y C 1 ) = 1 where A 1 = U 1U 1 /a 2 1 + V 1V 1 /b 2 1. The problem is o minimize he squared disance Y Y 2 subjec o he four consrains menioned above. The problem can be solved wih he mehod of Lagrange mulipliers. Inroduce four new parameers, α, β, γ, and δ and minimize F ( X, Y ; α, β, γ, δ) = X Y 2 + α(( X C 0 ) A 0 ( X C 0 ) 1) + β( N 0 ( X C 0 ) 0) +γ(( Y C 1 ) A 1 ( Y C 1 ) 1) + δ( N 1 ( Y C 1 ) 0). 1

Taking derivaives yields F X = 2( X Y ) + 2αA 0 ( X C 0 ) + β N 0 F Y = 2( X Y ) + 2γA 1 ( Y C 1 ) + δ N 1 F α = ( X C 0 ) A 0 ( X C 0 ) 1 F β = N 0 ( X C 0 ) F γ = ( Y C 1 ) A 1 ( Y C 1 ) 1 F δ = N 1 ( Y C 1 ) Seing he las four equaions o zero yields he four original consrains. Seing he firs equaion o he zero vecor and muliplying by ( X C 0 ) yields α = 2( X C 0 ) ( X Y ). Seing he firs equaion o he zero vecor and muliplying by N 0 yields Similar manipulaions of he second equaion yield and The firs wo derivaive equaions become β = 2 N 0( X Y ). γ = 2( Y C 1 ) ( X Y ) δ = 2 N 1( X Y ). M 0 ( X Y ( ) = N0 N 0 + A 0 ( X C 0 )( X C ) 0 ) I ( X Y ) = 0 M 1 ( X Y ( ) = N1 N 1 + A 1 ( Y C 1 )( Y C ) 1 ) I ( X Y ) = 0 Observe ha M 0 N0 = 0, M 0 A 0 ( X C 0 ) = 0, and M 0 ( N 0 ( X C 0 )) = N 0 ( X C 0 ). Therefore, M 0 = W 0 W 0 / W 0 2 where W 0 = N 0 ( X C 0 ). Similarly, M 1 = W 1 W 1 / W 1 2 where W 1 = N 1 ( Y C 1 ). The previous displayed equaions are equivalen o W 0( X Y ) = 0 and W 1( X Y ) = 0. The poins X = (x 0, x 1, x 2 ) and Y = (y 0, y 1, y 2 ) ha aain minimum disance beween he wo ellipses are 2

soluions o he six quadraic equaions in six unknowns, p 0 (x 0, x 1, x 2 ) = N 0 ( X C 0 ) = 0, p 1 (x 0, x 1, x 2 ) = ( X C 0 ) A 0 ( X C 0 ) = 1, p 2 (x 0, x 1, x 2, y 0, y 1, y 2 ) = ( X Y ) N 0 ( X C 0 ) = 0, q 0 (y 0, y 1, y 2 ) = N 1 ( Y C 1 ) = 0, q 1 (y 0, y 1, y 2 ) = ( Y C 1 ) A 1 ( Y C 1 ) = 1, q 2 (x 0, x 1, x 2, y 0, y 1, y 2 ) = ( X Y ) N 1 ( Y C 1 ) = 0. On a compuer algebra sysem ha suppors he resulan operaion for eliminaing polynomial variables, he following se of operaions leads o a polynomial in one variable. Le Resulan[P, Q, z] denoe he resulan of polynomials P and Q where he variable z is eliminaed, r 0 (x 0, x 1, y 0, y 1, y 2 ) = Resulan[p 0, p 2, x 2 ] r 1 (x 0, x 1 ) = Resulan[p 1, p 2, x 2 ] r 2 (x 0, x 1, y 0, y 1 ) = Resulan[r 0, q 2, y 2 ] s 0 (x 0, x 1, x 2, y 0, y 1 ) = Resulan[q 0, q 2, y 2 ] s 1 (y 0, y 1 ) = Resulan[q 1, q 2, y 2 ] s 2 (x 0, x 1, y 0, y 1 ) = Resulan[s 0, p 2, x 2 ] r 3 (x 0, y 0, x 1 ) = Resulan[r 2, r 1, x 1 ] r 4 (x 0, y 0 ) = Resulan[r 3, s 1, y 1 ] s 3 (x 0, x 1, y 0 ) = Resulan[s 2, s 1, y 1 ] s 4 (x 0, y 0 ) = Resulan[s 3, r 1, x 1 ] φ(x 0 ) = Resulan[r 4, s 4, y 0 ] For wo circles, he degree of φ is 8. For a circle and an ellipse, he degree of φ is 12. For wo ellipses, he degree of φ is 16. 3

3 Soluion using Trigonomeric Approach Le he wo ellipses be X = C 0 + a 0 cos(θ) U 0 + b 0 sin(θ) V 0 Y = C 1 + a 1 cos(φ) U 1 + b 1 sin(φ) V 1 for θ [0, 2π) and φ [0, 2π). The squared disance beween any wo poins on he ellipses is F (θ, φ) = X(θ) Y (φ) 2. The problem is o minimize F (θ, φ). Define c 0 = cos(θ), s 0 = sin(θ), c 1 = cos(φ), and s 1 = sin(φ). Compue derivaives, F θ = ( X(θ) Y (φ)) X (θ) and F φ = ( X(θ) Y (φ)) Y (φ). Seing hese equal o zero leads o he wo polynomial equaions in c 0, s 0, c 1, and s 1. The wo polynomial consrains for he sines and cosines are also lised. p 0 = (a 2 0 b 2 0)s 0 c 0 + a 0 (α 00 + α 01 s 1 + α 02 c 1 )s 0 + b 0 (β 00 + β 01 s 1 + β 02 c 1 )c 0 = 0 p 1 = (a 2 1 b 2 1)s 1 c 1 + a 1 (α 10 + α 11 s 0 + α 12 c 0 )s 1 + b 1 (β 10 + β 11 s 0 + β 12 c 0 )c 1 = 0 q 0 = s 2 0 + c 2 0 1 = 0 q 1 = s 2 1 + c 2 1 1 = 0 This is a sysem of four quadraic polynomial equaions in four unknowns and can be solved wih resulans: r 0 (s 0, s 1, c 1 ) = Resulan[p 0, q 0, c 0 ] r 1 (s 0, s 1, c 0 ) = Resulan[p 1, q 1, c 1 ] r 2 (s 0, s 1 ) = Resulan[r 0, q 1, c 1 ] r 3 (s 0, s 1 ) = Resulan[r 1, q 0, c 0 ] φ(s 0 ) = Resulan[r 2, r 3, s 1 ] Alernaively, we can use he simple naure of q 0 and q 1 o do some of he eliminaion. Le p 0 = α 0 s 0 + β 0 c 0 + γ 0 s 0 c 0 where α 0 and β 0 are linear polynomials in s 1 and c 1. Similarly, p 1 = α 1 s 1 + β 1 c 1 + γ 1 s 1 c 1 where α 1 and β 1 are linear polynomials in s 0 and c 0. Solving for c 0 in p 0 = 0 and c 1 in p 1 = 0, squaring, and using he q i consrains leads o r 0 = (1 s 2 0)(γ 0 s 0 + β 0 ) 2 α 2 0s 2 0 = 0 r 1 = (1 s 2 1)(γ 1 s 1 + β 1 ) 2 α 2 1s 2 1 = 0 Using he q i consrains, wrie r i = r i 0 + r i 1c 1 i, i = 0, 1, where he r ij are polynomials in s 0 and s 1. The erms r i 0 are degree 4 and he erms r i1 is degree 3. Solving for c 0 in r 1 = 0 and c 1 in r 0 = 0, squaring, and 4

using he q i consrains leads o w 0 = (1 s 2 1)r 2 01 r 2 00 = 8 j=0 w 0js j 0 = 0 w 1 = (1 s 2 0)r 2 11 r 2 10 = 4 j=0 w 1js j 0 = 0 The coefficiens w ij are polynomials in s 1. The degrees of w 00 hrough w 08 respecively are 4, 3, 4, 3, 4, 3, 2, 1, and 0. The degree of w 1j is 8 j. Toal degree for each of w i is 8. The final eliminaion can be compued using a Bezou deerminan, φ(s 1 ) = de[e ij ], where he underlying marix is 8x8 and he enry is e ij = min(8,17 i j) k=max(9 i,9 j) v k,17 i j k where v i,j = w 0i w 1j w 0j w 1i. If he i or j index is ou of range in he w erms, hen he erm is assumed o be zero. The soluions o φ = 0 are he candidae poins for s 1. For each s 1, wo c 1 values are compued using s 2 1 + c 2 1 = 1. For each s 1, he roos of he polynomial w 1 (s 0 ) are compued. For each s 0, wo c 0 values are compued using s 2 0 + c 2 0 = 1. Ou of all such candidaes, X Y 2 can be compued and he minimum value is seleced. 4 Numerical Soluion Neiher algebraic mehod above seems reasonable. Each looks very slow o compue and you have he usual numerical problems wih polynomials of large degree. I have no implemened he following, bu my guess is i is an alernaive o consider. Implemen a disance calculaor for poin o ellipse (in 3D). This is a funcion of a single parameer, say F (θ) for θ [0, 2π]. Use a numerical minimizer ha does no require derivaive calculaion (Powell s mehod for example) and minimize F on he inerval [0, 2π]. The scheme is ieraive and hopefully converges rapidly o he soluion. 5