[ Skill ] 计算两点距离

https://www.cnblogs.com/yeungchie/

  • code
procedure(ycHowFar(a b)
	prog((xAB yAB sAB)
		xAB = xCoord(a) - xCoord(b)
		yAB = yCoord(a) - yCoord(b)
		sAB = sqrt(xAB ** 2 + yAB ** 2)
		return(sAB)
	)
)
  • example
ycHowFar(0:0 1:1)
=>1.414214
posted @ 2020-05-03 21:36  YEUNGCHIE  阅读(1011)  评论(0编辑  收藏  举报