Difference between revisions of "Distance Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
m
 
(20 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|geometry}}
{{command|geometry}}
+
;Distance( <Point>, <Object> ): Yields the shortest distance between a point and an object.
; Distance[Point A, Object O]: Yields the (shortest) distance between points ''A'' and the Object. Works for Points, Segments, Lines, Conics and Implicit Curves. When ''f'' is a function, <code>Distance[A,f]</code> returns distance between ''A'' and ''(x(A),f(x(A)))''.
+
:{{examples|1=<div>
: {{Note| In GeoGebra 3.'''Distance[Point A, Segment]''' gave the distance to the segment extended to an infinite line. From GeoGebra 4.0 it gives the distance to the Segment itself. }}
+
:*<code><nowiki> Distance((2, 1), x^2 + (y - 1)^2 = 1)</nowiki></code> yields ''1''
; Distance[Line g, Line h]: Yields the distance between the parallel lines ''g'' and ''h''.
+
:*<code><nowiki>Distance((2, 1, 2), (1, 3, 0))</nowiki> </code> yields ''3''
: {{Note| The distance between intersecting lines is 0. Thus, this command is only interesting for parallel lines.}}
+
:*Let ''f'' be a function and ''A'' be a point. <code><nowiki>Distance(A, f)</nowiki></code> yields the distance between ''A'' and ''(x(A), f(x(A)))''.
: {{Note| See also [[Image:Tool Distance.gif]] [[Distance or Length Tool|Distance or Length]] tool .}}
+
</div>}}
{{betamanual|version=5.0|
+
: {{Note| 1=The command works for points, segments, lines, conics, functions, and implicit curves. For functions, it uses a numerical algorithm which works better for polynomials. }}
{{Note|1=From GeoGebra 5, this command will work with 3D objects as well}}
+
<br>
}}
+
 
 +
;Distance( <Line>, <Line> ): Yields the distance between two lines.
 +
:{{examples|1=<div>
 +
:*<code><nowiki>Distance(y = x + 3, y = x + 1)</nowiki></code> yields ''1.41''
 +
:*<code><nowiki>Distance(y = 3x + 1, y = x + 1)</nowiki></code> yields ''0''
 +
:* Let ''a: X = (-4, 0, 0) + λ*(4, 3, 0)'' and ''b: X = (0, 0, 0) + λ*(0.8, 0.6, 0)''.  <code><nowiki>Distance(a, b)</nowiki></code> yields ''2.4''</div>}}
 +
: {{Note| 1=The distance between intersecting lines is ''0''. Thus, this command is only interesting for parallel lines.}}
 +
<br>
 +
;Distance( <Plane>, <Plane> )
 +
: Yields the distance between the two planes.
 +
:{{example|1=Let ''eq1: x + y 2x = 1'' and ''eq2: 2x + 2y +4z = -2''.  <code><nowiki>Distance(eq1, eq2)</nowiki></code> yields ''0.82''}}
 +
: {{Note| 1=The distance between intersecting planes is 0. Thus, this command is only meaningful for parallel planes.}}
 +
<br>
 +
{{Note| 1=See also [[File:Mode distance.svg|link=|20px]] [[Distance or Length Tool|Distance or Length]] tool .}}

Latest revision as of 18:06, 5 January 2023


Distance( <Point>, <Object> )
Yields the shortest distance between a point and an object.
Examples:
  • Distance((2, 1), x^2 + (y - 1)^2 = 1) yields 1
  • Distance((2, 1, 2), (1, 3, 0)) yields 3
  • Let f be a function and A be a point. Distance(A, f) yields the distance between A and (x(A), f(x(A))).
Note: The command works for points, segments, lines, conics, functions, and implicit curves. For functions, it uses a numerical algorithm which works better for polynomials. 


Distance( <Line>, <Line> )
Yields the distance between two lines.
Examples:
  • Distance(y = x + 3, y = x + 1) yields 1.41
  • Distance(y = 3x + 1, y = x + 1) yields 0
  • Let a: X = (-4, 0, 0) + λ*(4, 3, 0) and b: X = (0, 0, 0) + λ*(0.8, 0.6, 0)Distance(a, b) yields 2.4
Note: The distance between intersecting lines is 0. Thus, this command is only interesting for parallel lines.


Distance( <Plane>, <Plane> )
Yields the distance between the two planes.
Example: Let eq1: x + y 2x = 1 and eq2: 2x + 2y +4z = -2Distance(eq1, eq2) yields 0.82
Note: The distance between intersecting planes is 0. Thus, this command is only meaningful for parallel planes.


Note: See also Mode distance.svg Distance or Length tool .
© 2024 International GeoGebra Institute