Hi guys, i've a problem:
i want to find a specific point on a circumference (that there is not on the screen but i can only calculate every point).
My script need to find a picture on the screen, so it get direction line that pass by the center of my circumference and by the center of the picture, so now I have to find the intersection point originated from the line and the circle.
This image will help you:
Until now i made this, but it not find the point well
PHP Code:
$Midx=@DesktopWidth/2 $Midy=@DesktopHeight/2 $x=0 $y=0 $tag =_IMAGESEARCH(@ScriptDir & "\Images\pt.bmp", 1,$x,$y, 18) If $tag=1 Then $dir=point_direction($Midx,$Midy,$x,$y) ClickCircleFromDir($dir,200) EndIf
seems like a basic math problem. though i dont really understand wich information are given. you want to get the x,y of the blue point?
and you have the x,y of the center, the radius and...?
math is correct, if angle is 0 at at x axis and is 90° if at top. chek this in ur point_direction func (i didnt check the math here). also check if it has to be ° or radian.
alternative way: create a function f=a+b*x from pic and center position and use the function value with binary search untill you have the point with needed radius.
thats how i would have made the angle calculation:
angle =atan(y/x) ;y = ydistance between center and pic...
if x<0 and y >0 then angle = Pi - angle
if x<0 and y< 0 then angle = Pi + angle
if x>0 and y< 0 then angle = 2*Pi - angle
(didnt test it, jsut from mind. if... could be mixed) (result in radian)
Func CalcAngle($x1,$y1,$x2,$y2)
Local $radAdd=0
Local $X=($x2-$x1)
Local $Y=($y2-$y1)
Select
Case $Y<0 and $X<0
$radAdd=$pi
Return ATan((-$Y)/(-$X)) + $radAdd
Case $Y<0
$radAdd=2*$pi
Return $radAdd - ATan((-$Y)/$X)
Case $X<0
$radAdd=$pi
Return $radAdd - ATan($Y/(-$X))
Case Else
Return ATan($Y/$X)
EndSelect
EndFunc
Func MovXYbyAngle($x,$y,$angle,$Distance,$IsDeg=1)
If $IsDeg=1 then $Angle/=180/3.14159
Local $aReturn[2]=[$x+(Sin($Angle)),$y+(Cos($Angle))]
Return $aReturn
Endfunc
and with the second function you can even make games.
Poker Tables Cordinates 03/08/2013 - CO2 Private Server - 4 Replies i would like to add the Poker tables once the player get in its map .. but the problem is i dont know the Poker Cords .. and i searched in INI folder but didnt find any thing useful about it .. so if any1 got all the tables cords and information and willing to share i would be Gratful
Regards
shadowman123
cordinates ? 08/25/2011 - Metin2 - 1 Replies I was asking what are the cordinates for the smiths on 5th floor ( where to kill the demon king at what cordinates for a wep smith , armour ,jewel ... ) Thank you
[Help] Random Cordinates 08/06/2010 - EO PServer Hosting - 3 Replies Hello, I am Nurreo33, a version of Necron33.
I have been lately working in the hush trying to experiment a way of changing the cordinates of an NPC using cq_action code, I am working on a quest in which the player tries to follow an NPC to an end, It's like a Maze in which one fights to reach a last place and gain a reward,I do think It would be fun.
My aim is, when the player talks to the NPC "In charge." and she tells him where to go She would change her cordinates.
My first reference was...
the xx and yy cordinates? 12/07/2009 - Shaiya - 1 Replies does any1 where i can find coordintes like xx and yy for the shaiya map of erina.. coordinates for mostly the main towns.. iam using the 10/22/09 trainer and there is teleport so i was wondering where the coordinates for the main towns in erina map are..