Distance from a point to a line

The distance (or perpendicular distance) from a point to a line is the shortest distance from a fixed point to any point on a fixed infinite line in Euclidean geometry. It is the length of the line segment which joins the point to the line and is perpendicular to the line. The formula for calculating it can be derived and expressed in several ways.

Knowing the shortest distance from a point to a line can be useful in various situations—for example, finding the shortest distance to reach a road, quantifying the scatter on a graph, etc. In Deming regression, a type of linear curve fitting, if the dependent and independent variables have equal variance this results in orthogonal regression in which the degree of imperfection of the fit is measured for each data point as the perpendicular distance of the point from the regression line.

Cartesian coordinates

Line defined by an equation

In the case of a line in the plane given by the equation ax + by + c = 0, where a, b and c are real constants with a and b not both zero, the distance from the line to a point (x0,y0) is[1][2]: p.14 

The point on this line which is closest to (x0,y0) has coordinates:[3]

Horizontal and vertical lines

In the general equation of a line, ax + by + c = 0, a and b cannot both be zero unless c is also zero, in which case the equation does not define a line. If a = 0 and b  0, the line is horizontal and has equation y = -c/b. The distance from (x0, y0) to this line is measured along a vertical line segment of length |y0 - (-c/b)| = |by0 + c| / |b| in accordance with the formula. Similarly, for vertical lines (b = 0) the distance between the same point and the line is |ax0 + c| / |a|, as measured along a horizontal line segment.

Line defined by two points

If the line passes through two points P1=(x1,y1) and P2=(x2,y2) then the distance of (x0,y0) from the line is:

The denominator of this expression is the distance between P1 and P2. The numerator is twice the area of the triangle with its vertices at the three points, (x0,y0), P1 and P2. See: Area of a triangle § Using coordinates. The expression is equivalent to , which can be obtained by rearranging the standard formula for the area of a triangle: , where b is the length of a side, and h is the perpendicular height from the opposite vertex.

Proofs

An algebraic proof

This proof is valid only if the line is neither vertical nor horizontal, that is, we assume that neither a nor b in the equation of the line is zero.

The line with equation ax + by + c = 0 has slope -a/b, so any line perpendicular to it will have slope b/a (the negative reciprocal). Let (m, n) be the point of intersection of the line ax + by + c = 0 and the line perpendicular to it which passes through the point (x0, y0). The line through these two points is perpendicular to the original line, so

Thus, and by squaring this equation we obtain:

Now consider,

using the above squared equation. But we also have,

since (m, n) is on ax + by + c = 0. Thus,

and we obtain the length of the line segment determined by these two points,

[4]

A geometric proof

Diagram for geometric proof

This proof is valid only if the line is not horizontal or vertical.[5]

Drop a perpendicular from the point P with coordinates (x0, y0) to the line with equation Ax + By + C = 0. Label the foot of the perpendicular R. Draw the vertical line through P and label its intersection with the given line S. At any point T on the line, draw a right triangle TVU whose sides are horizontal and vertical line segments with hypotenuse TU on the given line and horizontal side of length |B| (see diagram). The vertical side of ∆TVU will have length |A| since the line has slope -A/B.

PRS and ∆TVU are similar triangles, since they are both right triangles and ∠PSR ≅ ∠TUV since they are corresponding angles of a transversal to the parallel lines PS and UV (both are vertical lines).[6] Corresponding sides of these triangles are in the same ratio, so:

If point S has coordinates (x0,m) then |PS| = |y0 - m| and the distance from P to the line is:

Since S is on the line, we can find the value of m,

and finally obtain:[7]

A variation of this proof is to place V at P and compute the area of the triangle ∆UVT two ways to obtain that where D is the altitude of ∆UVT drawn to the hypoteneuse of ∆UVT from P. The distance formula can then used to express , , and in terms of the coordinates of P and the coefficients of the equation of the line to get the indicated formula.[citation needed]

A vector projection proof

Diagram for vector projection proof
Diagram for vector projection proof

Let P be the point with coordinates (x0, y0) and let the given line have equation ax + by + c = 0. Also, let Q = (x1, y1) be any point on this line and n the vector (a, b) starting at point Q. The vector n is perpendicular to the line, and the distance d from point P to the line is equal to the length of the orthogonal projection of on n. The length of this projection is given by:

Now,

so and

thus

Since Q is a point on the line, , and so,[8]

