typedef pair<double,double> CPoint;
typedef pair<CPoint,CPoint> CLine;
double angle(CLine l,CLine m)
{
return acos(fabs(project(l.second-l.first,m.second-m.first)/length(l.second-l.first)));
}
求线与线的夹角
最新推荐文章于 2022-11-24 11:10:09 发布
typedef pair<double,double> CPoint;
typedef pair<CPoint,CPoint> CLine;
double angle(CLine l,CLine m)
{
return acos(fabs(project(l.second-l.first,m.second-m.first)/length(l.second-l.first)));
}