UIBezierPath 上的点或位置

Point or Location on UIBezierPath

我的游戏中有两个圆圈。圆圈有不同的大小。每个 Circle 都有一个 UIBezierPath。现在我想要我的对象,它在一个圆上移动,移动到另一个圆上完全相同的位置。

如何确定我的对象在圆或 UIBezierPath 上的位置并将对象放置到另一个路径上的新点?

路径:

let Path0 = UIBezierPath(arcCenter: CGPoint(x: self.frame.width / 2, y: self.frame.height / 2 + yCircleOffset), radius: actualCircle.size.height / 2, startAngle: radian, endAngle: radian + CGFloat(M_PI * 4), clockwise: true)

操作:

Object1.runAction(SKAction.repeatActionForever(SKAction.followPath(Path0.CGPath, asOffset: false, orientToPath: true, speed: 100)))

你不能这样说吗:

func outerX(innerPoint:CGPoint)->CGFloat
{
    return (innerPoint.x-self.frame.size.width*0.5)*radius2/radius1 +self.frame.size.width*0.5
}

func outerY(innerPoint:CGPoint)->CGFloat
{
    return (innerPoint.y-self.frame.size.height*0.5)*radius2/radius1+self.frame.size.height*0.5
}

func moveObjectToOuterCircle()
{
    let innerPoint = object1.position
    let outerPoint = CGPointMake(outerX(innerPoint), outerY(innerPoint))

    object1.removeAllActions()

    object1.runAction(SKAction.moveTo(outerPoint,duration:0.25))
}

?