Another formula

It is possible to produce another expression to find the shortest distance of a point to a line. This derivation also requires that the line is not vertical or horizontal.

The point P is given with coordinates (). The equation of a line is given by . The equation of the normal of that line which passes through the point P is given .

The point at which these two lines intersect is the closest point on the original line to the point P. Hence:

We can solve this equation for x,

The y coordinate of the point of intersection can be found by substituting this value of x into the equation of the original line,

Using the equation for finding the distance between 2 points, , we can deduce that the formula to find the shortest distance between a line and a point is the following:

Recalling that m = -a/b and k = - c/b for the line with equation ax + by + c = 0, a little algebraic simplification reduces this to the standard expression.[9]

Vector formulation

Illustration of the vector formulation.

The equation of a line can be given in vector form:

Here a is the position of a point on the line, and n is a unit vector in the direction of the line. Then as scalar t varies, x gives the locus of the line.

The distance of an arbitrary point p to this line is given by

This formula can be derived as follows: is a vector from p to the point a on the line. Then is the projected length onto the line and so

is a vector that is the projection of onto the line. Thus

is the component of perpendicular to the line. The distance from the point to the line is then just the norm of that vector.[10] This more general formula is not restricted to two dimensions.

Another vector formulation

If the line (l ) goes through point A and has a direction vector , the distance between point P and line (l) is

where is the cross product of the vectors and and where is the vector norm of .

Note that cross products only exist in dimensions 3 and 7 and trivially in dimensions 0 and 1 (where the cross product is constant 0).

See also

Notes

  1. ^ Larson & Hostetler 2007, p. 452
  2. ^ Spain 2007
  3. ^ Larson & Hostetler 2007, p. 522
  4. ^ Between Certainty and Uncertainty: Statistics and Probability in Five Units With Notes on Historical Origins and Illustrative Numerical Examples
  5. ^ Ballantine & Jerbert 1952 do not mention this restriction in their article
  6. ^ If the two triangles are on opposite sides of the line, these angles are congruent because they are alternate interior angles.
  7. ^ Ballantine & Jerbert 1952
  8. ^ Anton 1994, pp. 138-9
  9. ^ Larson & Hostetler 2007, p. 522
  10. ^ Sunday, Dan. "Lines and Distance of a Point to a Line". softSurfer. Retrieved 6 December 2013.

References

Further reading

Read other articles:

ما خفي أعظم النوع صحافة استقصائية تقديم تامر المسحال البلد قطر لغة العمل العربية الإنتاج مدة العرض 60 دقيقة الإصدار القناة قناة الجزيرة عرض لأول مرة في 6 نوفمبر 2016 وصلات خارجية الموقع الرسمي الموقع الرسمي الموقع الرسمي للإنتاج https://www.aljazeera.net تعديل مصدري - تعديل   ما خفي أع...

 

 

Type of computer human interface Natural-language user interface (LUI or NLUI) is a type of computer human interface where linguistic phenomena such as verbs, phrases and clauses act as UI controls for creating, selecting and modifying data in software applications. In interface design, natural-language interfaces are sought after for their speed and ease of use, but most suffer the challenges to understanding wide varieties of ambiguous input.[1] Natural-language interfaces are an ac...

 

 

Colt Canada C7 Colt Canada C7A1 dengan bayonet Jenis Senapan serbu (C7)Karabin (C8) Negara asal  Kanada Sejarah pemakaian Digunakan oleh Lihat Pengguna Sejarah produksi Produsen Colt Canada (saat ini)Diemaco (sebelumnya) Diproduksi 1982–sekarang Varian C7, C7A1, C7A2, C8 Spesifikasi Berat 3,3 kg (7,3 lb) (kosong)3,9 kg (8,6 lb) (dengan magazen 30 peluru) Panjang 1.006 mm (39,6 in) (C7/C7A1/C7A2) (A2 popor dibuka)929,8 mm (36,61 in) (C7A2) (popor dilipat) Panjang laras 50...

يحصل المواطنين الإيرانيين على تأشيرات مجانية أو عند الوصول لـ 45 بلداً وإقليماً حول العالم لحاملي جوازات السفر الإيرانية العادية، وذلك عام 2013.[1] الدول والأقاليم التي تمنح تأشيرات لحاملي جواز سفر جمهورية إيران الإسلامية:  إيران   بدون تأشيرة   تأشيرة عند ا

 

 

