err... it dun look likes working...
i compare the value with the one i should get, it is different. anyway, I wroted a rather dinosour procedure for it, and it work.
Code:
Function ReturnARCMiddleXY(startX As Double, startY As Double, endX As Double, endY As Double, originX As Double, _
originY As Double, Radius As Double) As Double()
Dim distanceX As Double
Dim distanceY As Double
Dim distanceT As Double
Dim PointXY(1) As Double
Dim PointMidStartEnd(1) As Double
PointMidStartEnd(0) = (startX + endX) / 2
PointMidStartEnd(1) = (startY + endY) / 2
If startX = endX Then
PointXY(1) = PointMidStartEnd(1)
If startX > originX Then
PointXY(0) = originX + Radius
Else
PointXY(0) = originX - Radius
End If
ElseIf startY = endY Then
PointXY(0) = PointMidStartEnd(0)
If startY > originY Then
PointXY(1) = originY + Radius
Else
PointXY(1) = originY - Radius
End If
'right side of origin
ElseIf PointMidStartEnd(0) > originX Then
distanceT = Sqr((PointMidStartEnd(0) - originX) ^ 2 + (PointMidStartEnd(1) - originY) ^ 2)
distanceX = Radius * (PointMidStartEnd(0) - originX) / distanceT
distanceY = Sqr(Radius ^ 2 - distanceX ^ 2)
PointXY(0) = originX + distanceX
If PointMidStartEnd(1) > originY Then
PointXY(1) = originY + distanceY
Else
PointXY(1) = originY - distanceY
End If
'left side of origin
ElseIf PointMidStartEnd(0) < originX Then
distanceT = Sqr((originX - PointMidStartEnd(0)) ^ 2 + (PointMidStartEnd(1) - originY) ^ 2)
distanceX = Radius * (originX - PointMidStartEnd(0)) / distanceT
distanceY = Sqr(Radius ^ 2 - distanceX ^ 2)
PointXY(0) = originX - distanceX
If PointMidStartEnd(1) > originY Then
PointXY(1) = originY + distanceY
Else
PointXY(1) = originY - distanceY
End If
End If
ReturnARCMiddleXY = PointXY()
End Function
BTW, thanks for ur response, GUV!