什么是负平方欧氏距离?
它被描述为-||xi-xy||^2
。
那么对于2个二维点我是这样编码的吗?
- ((x1-x2) + (y1-y2))^2
或
-( (x1-x2)^2 + (y1-y2)^2 )
或
-(sqrt( (x1-x2)^2 + (y1-y2)^2 ))
或其他方式?
It is described as -||xi-xy||^2
.
So for 2 two dimensional points do I code it like this?
- ((x1-x2) + (y1-y2))^2
or
-( (x1-x2)^2 + (y1-y2)^2 )
or
-(sqrt( (x1-x2)^2 + (y1-y2)^2 ))
or some other way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正确答案是
数学描述是准确的,但对实现没有用处。它被表示为点之间距离的平方,如果直接实现,则类似于:
可以简化为
您的#2。
The correct answer is
The mathematical description is accurate, but not useful for implementation. It's stated as the square of the distance between the points, which if implemented directly would be something like:
which can simplified to
which is your #2.
第三个是距离的负值。第二个似乎是距离平方的负数。
The third is the negative of the distance. The second appears to be the negative of the square of the distance.