Linie begrenzen m

  • Hallo Autoitler,
    ich hab ihr mal ne fragen. Ich benutze das Forum nun schon lange um irgendwelche Probleme zu lösen die bei mir immer wieder auftauchen. :)
    Aber nun habe ich zum ersten mal keine Antwort für mein Problem gefunden. Und deshalb frag jetzt mal nach . ^^

    Ich hab vor, einen Drehbutton (Wie die Knöpfe von einem Mischpult) mit gdi zu schreiben. Nun mein Problem
    Wenn ich nun den Button drehen möchte, d.h die mittlere Linie neu zu zeichnen (Ich lassen einfach nur die mittlerer Linie sich drehen als alles zu drehen)
    geht diese immer über den den äußeren Rand meines Kreise, wie begrenze ich die Linie auf den Kreis. Ich hab schon alles ausprobiert. Sinus Cosinus,alles was so die schuhlmathematik taugt.
    Aber komm einfach net weiter.
    Hier mal mein Script
    Ich weiß net sonderlich gut oder schön is halt nur zu testzwecken

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.10.1
    Author: myName

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    If $a < $Ctrl[6]/2 Then ;Wenn links von der hälfte geklickt wurde
    If $a < $Ctrl[6]/3/2 Then ;wenn links über den Kreis geklickt wurde auf x ebene
    $a = $Ctrl[6]/3/2
    EndIf
    Else; wenn rechts der hälfte geklickt wurde
    If $a > $Ctrl[6] - ($Ctrl[6]/3)/2 Then ;wenn rechts über den kreis geklickt wurde
    $a = $Ctrl[6] - ($Ctrl[6]/3)/2
    EndIf
    Endif

    [/autoit] [autoit][/autoit] [autoit]

    If $b < $Ctrl[7]/2 Then ;Wenn über die hälfte geklickt wird auf y Ebene
    If $b < $Ctrl[7]/3/2 Then ;wenn über den Kreis geklickt wird
    $b = $Ctrl[7]/3/2
    EndIf
    Else;wenn unterhalb der Hälfte der y Achse geklickt wurde
    If $b > $Ctrl[7] -($Ctrl[7]/3/2) then ;wenn unterhalb des Kreises geklickt wurde
    $b = ($Ctrl[7]/3/2) + ($Ctrl[7]/2)
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; Script Start - Add your code below here
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Include <Misc.au3>
    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $deg2rad = 180 / ACos(-1)
    Global Const $rad2deg = ACos(-1) / 180
    Global $DLL = DllOpen("user32.dll")
    AutoItSetOption("MouseCoordMode",0)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Dim $hWnd, $Label
    $hWnd = GUICreate("",500,500,-1,-1)

    [/autoit] [autoit][/autoit] [autoit]

    Guisetstate()

    [/autoit] [autoit][/autoit] [autoit]

    Dim $Button = _Create_DrehButton(100,100,100,100)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Endswitch
    _Run_DrehButton($Button)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Create_DrehButton($x,$y,$w,$h,$text = "",$min = -12, $max = 12)
    ;$Array[0] = Label
    ;$Array[1] = Graphic
    ;$Array[2] = Pen
    ;$Array[3] = Brush
    ;$Array[4] = $x
    ;$Array[5] = $y
    ;$Array[6] = $w
    ;$Array[7] = $h
    ;$Array[8] = $min
    ;$Array[9] = $max
    ;$Array[10] = $Wert
    Dim $Array[11]
    $Array[0] = GUICtrlCreateLabel("",$x,$y,$w,$h,$SS_GRAYRECT )

    [/autoit] [autoit][/autoit] [autoit]

    $Array[1] = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Array[0]))

    [/autoit] [autoit][/autoit] [autoit]

    ;$hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics(100, 20, $Array[1])
    ;$hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)

    [/autoit] [autoit][/autoit] [autoit]

    $Array[2] = _GDIPlus_PenCreate(0xFF333333,2)
    $Array[3] = _GDIPlus_BrushCreateSolid(0xFF999999)
    $Array[4] = $x
    $Array[5] = $y
    $Array[6] = $w
    $Array[7] = $h
    $Array[8] = $min
    $Array[9] = $max
    $Array[10] = 0
    _GDIPlus_GraphicsFillEllipse($Array[1],($w/3)/2,($h/3)/2,$w-($w/3),$h-($h/3),$Array[3]);innerer Kreis
    _GDIPlus_GraphicsDrawEllipse($Array[1],($w/3)/2,($h/3)/2,$w-($w/3)+1,$h-($h/3)+1,$Array[2])
    _GDIPlus_GraphicsDrawLine($Array[1],$w/2,$h/2,$w/2,($h/3)/2,$Array[2])
    If @error Then Return -1

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    For $z = 0 to 180 Step 180
    _GDIPlus_GraphicsDrawLine($Array[1],($w/3)/2 - 3,$h/2,($w/3)/2 -10,$h/2,$Array[2])
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $Array
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Run_DrehButton($Ctrl)
    Dim $aInfo = GUIGetCursorInfo($hWnd), $iOldHoverID = 0;MouseHover
    If @error Then MsgBox(0, "Error", "I´m sorry, the app has a problem with the calculation of the MousePos.")

    [/autoit] [autoit][/autoit] [autoit]

    If $aInfo[4] <> $iOldHoverID Then
    Switch $aInfo[4]
    Case $Ctrl[0] AND $aInfo[2] = 1
    _ReDraw_DrehButton($Ctrl,$aInfo[0] , $aInfo[1])
    EndSwitch
    $aInfo[4] = $iOldHoverID
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _ReDraw_DrehButton($Ctrl, $x , $y)
    Dim $c = 0, $d = 0, $angle, $wert = $Ctrl[10]
    _GDIPlus_GraphicsClear($Ctrl[1], 0xFF999999)

    _GDIPlus_GraphicsFillEllipse($Ctrl[1],($Ctrl[6]/3)/2,($Ctrl[7]/3)/2,$Ctrl[6]-($Ctrl[6]/3),$Ctrl[7]-($Ctrl[7]/3),$Ctrl[3]);innerer Kreis
    _GDIPlus_GraphicsDrawEllipse($Ctrl[1],($Ctrl[6]/3)/2,($Ctrl[7]/3)/2,$Ctrl[6]-($Ctrl[6]/3)+1,$Ctrl[7]-($Ctrl[7]/3)+1,$Ctrl[2])

    [/autoit] [autoit][/autoit] [autoit]

    ;$Ctrl[6]/3 Radius

    [/autoit] [autoit][/autoit] [autoit]

    Dim $radius = $Ctrl[6]/3
    $a = $x - $Ctrl[4];x
    $b = $y - $Ctrl[5];y

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $angle = ATan(($Ctrl[7] - $b) / $a) * $deg2rad

    [/autoit] [autoit][/autoit] [autoit]

    $len = Pixel_Distance($a, $b,$Ctrl[6]/2 , $Ctrl[7]/2)

    [/autoit] [autoit][/autoit] [autoit]

    If $len > $radius Then ; größer als Radius

    [/autoit] [autoit][/autoit] [autoit]

    $lx = Cos($angle * $rad2deg) * $radius
    $ly = Sin($angle * $rad2deg) * $radius

    _GDIPlus_GraphicsDrawLine($Ctrl[1], $Ctrl[6]/2, $Ctrl[7]/2, $lx, $Ctrl[7] - $ly, $Ctrl[3])

    ElseIf $len < $Ctrl[6]/3 Then
    EndIf

    [/autoit] [autoit][/autoit] [autoit]


    ConsoleWrite("$a: " & $a & " $b: " & $b & " $x: " & $x & " $y: " & $y & " $Ctrl[4]: " & $Ctrl[4] & " $Ctrl[5]: " & $Ctrl[5] & @lf)
    ;ConsoleWrite("Pixel_Distance: " & Pixel_Distance($a, $b ,$Ctrl[6]/2, $Ctrl[7] / 2 ) & @LF)
    ;ConsoleWrite("Radius: " & $Ctrl[6]/3 & @lf )

    [/autoit] [autoit][/autoit] [autoit]


    ;_GDIPlus_GraphicsDrawLine($Ctrl[1],$Ctrl[6]/2,$Ctrl[7]/2,$a,$b,$Ctrl[2])
    If @error Then Return -1

    [/autoit] [autoit][/autoit] [autoit]

    For $x = 0 to 180 Step 180
    _GDIPlus_GraphicsDrawLine($Ctrl[1],($Ctrl[6]/3)/2 - 3,$Ctrl[7]/2,($Ctrl[6]/3)/2 -10,$Ctrl[7]/2,$Ctrl[2])
    Next

    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func Pixel_Distance($x1, $y1, $x2, $y2) ;Pythagoras theorem
    Local $a, $b, $c
    If $x2 = $x1 And $y2 = $y1 Then
    Return 0
    Else
    $a = $y2 - $y1
    $b = $x2 - $x1
    $c = Sqrt($a * $a + $b * $b)
    Return $c
    EndIf
    EndFunc ;==>Pixel_Distance

    [/autoit]

    Also nur her mit allen Lösungen, Verbesserungen oder Kritiken

  • Hallo Omasgehstock,

    herzlich willkommen im Forum und viel Spass mit AutoIt.

    Hier kannst du dir die deutsche Hilfe herunterladen.
    Hier gibt es ein AutoIt-Tutorial: http://wiki.autoit.de/wiki/index.php/TutorialSehr hilfreich ist auch das Buch von peethebee .
    Das Gdi+ Tutorial von @Ubuntu sollte wohl auch zu deinen Pflichtlektüren gehören.
    Das Board hat auch eine Suchfunktionm, die üblichen Verdächtigen für GDI+ sind UEZ, Eukalyptus, Ubuntu und Marsi. Schau dich einfach einmal in ihren Beiträgen um. Stellvertretend hier: GDI+: Fussball Chronograph v1.4 Build 2010-03-09 damit du siehst was alles mit GDI+ möglich ist,

    mfg autoBert

  • Der Abstand zwischen zwei Punkten lässt sich über den Satz des Pythagoras (schreibt man den so?) berechnen:

    Spoiler anzeigen
    [autoit]


    #include <Math.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Func _Abstand($X1, $Y1, $X2, $Y2)
    Return Sqrt(((_Max($X1, $X2) - _Min($X1, $X2)) ^ 2) + (((_Max($Y1, $Y2) - _Min($Y1, $Y2)) ^ 2)))
    EndFunc

    [/autoit]

    Das funktioniert so:
    Stell dir eine Linie zwischen den beiden Punkten vor. Über diese beiden Punkte zeichnest du das Steigungsdreieck der Linie. Die Werte der Linienlängen des Steigungsdreiecks hast du ja, indem du den größeren X bzw. Y Wert mit kleineren X bzw. Y Wert subtrahierst. Diese Längen nun zum Quadrat nehmen (es gilt ja a² + b² = c²), addieren und das Ergebnis wurzeln (gibt es dieses Verb? Mal im Duden nachschlagen).

    Ich denke jetzt dürfte das kein Problem mehr sein, du solltest einfach immer abfragen, wie lang die Linie ist und ob sie den Radius des Kreises überschreitet.

    Einmal editiert, zuletzt von stayawayknight (3. Februar 2011 um 21:05)

  • Ich habe mal ein Beispiel gemacht....

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstants.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $Pi_Div_180 = ACos(-1) / 180
    $vU32Dll = DllOpen("User32.dll")

    [/autoit] [autoit][/autoit] [autoit]

    $iGUIColorBG = 0xFFFFFFFF
    $iGUIWidth = 400
    $iGUIHeight = 400
    $FPS = 40

    [/autoit] [autoit][/autoit] [autoit]

    $iRadiusButton = 60
    $iRadiusPoint = 40

    [/autoit] [autoit][/autoit] [autoit]

    $vButton_Middle = _Vector_Create(200, 200)
    $vButton_Point = _Vector_Create(200, 160)

    [/autoit] [autoit][/autoit] [autoit]

    $vNegativeYAxis = _Vector_Create(0, -1)
    $iAngle = 0

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("Test", $iGUIWidth, $iGUIHeight)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)

    [/autoit] [autoit][/autoit] [autoit]

    $hFormat_Text = _GDIPlus_StringFormatCreate()
    $hFamily_Text = _GDIPlus_FontFamilyCreate("Arial")
    $hFont_Text = _GDIPlus_FontCreate($hFamily_Text, 15)

    [/autoit] [autoit][/autoit] [autoit]

    $hPen_Button = _GDIPlus_PenCreate(0xFF000000, 2)
    $hBrush_Point = _GDIPlus_BrushCreateSolid(0xFF000000)
    $hBrush_Text = _GDIPlus_BrushCreateSolid(0xFF0000FF)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    AdlibRegister("_DrawFrame", Round(1000 / $FPS))

    [/autoit] [autoit][/autoit] [autoit]

    $bMouseClick = False

    [/autoit] [autoit][/autoit] [autoit]

    While Sleep(1000)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _DrawFrame()
    If _IsPressed("01", $vU32Dll) Then
    $aCursorInfo = GUIGetCursorInfo($hWnd)
    If $bMouseClick Or _PointIsInCircle($aCursorInfo[0], $aCursorInfo[1], DllStructGetData($vButton_Middle, "X"), DllStructGetData($vButton_Middle, "Y"), $iRadiusButton) Then
    $vDirection = _Vector_Normalize(_Vector_Create($aCursorInfo[0] - DllStructGetData($vButton_Middle, "X"), $aCursorInfo[1] - DllStructGetData($vButton_Middle, "Y")))

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($vButton_Point, "X", DllStructGetData($vButton_Middle, "X") + DllStructGetData($vDirection, "X") * $iRadiusPoint)
    DllStructSetData($vButton_Point, "Y", DllStructGetData($vButton_Middle, "Y") + DllStructGetData($vDirection, "Y") * $iRadiusPoint)

    [/autoit] [autoit][/autoit] [autoit]

    $iAngle = _Vector_GetAngle($vDirection, $vNegativeYAxis)
    If DllStructGetData($vDirection, "X") < 0 Then $iAngle = 360 - $iAngle

    [/autoit] [autoit][/autoit] [autoit]

    $bMouseClick = True
    EndIf
    Else
    If $bMouseClick Then $bMouseClick = False
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $aLayout_Text = _GDIPlus_GraphicsMeasureString($hBuffer, Round($iAngle, 2), $hFont_Text, _GDIPlus_RectFCreate(0, 270), $hFormat_Text)
    DllStructSetData($aLayout_Text[0], "X", 200 - DllStructGetData($aLayout_Text[0], "Width") / 2)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsClear($hBuffer, $iGUIColorBG)
    _GDIPlus_GraphicsDrawStringEx($hBuffer, Round($iAngle, 2), $hFont_Text, $aLayout_Text[0], $hFormat_Text, $hBrush_Text)
    _GDIPlus_GraphicsDrawEllipse($hBuffer, DllStructGetData($vButton_Middle, "X") - $iRadiusButton, DllStructGetData($vButton_Middle, "Y") - $iRadiusButton, $iRadiusButton * 2, $iRadiusButton * 2, $hPen_Button)
    _GDIPlus_GraphicsFillEllipse($hBuffer, DllStructGetData($vButton_Point, "X") - 3, DllStructGetData($vButton_Point, "Y") - 3, 6, 6, $hBrush_Point)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
    EndFunc ;==>_DrawFrame

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_PenDispose($hPen_Button)
    _GDIPlus_BrushDispose($hBrush_Point)
    _GDIPlus_BrushDispose($hBrush_Text)
    _GDIPlus_StringFormatDispose($hFormat_Text)
    _GDIPlus_FontFamilyDispose($hFamily_Text)
    _GDIPlus_FontDispose($hFont_Text)
    _GDIPlus_Shutdown()
    DllClose($vU32Dll)
    Exit
    EndFunc ;==>_Exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Vector_GetAngle($vVector1, $vVector2)
    $nScalarProduct = DllStructGetData($vVector1, "X") * DllStructGetData($vVector2, "X") + DllStructGetData($vVector1, "Y") * DllStructGetData($vVector2, "Y")
    $nVector1_Length = Sqrt(DllStructGetData($vVector1, "X") ^ 2 + DllStructGetData($vVector1, "Y") ^ 2)
    $nVector2_Length = Sqrt(DllStructGetData($vVector2, "X") ^ 2 + DllStructGetData($vVector2, "Y") ^ 2)

    [/autoit] [autoit][/autoit] [autoit]

    Return ACos($nScalarProduct / ($nVector1_Length * $nVector2_Length)) / $Pi_Div_180
    EndFunc ;==>_Vector_GetAngle

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_Normalize($vNorm)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    $nVectorLength = Sqrt(DllStructGetData($vNorm, "X") ^ 2 + DllStructGetData($vNorm, "Y") ^ 2)
    If $nVectorLength Then
    DllStructSetData($vReturn, "X", DllStructGetData($vNorm, "X") / $nVectorLength)
    DllStructSetData($vReturn, "Y", DllStructGetData($vNorm, "Y") / $nVectorLength)
    Else
    DllStructSetData($vReturn, "X", 0)
    DllStructSetData($vReturn, "Y", 0)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_Normalize

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_RotateOnZAxis($vRotate, $iDegree)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($vReturn, "X", DllStructGetData($vRotate, "X") * _Cos($iDegree) - DllStructGetData($vRotate, "Y") * _Sin($iDegree))
    DllStructSetData($vReturn, "Y", DllStructGetData($vRotate, "Y") * _Cos($iDegree) + DllStructGetData($vRotate, "X") * _Sin($iDegree))

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_RotateOnZAxis

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_ProjectVector($vProject1, $vProject2)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    $ScalarProduct = DllStructGetData($vProject1, "X") * DllStructGetData($vProject2, "X") + DllStructGetData($vProject1, "Y") * DllStructGetData($vProject2, "Y")
    DllStructSetData($vReturn, "X", ($ScalarProduct / (DllStructGetData($vProject1, "X") * DllStructGetData($vProject1, "Y") + DllStructGetData($vProject2, "X") * DllStructGetData($vProject1, "Y"))) * DllStructGetData($vProject2, "X"))
    DllStructSetData($vReturn, "Y", ($ScalarProduct / (DllStructGetData($vProject1, "X") * DllStructGetData($vProject1, "Y") + DllStructGetData($vProject2, "X") * DllStructGetData($vProject1, "Y"))) * DllStructGetData($vProject2, "Y"))

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_ProjectVector

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_GetLength($vLength)
    Return Sqrt(DllStructGetData($vLength, "X") ^ 2 + DllStructGetData($vLength, "Y") ^ 2)
    EndFunc ;==>_Vector_GetLength

    [/autoit] [autoit][/autoit] [autoit]

    Func _Vector_Create($nXValue, $nYValue)
    Local $vReturn = DllStructCreate("float X;float Y")

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($vReturn, "X", $nXValue)
    DllStructSetData($vReturn, "Y", $nYValue)

    [/autoit] [autoit][/autoit] [autoit]

    Return $vReturn
    EndFunc ;==>_Vector_Create

    [/autoit] [autoit][/autoit] [autoit]

    Func _Cos($nValue)
    Return Cos($nValue * $Pi_Div_180)
    EndFunc ;==>_Cos

    [/autoit] [autoit][/autoit] [autoit]

    Func _Sin($nValue)
    Return Sin($nValue * $Pi_Div_180)
    EndFunc ;==>_Sin

    [/autoit] [autoit][/autoit] [autoit]

    Func _Tan($nValue)
    Return Tan($nValue * $Pi_Div_180)
    EndFunc ;==>_Tan

    [/autoit] [autoit][/autoit] [autoit]

    Func _PointIsInCircle($iX_Point, $iY_Point, $iX_Circle, $iY_Circle, $iRadius_Circle)
    $iDistPoints = _GetPointsDistance($iX_Point, $iY_Point, $iX_Circle, $iY_Circle)
    If ($iRadius_Circle > 0 And $iDistPoints < $iRadius_Circle) Or ($iRadius_Circle < 0 And $iDistPoints > $iRadius_Circle) Or $iDistPoints = 0 Then Return 1
    Return 0
    EndFunc ;==>_PointIsInCircle

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetPointsDistance($iPointX1, $iPointY1, $iPointX2, $iPointY2)
    Return Sqrt(($iPointX1 - $iPointX2) ^ 2 + ($iPointY1 - $iPointY2) ^ 2)
    EndFunc ;==>_GetPointsDistance

    [/autoit]