jingman
May 19th, 2003, 07:27 PM
So, right now when I want to find the distance between two points, I go:
dist = Math.sqrt((this_x-that_x)*(this_x-that_x)+(this_y-that_y)*(this_y-that_y))
BLECH! I don't want to do that every time. So I want to make a nice little function that I can apply to an object. Problem is, I don't know how to do this. Is it possible to end up with something as easy as:
Math.dist(thisclipname, thatclipname) ?
How do you guys set up functions that do bulky math and return nice clean numbers?
dist = Math.sqrt((this_x-that_x)*(this_x-that_x)+(this_y-that_y)*(this_y-that_y))
BLECH! I don't want to do that every time. So I want to make a nice little function that I can apply to an object. Problem is, I don't know how to do this. Is it possible to end up with something as easy as:
Math.dist(thisclipname, thatclipname) ?
How do you guys set up functions that do bulky math and return nice clean numbers?