XV Open Cup named after E.V. Pankratiev. GP of Siberia-Swimming
Posted tempestt
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了XV Open Cup named after E.V. Pankratiev. GP of Siberia-Swimming相关的知识,希望对你有一定的参考价值。
给出两个点,找到过这两个点的等角螺线,并求出中间的螺线长
$c = frac{b}{a}$
$p = a imes c^{frac{ heta}{angle}}$
对弧线积分
#include <bits/stdc++.h> using namespace std; long double eps = 1e-8; struct Point { long double x, y; Point(long double _x = 0, long double _y = 0) { x = _x; y = _y; } Point operator - (const Point &b) { return Point(x - b.x, y - b.y); } }a[4]; long double Dot(Point &a, Point b) { return a.x * b.x + a.y * b.y; } long double len(Point &a) { return sqrt(Dot(a, a)); } int cmp(long double x) { if (fabs(x) < eps) return 0; return eps > 0? 1: -1; } int main() { for (int i = 1; i <= 3; ++ i) cin >> a[i].x >> a[i].y; a[1] = a[1] - a[3]; a[2] = a[2] - a[3]; long double tmp = Dot(a[1], a[2]); long double len1 = len(a[1]), len2 = len(a[2]); if (cmp(tmp - len1 * len2) == 0) { long double ans = fabs(len1 - len2); cout << fixed << setprecision(12) << ans << ‘ ‘; return 0; } auto sqr = [&](long double x) -> long double { return x * x; }; long double ang = acos(tmp / len1 / len2); long double ans = ang * len1; if (cmp(len1 - len2)) { long double C = len2 / len1; ans = (C - 1) / log(C) * ans; ans = ans * sqrt(1 + sqr(log(C) / ang)); } cout << fixed << setprecision(12) << ans << ‘ ‘; }
以上是关于XV Open Cup named after E.V. Pankratiev. GP of Siberia-Swimming的主要内容,如果未能解决你的问题,请参考以下文章
XVIII Open Cup named after E.V. Pankratiev. Grand Prix of Peterhof.
XVIII Open Cup named after E.V. Pankratiev. GP of SPb
XVI Open Cup named after E.V. Pankratiev. GP of Ekaterinburg.
XVII Open Cup named after E.V. Pankratiev. XXI Ural Championship
XVII Open Cup named after E.V. Pankratiev. Eastern Grand Prix. Problem F. Buddy Numbers 贪心数论构造
XVII Open Cup named after E.V. Pankratiev Grand Prix of Moscow Workshops, Sunday, April 23, 2017 Pro