Solver Distance between two points in two dimensions
Algebra
->
Quadratic Equations and Parabolas
-> Solver Distance between two points in two dimensions
Log On
Quadratics: solvers
Quadratics
Practice!
Practice
Answers archive
Answers
Lessons
Lessons
Word Problems
Word
In Depth
In
Source code of 'Distance between two points in two dimensions'
This Solver (Distance between two points in two dimensions)
was created by by
hummingbird(0)
:
View Source
,
Show
,
Put on YOUR site
About hummingbird
:
==section input Find distance between 2 points with the coordinates: x1 *[input x1=0] y1 *[input y1=0] x2 *[input x2=1] y2 *[input y2=1] You may put negative numbers for negative coordinates. ==section solution perl my $soln = sqrt(($x1-$x2)*($x1-$x2) + ($y1-$y2)*($y1-$y2)); print "The distance (denoted by d) between two points in two dimensions is given by the following formula: {{{d=sqrt((x1-x2)^2 + (y1-y2)^2)}}} Thus in our case, the required distance is {{{d=sqrt(($x1-$x2)^2 + ($y1-$y2)^2)= $soln }}} For more on this concept, refer to <A HREF=Distance_formula.wikipedia>Distance formula</A>. "; ==section output soln, ==section check x1=0 y1=0 x2=3 y2=4 soln=5