how would I convert the sqrt(x2 − x1)^2 (y2 − y1)^2 to proper java code [closed]

StackOverflow https://stackoverflow.com/questions/15123419

  •  16-03-2022
  •  | 
  •  

Pergunta

How would I convert the equation for the distance between two points:

sqrt((x2 − x1)^2 + (y2 − y1)^2) 

into proper Java code?

Foi útil?

Solução

You can use Math.pow and Math.sqrt of package java.lang.Math

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top