Hi, I wrote this script by myself, copy and paste it in a script.

x -> x coordinate of your point

y -> y coordinate of your point

dir -> direction on which you have to calculate the direction

xc -> x coordinate of the center of your circle

yc -> x coordinate of the center of your circle

radius -> radius of your circle

returns the distance from the point and the collision point on the circumference or -1 if the point is outside the circle

//distance_to_circumference(x,y,dir,xc,yc,radius)
if point_distance(argument0,argument1,argument3,argument4) <= argument2 return sqrt(sqr(argument5)-sqr(cos(degtorad((90 - ((argument2 - point_direction(argument0,argument1,argument3,argument4) + 360) mod 360))))*point_distance(argument0,argument1,argument3,argument4)))+sin(degtorad((90 - ((argument2 - point_direction(argument0,argument1,argument3,argument4) + 360) mod 360))))*point_distance(argument0,argument1,argument3,argument4)
return -1
// (C) by Nicola Paro (ENP)
// This is a free code and you can use as you wish
// If you use this on a commerciail game, please give credit :) THX

A simple code you can put on a draw event to test the code

if not variable_local_exists('dir') dir = 0
Px = mouse_x
Py = mouse_y
Pangle = dir
if mouse_wheel_up() dir+= 3
if mouse_wheel_down() dir-= 3
Cx = room_width/2
Cy = room_height/2
Cr = 64
distance = distance_to_circumference(Px,Py,Pangle,Cx,Cy,Cr)
Collisionx = Px+lengthdir_x(distance,Pangle)
Collisiony = Py+lengthdir_y(distance,Pangle)
draw_circle(Cx,Cy,Cr,true)
draw_line(Px,Py,Px+lengthdir_x(320,dir),Py+lengthdir_y(320,dir))
draw_circle(Collisionx,Collisiony,4,true)

I hope i helped you

EDIT: solved a little bug in the formula

**Edited by enp, 03 April 2013 - 06:18 PM.**