Editing Computational geometry

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 303: Line 303:
  
 
==Translation along a line==
 
==Translation along a line==
Given some line <math>Ax + By + C = 0</math> and a point <math>(x_0, y_0)</math> known to be on the line, we wish to locate another point on the line that is distance <math>h</math> away from <math>(x_0, y_0)</math>. We can do this by observing that the general point is given by <math>(x_0 - Bt, y_0 + At)</math>, which is distance <math>\sqrt{(Bt)^2 + (At)^2} = t \sqrt{A^2+B^2} = h</math> away from <math>(x_0, y_0)</math>. Therefore, we want <math>t = \frac{h}{\sqrt{A^2+B^2}}</math>, and finally obtain <math>\left(x_0 - \frac{Bh}{\sqrt{A^2+B^2}}, y_0 + \frac{Ah}{\sqrt{A^2+B^2}}\right)</math>. Note that unless <math>h=0</math>, there is another possible answer, which is simply "on the other side": <math>\left(x_0 + \frac{Bh}{\sqrt{A^2+B^2}}, y_0 - \frac{Ah}{\sqrt{A^2+B^2}}\right)</math>.
+
Given some line <math>Ax + By + C = 0</math> and a point <math>(x_0, y_0)</math> known to be on the line, we wish to locate another point on the line that is distance <math>h</math> away from <math>(x_0, y_0)</math>. We can do this by observing that the general point is given by <math>(x_0 - Bt, y_0 + At)</math>, which is distance <math>\sqrt{(Bt)^2 + (At)^2} = t \sqrt{A^2+B^2}</math> away from <math>(x_0, y_0)</math>. Therefore, we want <math>t = \frac{h}{A^2+B^2}</math>, and finally obtain <math>\left(x_0 - \frac{Bh}{A^2+B^2}, y_0 + \frac{Ah}{A^2+B^2}\right)</math>. Note that unless <math>h=0</math>, there is another possible answer, which is simply "on the other side": <math>\left(x_0 + \frac{Bh}{A^2+B^2}, y_0 - \frac{Ah}{A^2+B^2}\right)</math>.
  
 
==Dropping a perpendicular==
 
==Dropping a perpendicular==

Please note that all contributions to PEGWiki are considered to be released under the Attribution 3.0 Unported (see PEGWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)

Templates used on this page: