home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!cs.utexas.edu!usc!rpi!sarah!annemarie.albany.edu!hammond
- From: hammond@csc.albany.edu (William F. Hammond)
- Subject: Re: Need: prpndcular dist from pt to line
- In-Reply-To: kedlaya@husc8.harvard.edu's message of 30 Dec 92 03:48:44 GMT
- Message-ID: <HAMMOND.92Dec30111554@annemarie.albany.edu>
- Sender: hammond@sarah.albany.edu (William F. Hammond)
- Organization: Dept of Math & Stat, SUNYA, Albany, NY
- References: <1992Dec29.210554.5350@seas.gwu.edu>
- <kedlaya.725687324@husc.harvard.edu>
- Date: 30 Dec 92 11:15:54
- Lines: 66
-
- In article <kedlaya.725687324@husc.harvard.edu> kedlaya@husc8.harvard.edu
- (Kiran Kedlaya) writes:
-
- > ...
- > More generally, in n-space the distance from the point
- > (z_1, ..., z_n) to the line a_1x_1 + ... + a_nx_n + c = 0
- > is just |a_1z_1 + ... + a_nz_n + c| divided by the square
- > root of a_1^2 + ... + a_n^2.
- > ...
-
- When n is 3 (or more) this is a formula for distance from the
- point z to the PLANE (or hyperplane) given by the single linear
- equation. An explanation of this formula can be found in most
- current third semester calculus books.
-
- That posting was in response to:
-
- > From: ilan@seas.gwu.edu (Ilan Berkner)
- > Newsgroups: sci.math
- > Subject: Need: prpndcular dist from pt to line
- > Date: 29 Dec 92 21:05:54 GMT
- > Organization: George Washington University
- >
- > Given a line, or line segment (I can do both), I need to find the
- > distance from a point (that may or may not be on the line) to that line.
- > If the point is on the line, then the distance is zero, obviously.
- > ...
-
- P
- .
-
-
- _________________________________________
- A B
-
- In the picture above, which is a SCHEMATIC picture that could represent
- any situation involving three points A, B, and P in n-dimensional
- real Euclidean space, the simplest general way to find the distance
- from P to the line AB is to take the LENGTH of the vector that
- is the "perpendicular projection" of the vector AP [ = P - A ]
- on the vector AB = [ B - A ].
-
- The "perpendicular projection" is the difference vector
-
- AP - proj(AP, AB) ,
-
- where proj(AP, AB) is the "(parallel) projection" of AP on AB .
- For "proj" one has the formula
-
- proj(V,W) = (V.W/W.W) W ,
-
- where "." is the scalar product (or "dot" product) of two vectors.
- [Note that replacing W by rW for a positive scalar r does not
- change proj(V,W); that is, proj(V,W) depends on W only for its
- "direction".] More details are available in most current third
- semester calculus books.
-
- All of this is very easy to "code". It involves only rational
- arithmetic (quotients of integers) but for the extraction of a single
- square root at the final stage in computing the length.
-
- ----------------------------------------------------------------------
- William F. Hammond Dept. of Mathematics & Statistics
- 518-442-4625 SUNYA, Albany, NY 12222 (U.S.A.)
- hammond@csc.albany.edu FAX: 518-442-4731
- ----------------------------------------------------------------------
-