Code: Select all
;http://pagesperso-orange.fr/math.15873/index.htm
;http://pagesperso-orange.fr/math.15873/IntCercl.html
;http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands
;http://www.w3.org/TR/SVG/images/paths/arcs02.png
;http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
Procedure.F GetOrientation(xCenter.F, yCenter.F, xSource.F, ySource.F)
Protected.F xDelta, yDelta
Protected.F Rho, Alpha
xDelta = xSource - xCenter
yDelta = ySource - yCenter
Rho = Sqr((xDelta * xDelta) + (yDelta * yDelta) )
Alpha = ACos(xDelta / Rho)
If yDelta > 0.
Alpha = - Alpha
EndIf
ProcedureReturn Alpha
EndProcedure
Procedure RotatePoint(xCenter.F, yCenter.F, xSource.F, ySource.F, Beta.F, *xResult.FLOAT, *yResult.FLOAT)
Protected.F xDelta1, yDelta1
Protected.F xRef, yRef
xDelta1 = xSource - xCenter
yDelta1 = ySource - yCenter
xRef = Cos(Beta)
yRef = Sin(Beta)
*xResult\F = xCenter + xRef * xDelta1 + yRef * yDelta1
*yResult\F = yCenter - yRef * xDelta1 + xRef * yDelta1
EndProcedure
Procedure ScalePoint(xCenter.F, yCenter.F, xScale.F, yScale.F, xSource.F, ySource.F, *xResult.FLOAT, *yResult.FLOAT)
*xResult\F = (xSource - xCenter) * xScale + xCenter
*yResult\F = (ySource - yCenter) * yScale + yCenter
EndProcedure
Procedure.I _CircleEquation(x1.F, y1.F, x2.F, y2.F, R0.F, *px0.FLOAT, *py0.FLOAT, *pxE.FLOAT, *pyE.FLOAT)
Protected.I Result
Protected.F x1P2, y1P2, x2P2, y2P2, xDelta, yDelta, Dir
Protected.F N, A, B, C, Base, Root, x0, y0, xE, yE
Protected.I FlipFlag
If y1 = y2
Swap x1, y1
Swap x2, y2
FlipFlag = 1
EndIf
xDelta = x1 - x2
yDelta = y1 - y2
Dir = xDelta / yDelta
x1P2 = x1 * x1
y1P2 = y1 * y1
x2P2 = x2 * x2
y2P2 = y2 * y2
N = (x1P2 - x2P2 + y1P2 - y2P2) / (2. * yDelta)
A = (Dir * Dir) + 1.
B = 2. * ((y1 * Dir) - (N * Dir) - x1)
C = x1P2 + y1P2 + (N + R0) * (N - R0) - (2. * Y1 * N)
Delta = (B * B) - (4. * A * C)
If Delta => 0.
Base = - B / (2. * A)
Root = Sqr(Delta) / (2. * A)
x0 = Base - Root
y0 = N - (x0 * Dir)
xE = Base + Root
yE = N - (xE * Dir)
If FlipFlag
Swap x0, y0
Swap xE, yE
EndIf
*px0\F = x0
*py0\F = y0
*pxE\F = xE
*pyE\F = yE
Result = #True
Else
Result = #False
EndIf
ProcedureReturn Result
EndProcedure
Procedure.I CircleEquation(x1.F, y1.F, x2.F, y2.F, R0.F, *px0.FLOAT, *py0.FLOAT, *pxE.FLOAT, *pyE.FLOAT)
Protected.F x1P2, y1P2, x2P2, y2P2, yDelta, Dir, N, B, C, Base, Root, DoubleA
If y1 = y2
Swap x1, y1
Swap x2, y2
FlipFlag = 1
EndIf
yDelta = y1 - y2
If yDelta <> 0.
Dir = (x1 - x2) / yDelta
x1P2 = x1 * x1
y1P2 = y1 * y1
N = (x1P2 - (x2 * x2) + y1P2 - (y2 * y2) ) / (2. * yDelta)
DoubleA = 2. * ((Dir * Dir) + 1.)
B = 2. * ((y1 * Dir) - (N * Dir) - x1)
C = x1P2 + y1P2 + (N + R0) * (N - R0) - (2. * Y1 * N)
Delta = (B * B) - (2. * DoubleA * C)
If Delta => 0.
Base = - B / DoubleA
Root = Sqr(Delta) / DoubleA
*px0\F = Base - Root
*py0\F = N - (*px0\F * Dir)
*pxE\F = Base + Root
*pyE\F = N - (*pxE\F * Dir)
If FlipFlag
Swap *px0\F, *py0\F
Swap *pxE\F, *pyE\F
EndIf
ProcedureReturn #True
EndIf
EndIf
EndProcedure
Procedure.I GetArcChars(xStart.F, yStart.F, xEnd.F, yEnd.F, yRadius.F, xRadius.F, xRotation.F, LargeArcFlag.I, SweepFlag.I, *xResult1, *yResult1, *xResult2, *yResult2, *StartAngle, *EndAngle)
Protected.I Result
Protected.F xTemp, yTemp, xTmp, yTmp, xTmp0, yTmp0
Protected.F StartArc, EndArc, xA, yA, xB, yB, A1, A2, A3
RotatePoint(xStart, yStart, xEnd, yEnd, - xRotation, @xTemp, @yTemp)
ScalePoint(xStart, yStart, 1.0, yRadius / xRadius, xTemp, yTemp, @xTemp, @yTemp)
If CircleEquation(xStart, yStart, xTemp, yTemp, yRadius, @xTmp, @yTmp, @xTmp0, @yTmp0)
StartArc = GetOrientation(xTmp, yTmp, xStart, yStart)
EndArc = GetOrientation(xTmp, yTmp, xTemp, yTemp)
ScalePoint(xStart, yStart, 1.0, xRadius / yRadius, xTmp, yTmp, @xTmp, @yTmp)
ScalePoint(xStart, yStart, 1.0, xRadius / yRadius, xTmp0, yTmp0, @xTmp0, @yTmp0)
RotatePoint(xStart, yStart, xTmp, yTmp, xRotation, @xA, @yA)
RotatePoint(xStart, yStart, xTmp0, yTmp0, xRotation, @xB, @yB)
A1.F = GetOrientation(xStart, yStart, xA, yA) + #PI
A2.F = GetOrientation(xStart, yStart, xEnd, yEnd) + #PI
A3.F = GetOrientation(xStart, yStart, xB, yB) + #PI
If ((A1 > A2) And (A2 > A3) ) Or ((A1 < A2) And (A2 > A3) And (A1 < A3) ) Or ((A1 > A2) And (A2 < A3) And (A1 < A3) )
Swap xA, xB
Swap yA, yB
Swap StartArc, EndArc
StartArc + #PI
EndArc + #PI
EndIf
If LargeArcFlag = #False
Swap xA, xB
Swap yA, yB
Swap StartArc, EndArc
StartArc + #PI
EndArc + #PI
EndIf
If SweepFlag
Swap xA, xB
Swap yA, yB
StartArc + #PI
EndArc + #PI
EndIf
PokeF(*StartAngle, StartArc)
PokeF(*EndAngle, EndArc)
PokeF(*xResult1, xA)
PokeF(*yResult1, yA)
PokeF(*xResult2, xB)
PokeF(*yResult2, yB)
Result = #True
Else
Result = #False
EndIf
ProcedureReturn Result
EndProcedure
Procedure DrawArc(xCenter.F, yCenter.F, RadiusX.F, RadiusY.F, xRotation.F, Color.I, StartArc.F = 0., EndArc.F = 2. * #PI)
Protected.F AngleStep, Angle, xEllipse, yEllipse, xDraw, yDraw, xPlot, yPlot
AngleStep = #PI / (2. * (RadiusX + RadiusY) )
If EndArc < StartArc
EndArc + (2. * #PI)
EndIf
Angle = StartArc
Repeat
xEllipse.F = Cos(Angle) * RadiusX ;;
yEllipse.F = Sin(Angle) * RadiusY ;;
xDraw.F = Cos(xRotation) * xEllipse - Sin(xRotation) * yEllipse ;;
yDraw.F = - Sin(xRotation) * xEllipse - Cos(xRotation) * yEllipse ;;
xPlot.F = xCenter + xDraw
yPlot.F = yCenter + yDraw
Box(xPlot, yPlot, 1, 1, Color)
Angle + AngleStep
Until Angle > EndArc
EndProcedure
Procedure GimbalDot(xCenter.F, yCenter.F, RadiusX.F, RadiusY.F, xRotation.F, Angle.F, *xPlot.FLOAT, *yPlot.FLOAT)
Protected.F xEllipse, yEllipse, xDraw, yDraw
xEllipse = Cos(Angle) * RadiusX ;;
yEllipse = Sin(Angle) * RadiusY ;;
xDraw = Cos(xRotation) * xEllipse - Sin(xRotation) * yEllipse ;;
yDraw = - Sin(xRotation) * xEllipse - Cos(xRotation) * yEllipse ;;
*xPlot\F = xCenter + xDraw
*yPlot\F = yCenter + yDraw
EndProcedure
Procedure GetBoundArc(*Left.Float, *Top.Float, *Right.Float, *Bottom.Float, xCenter.F, yCenter.F, RadiusX.F, RadiusY.F, xRotation.F, StartArc.F = 0., EndArc.F = 2. * #PI)
Protected.F AngleStep, Angle, xEllipse, yEllipse, xDraw, yDraw, xPlot, yPlot
AngleStep = #PI / (2. * (RadiusX + RadiusY) )
If EndArc < StartArc
EndArc + (2. * #PI)
EndIf
Angle = StartArc
*Left\F = 9999999.
*Top\F = 9999999.
*Right\F = -9999999.
*Bottom\F = -9999999.
Repeat
xEllipse.F = Cos(Angle) * RadiusX ;;
yEllipse.F = Sin(Angle) * RadiusY ;;
xDraw.F = Cos(xRotation) * xEllipse - Sin(xRotation) * yEllipse ;;
yDraw.F = - Sin(xRotation) * xEllipse - Cos(xRotation) * yEllipse ;;
xPlot.F = xCenter + xDraw
yPlot.F = yCenter + yDraw
If xPlot < *Left\F
*Left\F = xPlot
EndIf
If xPlot > *Right\F
*Right\F = xPlot
EndIf
If yPlot < *Top\F
*Top\F = yPlot
EndIf
If yPLot > *Bottom\F
*Bottom\F = yPlot
EndIf
Angle + AngleStep
Until Angle > EndArc
EndProcedure
Define.F xA, yA, xB, yB, StartArc, EndArc
Define.I LargeArcFlag, SweepFlag
Define.F Left, Top, Right, Bottom
Define.F ArcAngleEnd, ArcAngleStart
ArcAngleStart = #PI / 2.
ArcAngleEnd = 7. * #PI / 8.
InitSprite()
InitKeyboard()
InitMouse()
ExamineDesktops()
dw = DesktopWidth(0)
dh = DesktopHeight(0)
dd = DesktopDepth(0)
OpenScreen(dw, dh, dd, "")
LoadFont(0, "VERDANA", 16)
ArcX = dw / 2.
ArcY = dh / 2.
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "0) Press the [Space] key when you read such a sentence...", #White)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
; Delayed = Elapsed + 16
; Repeat
; Delay(1)
; Elapsed = ElapsedMilliseconds()
; Until Elapsed > Delayed
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "1) Let's imagine an arc...", #White)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "2) We know it's an ELLIPTIC arc...", #White)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "3) We know its ANGLE OF ROTATION", #White)
For I = 0 To 63 Step 4
Angle.F = (#PI / 4.) - ((#PI / 256.) * I)
DrawArc(ArcX, ArcY, 50., 150., Angle, RGB(64, 0, I), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., Angle, RGB(255, 0, I * 4), ArcAngleStart, ArcAngleEnd)
Next
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "4) We know its RADII, (major and minor)", #White)
For I = 0 To 63 Step 4
Angle.F = I * 100. / 64.
DrawArc(ArcX, ArcY, 50. + Angle, 150., 0., RGB(64 - I, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50. + Angle, 150., 0., RGB(255 - I * 4, 0, 255), ArcAngleStart, ArcAngleEnd)
Next
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(64, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(255, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Define.F Ax, Ay, Bx, By, ArcX1, ArcY1, ArcX2, ArcY2
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "5) We know there is TWO WAYS to draw it and a flag controls this...", #White)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleStart, @Ax, @Ay)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleEnd, @Bx, @By)
CircleEquation(Ax, Ay, Bx, By, 150., @ArcX1, @ArcY1, @ArcX2, @ArcY2)
DrawArc(ArcX1, ArcY1, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX2, ArcY2, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
;DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(64, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(255, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "6)From 2 blue points,we search the centers of the 2 blue circles...", #White)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleStart, @Ax, @Ay)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleEnd, @Bx, @By)
CircleEquation(Ax, Ay, Bx, By, 150., @ArcX1, @ArcY1, @ArcX2, @ArcY2)
DrawArc(ArcX1, ArcY1, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX2, ArcY2, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
Box(Ax - 4, Ay - 4, 9, 9, RGB(0, 0, 255) )
Box(Bx - 4, By - 4, 9, 9, RGB(0, 0, 255) )
;DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(64, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(255, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "7)If equal distances, so equal circles...", #White)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleStart, @Ax, @Ay)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleEnd, @Bx, @By)
CircleEquation(Ax, Ay, Bx, By, 150., @ArcX1, @ArcY1, @ArcX2, @ArcY2)
DrawArc(ArcX1, ArcY1, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX2, ArcY2, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
Box(Ax - 4, Ay - 4, 9, 9, RGB(0, 0, 255) )
DrawArc(Ax, Ay, 150., 150., 0., RGB(0, 128, 0) )
Box(Bx - 4, By - 4, 9, 9, RGB(0, 0, 255) )
DrawArc(Bx, By, 150., 150., 0., RGB(0, 128, 0) )
;DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(64, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(255, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "8)Finding the two green points is finding green circles intersection...", #White)
DrawText(0, 32, "(It's the reason there is a procedure named CircleEquation() )", #White)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleStart, @Ax, @Ay)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleEnd, @Bx, @By)
CircleEquation(Ax, Ay, Bx, By, 150., @ArcX1, @ArcY1, @ArcX2, @ArcY2)
DrawArc(ArcX1, ArcY1, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX2, ArcY2, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
Box(ArcX1 - 4, ArcY1 - 4, 9, 9, RGB(0, 128, 0) )
Box(ArcX2 - 4, ArcY2 - 4, 9, 9, RGB(0, 128, 0) )
Box(Ax - 4, Ay - 4, 9, 9, RGB(0, 0, 255) )
DrawArc(Ax, Ay, 150., 150., 0., RGB(0, 128, 0) )
Box(Bx - 4, By - 4, 9, 9, RGB(0, 0, 255) )
DrawArc(Bx, By, 150., 150., 0., RGB(0, 128, 0) )
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(64, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(255, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "9)If we have these green points we have", #White)
DrawText(0, 32, "all the necessary to redraw exactly the arc,", #White)
DrawText(0, 64, "and calculate bounds...", #White)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleStart, @Ax, @Ay)
GimbalDot(ArcX, ArcY, 150., 150., 0., ArcAngleEnd, @Bx, @By)
CircleEquation(Ax, Ay, Bx, By, 150., @ArcX1, @ArcY1, @ArcX2, @ArcY2)
DrawArc(ArcX1, ArcY1, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
DrawArc(ArcX2, ArcY2, 150., 150., 0., RGB(0, 0, 64), 0., #PI * 2.)
Box(ArcX1 - 4, ArcY1 - 4, 9, 9, RGB(0, 128, 0) )
Box(ArcX2 - 4, ArcY2 - 4, 9, 9, RGB(0, 128, 0) )
Box(Ax - 4, Ay - 4, 9, 9, RGB(0, 0, 255) )
DrawArc(Ax, Ay, 150., 150., 0., RGB(0, 128, 0) )
Box(Bx - 4, By - 4, 9, 9, RGB(0, 0, 255) )
DrawArc(Bx, By, 150., 150., 0., RGB(0, 128, 0) )
DrawArc(ArcX, ArcY, 150., 150., 0., RGB(0, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(64, 0, 64), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., 0., RGB(255, 0, 255), ArcAngleStart, ArcAngleEnd)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(64, 0, 0), 0., #PI * 2.)
DrawArc(ArcX, ArcY, 50., 150., #PI / 4., RGB(255, 0, 0), ArcAngleStart, ArcAngleEnd)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
Repeat
ClearScreen(RGB(0, 0, 0) )
StartDrawing(ScreenOutput() )
DrawingFont(FontID(0) )
DrawText(0, 0, "It is the internal fonctionizing of GetArcChars()", #White)
DrawText(0, 32, "Now I could explain you more easily the step #8", #White)
DrawText(0, 64, "It's the math algo of CircleEquation(). Could not I do?", #White)
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Space)
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All) = 0
CloseScreen()