Jan Noskiewicz (8 October 1890 – 27 August 1963) was a Polish entomologist specialising in Hymenoptera and Strepsiptera. Noskiewicz was born in Sanok. He was Professor of Systematic Zoology and Zoogeography at (then) Breslau now Wroclaw University. He died in Wroclaw. His collection of 30,000 Aculeata specimens, including holotypes, syntypes and paratypes of is in Museum of Natural History Wroclaw University. Works Jan Noskiewicz With G. Poluszynski. 1928. Embryologische Untersuchungen ...

 

 

ブラッシュアップライフBRUSH UP LIFEジャンル 連続ドラマ企画 マセキ芸能社(協力)脚本 バカリズム演出 水野格狩山俊輔松田健斗出演者 安藤サクラ夏帆木南晴夏松坂桃李染谷将太黒木華仲村トオル臼田あさ美塚地武雅三浦透子市川由衣野呂佳代鈴木浩介山田真歩野間口徹江口のりこ神保悟志志田未来中島ひろ子田中直樹水川あさみ浅野忠信バカリズムナレーター 中村啓子

Der Titel dieses Artikels ist mehrdeutig. Weitere Bedeutungen sind unter Claudius (Begriffsklärung) aufgeführt. Statue des Claudius in den Vatikanischen Museen Tiberius Claudius Caesar Augustus Germanicus (vor seinem Herrschaftsantritt Tiberius Claudius Nero Germanicus; * 1. August 10 v. Chr. in Lugdunum, heute Lyon; † 13. Oktober 54 n. Chr.) war der vierte römische Kaiser der julisch-claudischen Dynastie. Er regierte vom 24. Januar 41 n. Chr. bis zu seinem Tod im Jahr 54. Geboren wurde ...

 

 

