I'm not sure what the command is called in DarkGDK but if you use ATANFULL (probably DBATANFULL) you can get the angle between two points. I generally use WRAPVALUE also to add another "just in case something horrible happens" and ATANFULL throws out a number that isn't between 0 and 360.
Here it is in Darkbasic Pro:
` Create an image
ink rgb(255,0,0),0
box 0,0,50,50
ink rgb(0,255,0),0
box 0,0,25,50
get image 1,0,0,50,50,1
` Make the image a sprite
sprite 1,0,0,1
` Offset sprite (so it's at it's center)
offset sprite 1,25,25
` Reset color
ink rgb(255,255,255),0
do
` Show the sprite at the center of the screen
sprite 1,screen width()/2,screen height()/2,1
` Show the angle with a line
line sprite x(1),sprite y(1),mousex(),mousey()
` Get the angle from sprite to the mouse coordinates
Angle=wrapvalue(atanfull(mousey()-sprite y(1),mousex()-sprite x(1)))
` Rotate the sprite to the new angle
rotate sprite 1,Angle
loop