home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / math / 17508 < prev    next >
Encoding:
Text File  |  1992-12-30  |  3.1 KB  |  80 lines

  1. Newsgroups: sci.math
  2. Path: sparky!uunet!cs.utexas.edu!usc!rpi!sarah!annemarie.albany.edu!hammond
  3. From: hammond@csc.albany.edu (William F. Hammond)
  4. Subject: Re: Need: prpndcular dist from pt to line
  5. In-Reply-To: kedlaya@husc8.harvard.edu's message of 30 Dec 92 03:48:44 GMT
  6. Message-ID: <HAMMOND.92Dec30111554@annemarie.albany.edu>
  7. Sender: hammond@sarah.albany.edu (William F. Hammond)
  8. Organization: Dept of Math & Stat, SUNYA, Albany, NY
  9. References: <1992Dec29.210554.5350@seas.gwu.edu>
  10.     <kedlaya.725687324@husc.harvard.edu>
  11. Date: 30 Dec 92 11:15:54
  12. Lines: 66
  13.  
  14. In article <kedlaya.725687324@husc.harvard.edu> kedlaya@husc8.harvard.edu
  15. (Kiran Kedlaya) writes:
  16.  
  17. > ...
  18. > More generally, in n-space the distance from the point
  19. > (z_1, ..., z_n) to the line a_1x_1 + ... + a_nx_n + c = 0
  20. > is just |a_1z_1 + ... + a_nz_n + c| divided by the square
  21. > root of a_1^2 + ... + a_n^2.
  22. > ...
  23.  
  24. When  n  is 3 (or more) this is a formula for distance from the
  25. point  z  to the PLANE (or hyperplane) given by the single linear
  26. equation.  An explanation of this formula can be found in most
  27. current third semester calculus books.
  28.  
  29. That posting was in response to:
  30.  
  31. > From: ilan@seas.gwu.edu (Ilan Berkner)
  32. > Newsgroups: sci.math
  33. > Subject: Need: prpndcular dist from pt to line
  34. > Date: 29 Dec 92 21:05:54 GMT
  35. > Organization: George Washington University
  36. > Given a line, or line segment (I can do both), I need to find the 
  37. > distance from a point (that may or may not be on the line) to that line.
  38. > If the point is on the line, then the distance is zero, obviously.
  39. > ...
  40.  
  41.                                          P
  42.                                         .
  43.  
  44.  
  45.                  _________________________________________
  46.                 A                                         B
  47.  
  48. In the picture above, which is a SCHEMATIC picture that could represent
  49. any situation involving three points  A, B, and  P  in  n-dimensional
  50. real Euclidean space, the simplest general way to find the distance
  51. from  P  to the line  AB  is to take the LENGTH of the vector that
  52. is the "perpendicular projection" of the vector  AP  [ = P - A ]
  53. on the vector  AB = [ B - A ].
  54.  
  55. The "perpendicular projection" is the difference vector
  56.  
  57.                          AP - proj(AP, AB) ,
  58.  
  59. where  proj(AP, AB)  is the "(parallel) projection" of  AP  on  AB .
  60. For "proj" one has the formula
  61.  
  62.                       proj(V,W) = (V.W/W.W) W ,
  63.  
  64. where "." is the scalar product (or "dot" product) of two vectors.
  65. [Note that replacing  W  by  rW  for a positive scalar  r  does not
  66. change proj(V,W);  that is, proj(V,W) depends on  W  only for its
  67. "direction".]  More details are available in most current third
  68. semester calculus books.
  69.  
  70. All of this is very easy to "code".  It involves only rational
  71. arithmetic (quotients of integers) but for the extraction of a single
  72. square root at the final stage in computing the length.
  73.  
  74. ----------------------------------------------------------------------
  75. William F. Hammond                   Dept. of Mathematics & Statistics
  76. 518-442-4625                         SUNYA, Albany, NY 12222 (U.S.A.)
  77. hammond@csc.albany.edu               FAX: 518-442-4731
  78. ----------------------------------------------------------------------
  79.