ISS JAXA JEM module 日本實驗艙(英語:Japanese Experiment Module,又称希望(きぼう,Kibō)號)是日本宇宙航空研究開發機構製造的國際太空站艙組。 日本實驗艙包含四個模組: 加壓模組(Pressurized Module,PM),為一長11.2公尺、外徑4.4公尺、內徑4.2公尺的圓筒形狀模組設備[1],是日本實驗艙的核心模組。它包含十個國際標準組件掛架(英语:International Standard Payload Rack)(In...

 

 

MigrationsroutenFlugroutenÜberlandrouten Die Migrationskrise an der Grenze zwischen Belarus und der Europäischen Union bezeichnete den Zuwachs an Migranten aus Vorder- und Zentralasien sowie Nordafrika, die seit Juli 2021 versuchen, über die Grenze der Republik Belarus in die Europäische Union nach Lettland, Litauen und Polen (und von dort insbesondere nach Deutschland) zu gelangen. Die gedachte Route über das Staatsgebiet von Belarus in die Europäische Union wurde durch...

Norwegian jurist and politician Christian Cornelius PausMember of the Norway Parliamentfor Lister and MandalIn office1848–1850Member of the Norway Parliamentfor SkienIn office1857–1861 Personal detailsBorn18 October 1800Skien, Telemark, NorwayDied8 April 1879Skien, Telemark, NorwayOccupationLawyer, judge and civil servant Christian Cornelius Paus (18 October 1800 – 8 April 1879) was a Norwegian lawyer, civil servant and politician. He was Governor of Bratsberg (now Telemark) and a Membe...

 

 

1983 single by Stevie Ray Vaughan and Double TroubleLove Struck BabySingle by Stevie Ray Vaughan and Double Troublefrom the album Texas Flood B-sideRude MoodReleased1983 (1983)RecordedNovember 24, 1982 (1982-11-24)GenreBlues, rockLength2:19LabelEpic (US & UK)Songwriter(s)Stevie Ray VaughanProducer(s)Stevie Ray VaughanRichard MullenStevie Ray Vaughan and Double Trouble singles chronology Love Struck Baby (1983) Pride and Joy (1983) Love Struck Baby is a blues rock song ...

 

 

«Аверс» (Бахмач) Повна назва Футбольний клуб«Аверс» Засновано Населений пункт Бахмач,  Україна Стадіон Ліга не виступає Домашня Виїзна Футбольний клуб «Аверс» — український футбольний клуб з міста Бахмача Чернігівської області. Всі сезони в незалежній Україні Сезон...

Ferdinand IKaisar Romawi Suci;Rex RomanorumBerkuasa5 Januari 1531 – 25 Juli 1564Penobatan11 Januari 1531, AachenPendahuluKarl VPenerusMaximilian IIRaja BohemiaBerkuasa24 Oktober 1526 – 25 Juli 1564Penobatan24 Februari 1527, PrahaPendahuluLouis IIPenerusMaximilianRaja Hungaria dan KroasiaBerkuasa16 Desember 1526 – 25 Juli 1564Penobatan3 November 1527, SzékesfehérvárPendahuluLouis IIPenerusMaximilianAdipati Utama AustriaBerkuasa1521–1564PendahuluKarl IPenerusMaximilian II (Austria)Ka...

 

 

Los Naranjos Barrio de la ciudad de Córdoba Coordenadas 31°25′46″S 64°13′31″O / -31.42936944, -64.22530278Entidad Barrio de la ciudad de Córdoba • País  Argentina • Ciudad CórdobaPoblación (2001) Puesto 214.º • Total 1763 hab.[editar datos en Wikidata] El barrio Los Naranjos (originalmente llamado, según la Dirección de Catastro, Barrio Parque Los Naranjos) es un barrio de la ciudad de Córdoba, en Argentina. Se u...

 

 

Area codes that serve most of Connecticut, except its southwest Connecticut state map with area code 860 in red Area codes 860 and 959 are telephone area codes in the North American Numbering Plan in the U.S. state of Connecticut. They are arranged in an overlay plan that covers most of the state, except its southwest, which uses area codes 203 and 475. Area code 860 was created on August 28, 1995, as a numbering plan area split from area code 203, in which the latter was reduced to Fairfield...

2014 studio album by HiraxImmortal LegacyStudio album by HiraxReleasedFebruary 24, 2014Recorded2013GenreThrash metalLabelSPVHirax chronology El Rostro de la Muerte(2009) Immortal Legacy(2014) Immortal Legacy is the fifth studio album by American thrash metal band Hirax, released on February 24, 2014. It is the first album since the 1980s to feature a four-piece band. It is also the final album to feature Jorge Iacobellis and Lance and Steve Harrison.[1] A music video was made ...

 

 

Indian barrister, activist (1910–1983) Bhicoo BatlivalaBatlivala in 1938Born(1910-10-13)13 October 1910Bombay, British IndiaDied10 October 1983(1983-10-10) (aged 72)Burgess Hill, West Sussex, EnglandOther names Bee Mansell Mrs. Guy Mansell Alma materCheltenham Ladies CollegeOccupationBarristerKnown for Called to the Bar aged 21 (1932) First female appointed to Baroda State service (1935) Campaigner for India's independence Campaigning for the release of Mahatma Gandhi an...

 

 

American college basketball season 1989–90 Auburn Tigers men's basketballConferenceSoutheastern ConferenceRecord13–18 (8–10 SEC)Head coachTommy Joe Eagles (1st season)Captains Derrick Dennison (1st year) Zane Arnold (1st year) Home arenaJoel H. Eaves Memorial ColiseumSeasons← 1988–891990–91 → 1989–90 Southeastern Conference men's basketball standings vte Conf Overall Team W   L   PCT W   L   PCT Georgia 13 – 5   .722 2...

香港市民黨Hong Kong Civile Party香港市民黨标志創辦人陳雲成立2021年3月1日意識形態香港城邦自治文化保守主義政治派系城邦派政治立場:右翼香港立法會議席0 / 70 香港區議會議席0 / 458 官方网站香港市民黨Facebook專頁 香港市民黨(英語:Hong Kong Civile Party),是於2021年3月成立的香港修憲派政黨,由知名本土派學者陳雲以及一群保護香港本土利益的年輕香港人創立。 成立 香港...

 

 

The Magnificent SevenPoster film The Magnificent SevenSutradaraAntoine FuquaProduser Roger Birnbaum Todd Black Ditulis oleh Nic Pizzolatto Richard Wenk BerdasarkanSeven Samuraioleh Akira KurosawaShinobu HashimotoHideo OguniPemeran Denzel Washington Chris Pratt Ethan Hawke Vincent D'Onofrio Byung-hun Lee Manuel Garcia-Rulfo Martin Sensmeier Haley Bennett Peter Sarsgaard Penata musik James Horner Simon Franglen SinematograferMauro FiorePenyuntingJohn RefouaPerusahaanproduksi LStar Capital...

 

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!