计算点和圆线段的碰撞

计算点和圆线段的碰撞

本文介绍了计算点和圆线段的碰撞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经计算了线段和圆之间的交点,如何判断该交点是否位于圆的一段上?

If I have calculated an intersection point between a line segment and a circle, how can I tell whether or not this intersection point lies on a segment of the circle?

我有方程式来说明线段是否与圆相交,并且在圆上也有交点,但是我需要知道的是圆上的碰撞点是否位于圆内.该圆的特定arg段的范围.我有圆弧段的终点,即圆心&半径和碰撞点.

I have the equations to tell whether or not a line segment intersects with the circle, and I also have the intersection point on that circle, but what I need to know is whether or not this collision point on the circle lies within the bounds of a specific arg segment of that circle. I have the end points of the arc segment, the circle's center & radius, and the point of collision.

推荐答案

将交点转换为极坐标围绕中心并比较角度.

Transform the intersection point into polar coordinates around the center and compare the angles.

这篇关于计算点和圆线段的碰撞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 02:49