def GetRadiusPointFromExt(self,x,y): """ get The intersecrion point from the line(x,y,cx,cy) and the circle """ _cx, _cy = self.center.getCoords() _r = self.radius centerPoint=Point(_cx,_cy) outPoint=Point(x,y) vector=Vector(outPoint,centerPoint) vNorm=vector.norm() newNorm=abs(vNorm-_r) magVector=vector.mag() magVector.mult(newNorm) newPoint=magVector.point() intPoint=Point(outPoint+newPoint) return intPoint.getCoords()
def GetRadiusPointFromExt(self, x, y): """ get The intersecrion point from the line(x,y,cx,cy) and the circle """ _cx, _cy = self.center.getCoords() _r = self.radius centerPoint = Point(_cx, _cy) outPoint = Point(x, y) vector = Vector(outPoint, centerPoint) vNorm = vector.norm() newNorm = abs(vNorm - _r) magVector = vector.mag() magVector.mult(newNorm) newPoint = magVector.point() intPoint = Point(outPoint + newPoint) return intPoint.getCoords()