[ascoders] Re: Math: Kreuzprodukt

Hier eine Math Version.

Witizgerweise ist die Rotationmethode bei unbeweglichen Objekten schneller
zu berechnen.

Math.getDistancePoint_Line = function ( px , py , x0 , y0 , x1 , y1 ) {
 var dx = x1 - x0;
 var dy = y1 - y0;
 return ( ( x0 - px ) * ( y1 - py ) - ( y0 - py ) * ( x1 - px ) ) /
Math.sqrt( dx * dx + dy * dy );
}


aM
http://www.andre-michelle.com
http://public.extrajetzt.de

------------------------------------------------------
Archiv   : http://www.freelists.org/archives/ascoders/
Optionen : http://www.freelists.org/list/ascoders
------------------------------------------------------

Other related posts: