actionscript 3 - How to find that the point is between two points -
i have been trying create curve , i've created . thing if add point added array[last point -1] , if add point between first , second point curve takes last point -1 coding anyway,
function findpoints() { var newpt:point = new point(evt.stagex, evt.stagey); _points[poin] = newpt; //trace(_points) poin += 1; redrawcanvas(); } i want know whether can find function
after serious , continuous research i've found answer question , need find end points , have , points array , can able find whether between specific points using formulation , able add array based on terms ,
var pt:point = new point(cmenu.x,cmenu.y); (var i:int =0; <= _points.length-1; i++) { var ss:int = (_points[i] point).x; var sss:int = (_points[i] point).y; if(pt.x > ss ) { var change:int = i+1; } } _points.splice(change,0,pt); i got desired output , posting here in case needs in future.
Comments
Post a Comment