found answer:
var len = Math.sqrt(norma l.x * normal.x + normal.y * normal.y)
normal.x/=len;
normal.y/=len;
User Profile
Collapse
-
Javascript function that works like actionscript's normalize(1)
I need a formula that returns normalize numbers for xy point - similar to actionscript's normalize() function.
I'm brand new to this form, so if it the answer is simple, please be adviced that I was dropped on my head when I was very young. However, if it's more complex then I'm Matt...Code:var normal = {x:pt1.x-pt2.x,y:pt1.y-pt2.y}; normal = Normalize(1) // this I do not know how to implement in javascript.
No activity results to display
Show More
Leave a comment: