开发笔记

  • 首页
  • 工具箱
三味线的博客
  1. 首页
  2. Qt
  3. 正文

Qt中求两线段交点

2018-04-18 2160点热度 4人点赞 0条评论
QPointF MapEditor::getIntersectPos(QPointF posA, QPointF posB, QPointF posC, QPointF posD)//返回AB与CD交点,无交点返回(0,0)
{
    QLineF line1(posA, posB);
    QLineF line2(posC, posD);
    QPointF interPos(0,0);
    QLineF::IntersectType type = line1.intersect(line2, &interPos);
    if (type != QLineF::BoundedIntersection)
        interPos = QPointF(0, 0);
    return interPos;
}
标签: Qt 算法
最后更新:2020-06-06

三味线

不吃咸鱼的喵

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

Captcha Code

COPYRIGHT © 2022 voidcat.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蜀ICP备18010095号-1