btw, for speed up, you can overload function vec_dist() for 2d vectors, or create new
Code:
var dist2d(VECTOR* vector1, VECTOR* vector2)
{
	VECTOR* temp_v;
	var distance;
	temp_v.x = vector1.x - vector2.x;
	temp_v.y = vector1.y - vector2.y;
	return distance = sqrt(temp_v.x*temp_v.x + temp_v.y*temp_v.y); 
}



This one works fine for me.


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro