nyoj_68:三点顺序(计算几何)

时间:2023-03-09 07:23:24
nyoj_68:三点顺序(计算几何)

题目链接

根据 AB*AC的值进行判断即可(ps,结果为0时不构成三角形)

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;

struct point
{
    double x,y;
    point operator -(const point& rhs)
    {
        point ret;
        ret.x=x-rhs.x;ret.y=y-rhs.y;
        return ret;
    }
    double operator *(const point& rhs)//“叉乘”
    {
        return x*rhs.y-y*rhs.x;
    }
}A,B,C;

int main()
{
    while(cin>>A.x>>A.y>>B.x>>B.y>>C.x>>C.y)
    {
        double t=(B-A)*(C-A);
        ) break;
        )
            puts(");
        else
            puts(");
    }
}