Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
derek smythe wrote:so difference is -3 squared which is 6.
derek smythe wrote:
The following code compiles and runs
Darryl Burke wrote:derek, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/44060-calculating-distance-between-two-points-problem.html#post208186
Greg Brannon wrote:So your test points are:
x1, y1 = 2, 4
x2, y2 = 3, 6
And the pencil and paper solution would be
sqrt( (3 - 2)^2 + (6 - 4)^2 )
Try that, and then check to see if that's what you've coded.
derek smythe wrote:wtf db. This is the second time you have noticed that. and the second time you have given me the forthright message. Please read my entire post before doing that again. It makes me look like an ass.
luck, db
There are no new questions, but there may be new answers.
derek smythe wrote:I used a calculator and entered 2 for x1 and 4 for y1, difference is -2 squared which is 4..
Darryl Burke wrote:I see I missed your edit, which was probably done during the time I had the page open. Sorry about that.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|