首页 > 其他 > 详细

objectarx之判断三点是否在一条直线上

时间:2019-11-07 17:41:27      阅读:136      评论:0      收藏:0      [点我收藏+]

bool CCommonFuntion::IsOnLine(AcGePoint2d& pt1, AcGePoint2d& pt2, AcGePoint2d& pt3)
{
AcGeVector3d vec1 = AcGeVector3d(pt2.x - pt1.x, pt2.y - pt1.y, 0);
AcGeVector3d vec2 = AcGeVector3d(pt3.x - pt1.x, pt3.y - pt1.y, 0);
double pi = 3.14159265;// 35897931;
//double angle = vec1.angleTo(vec2);
double angle = ((int)((vec1.angleTo(vec2)) * 100000000 + 0.5)) / 100000000.0;
if (angle == pi || angle == 0)
return true;
else
return false;
}

objectarx之判断三点是否在一条直线上

原文:https://www.cnblogs.com/Pond-ZZC/p/11813607.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!