Trying to do a drag and drop type action, something like you would have for inverse kinematics, where another object's angle determines how far, and what angles it can bae dragged to.
I have something using conditionals using angledif<45 ? object.x+cos(angle(object.x,object.y,touch.x,touch.y)*clamp(distance(object.x,object.y,touch.x,touch.y),0,max) :self.x
However I'm wondering if there was a better approach.
I tried clamping the cos(angle()) to the object.angle-45 min, and object.angle+45 max, but that doesn't workout because of the -180 from angle().