We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请教为什么ssg这么计算夹角?我理解计算cone圆锥的夹角不是这么计算吧。
float djk = distance_->compare(data_ + dimension_ * (size_t)result[t].id, data_ + dimension_ * (size_t)p.id, (unsigned)dimension_); float cos_ij = (p.distance + result[t].distance - djk) / 2 / sqrt(p.distance * result[t].distance); 希望能得到指教。
The text was updated successfully, but these errors were encountered:
这就是余弦定理的公式啊:
cos A = (b²+c²-a²)/2bc
只是代码里算距离的函数默认算出来的是没开根号前的欧氏距离,带入余弦定理公式就是这个形态了。
Sorry, something went wrong.
No branches or pull requests
请教为什么ssg这么计算夹角?我理解计算cone圆锥的夹角不是这么计算吧。
float djk = distance_->compare(data_ + dimension_ * (size_t)result[t].id,
data_ + dimension_ * (size_t)p.id,
(unsigned)dimension_);
float cos_ij = (p.distance + result[t].distance - djk) / 2 /
sqrt(p.distance * result[t].distance);
希望能得到指教。
The text was updated successfully, but these errors were encountered: