I want to calculate the distance between two points in Java

后端 未结 7 1353
花落未央
花落未央 2020-12-29 21:31

OK, so I\'ve written most of a program that will allow me to determine if two circles overlap.

I have no problems whatsoever with my program aside from one issue: t

相关标签:
7条回答
  • 2020-12-29 22:16

    You need to explicitly tell Java that you wish to multiply.

    (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2)
    

    Unlike written equations the compiler does not know this is what you wish to do.

    0 讨论(0)
提交回复
热议问题