Recommended Posts

This is my first edition of the function. Lots can be don from just this.

What it does it scans in a Circumference. Aka a circle around as designated.
I wanted a optimized way of pixel searching and came up with this to be the best preforming.

```Local Const \$180_div_pi = 180 / ACos(-1)

\$it = _PixelSearchCircumference(194, 762, 160, 0xFA3C32)
MouseMove(\$it[1],\$it[2],0)
Sleep(5000)

Func _Angle(\$tX, \$tY, \$cX, \$cY)
\$mx = \$tX - \$cX
\$my = \$cY - \$tY
\$angle = ATan(\$my / \$mx) * \$180_div_pi
If \$mx < 0 Then
\$angle = 180 + \$angle
ElseIf \$mx >= 0 And \$my < 0 Then
\$angle = 360 + \$angle
EndIf
Return Int(\$angle)
EndFunc   ;==>_Angle

Func Angle(\$X1, \$Y1, \$Ang, \$Length)
Local \$Return[3]
\$Return[1] = \$X1 + (\$Length * Cos(\$Ang / 180 * 3.14159265358979))
\$Return[2] = \$Y1 - (\$Length * Sin(\$Ang / 180 * 3.14159265358979))
Return \$Return
EndFunc   ;==>Angle

For \$i = 0 To 360 Step +1
\$iColor = PixelGetColor(\$rod[1] , \$rod[2])
If \$iColor == \$color Then
Return \$rod
ExitLoop
EndIf
Next
EndFunc```

Share on other sites

A full radar system can be designed.
Scan center out at degrees then +1 degree scan out loop

Optimal designs would be scan _PixelSearchCircumference()
Followed up with scan from center out at 0, 90 , 180 ,270 degree

This would be the best preforming for a movement to keep tabs on radar.
Full pixel region scans will bog system calculations down, esp while rendering video.

Edited by sphexion

Share on other sites

Somehow the function _Angle rings a bell for me...

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