Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #define debug(l) cerr<<#l<<' '<<l<<'\n';
- #include "bits/stdc++.h"
- using namespace std;
- #define all(a) a.begin(), a.end()
- typedef long long ll;
- typedef pair<ll, ll> pll;
- typedef long double ld;
- #define Vec Point
- const ld EPS = 1e-13;
- int sign(ld x) {
- if (x > EPS) return 1;
- if (x < -EPS) return -1;
- return 0;
- }
- ld sq(ld x) {
- return x * x;
- }
- struct Point {
- ld x, y;
- Point() : x(0), y(0) {}
- Point(ld _x, ld _y) : x(_x), y(_y) {}
- Point operator-(const Point& other) const {
- return Point(x - other.x, y - other.y);
- }
- Point operator+(const Point& other) const {
- return Point(x + other.x, y + other.y);
- }
- Point operator*(const ld& other) const {
- return Point(x * other, y * other);
- }
- // векторное произведение sin
- ld operator^(const Point& other) const {
- return x * other.y - y * other.x;
- }
- // скалярное произведение cos
- ld operator*(const Point& other) const {
- return x * other.x + y * other.y;
- }
- ld len2() const {
- return sq(x) + sq(y);
- }
- ld len() const {
- return sqrt(len2());
- }
- Point norm() const {
- ld d = len();
- return Point(x / d, y / d);
- }
- bool operator<(const Point& other) const {
- if (sign(x - other.x) != 0) {
- return x < other.x;
- }
- else if (sign(y - other.y) != 0) {
- return y < other.y;
- }
- return false;
- }
- bool operator==(const Point& other) const {
- return sign(x - other.x) == 0 && sign(y - other.y) == 0;
- }
- Point ort() {
- return Point(-y, x);
- }
- void deb() const {
- std::cerr << "(" << x << ", " << y << ")" << std::endl;
- }
- };
- ostream& operator << (ostream& out, const Point& val) {
- return out << val.x << ' ' << val.y;
- }
- istream& operator >> (istream& in, Point& val) {
- return in >> val.x >> val.y;
- }
- //расстояние от точки до точки
- ld dist_points(Point& a, Point& b) {
- return sqrtl(sq(a.x - b.x) + sq(a.y - b.y));
- }
- // угол между двумя векторами в радианах
- ld get_angle(const Vec& a, const Vec& b) {
- return atan2(a ^ b, a * b);
- }
- struct Line {
- ld a, b, c;
- Line() : a(0), b(0), c(0) {}
- Line(const Point& x, const Point& y) : a(y.y - x.y), b(x.x - y.x), c(x.y* y.x - y.y * x.x) {
- //// нормирование прямой
- /*ld d = Point(a, b).len();
- a /= d, b /= d, c /= d;
- if (sign(a) == -1) {
- a = -a;
- b = -b;
- c = -c;
- }
- else if (sign(a) == 0 && sign(b) == 0) {
- a = 0;
- b = -b;
- c = -b;
- }*/
- }/*
- Line norm() {
- ld d =
- }*/
- //ax+by+c=0
- ////y=-c/b
- //Line norm() {
- //
- //}
- Point get() {
- if (sign(b) != 0) {
- return Point(0, -c / b);
- }
- else
- return Point(0, -c);
- }
- bool operator==(const Line& other) const {
- return sign(a - other.a) == 0 && sign(b - other.b) == 0 && sign(c - other.c) == 0;
- }
- };
- signed main() {
- #ifdef _DEBUG
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- srand(time(NULL));
- Point x, y, z;
- cin >> x >> y >> z;
- Vec xy(y - x), xz(z - x);
- xy = xy.norm(),xz = xz.norm();
- Point x_(xy + xz);
- //x_.x = x_.x / 2.0, x_.y = x_.y / 2.0;
- Line ans(Point(x_+x), x);
- cout << fixed << setprecision(6);
- cout << ans.a << ' ' << ans.b << ' ' << ans.c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement