Point.distance (like pretty much all Flash math functions) is
abysmally slow and shouldn't be used in anything performance-critical.
Write your own replacement (using formula provided above) if you're
doing a bunch of these every frame.

On 3/11/08, Kenneth Kawamoto <[EMAIL PROTECTED]> wrote:
> Isn't it pointless to do Math.abs() since result is always positive
>  number anyway? ;)
>
>
>  Kenneth Kawamoto
>  http://www.materiaprima.co.uk/
>
>
> Paul Andrews wrote:
>  > ----- Original Message ----- From: "Merrill, Jason"
>  > <[EMAIL PROTECTED]>
>  > To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
>  > Sent: Tuesday, March 11, 2008 1:53 PM
>  > Subject: RE: [Flashcoders] calculating distance between two points
>  >
>  >
>  >>>> Your teacher must be cringing!
>  >>>>
>  >>>> "The square of the hypotenuse equals the sum of the squares of the
>  >>>> opposite two sides" should be familar..  ;-)
>  >>>>
>  >>>> Math.sqrt ( Math.pow(Math.abs(x1-x2),2 )+Math.pow(Math.abs(y1-y2),2
>  >>>> )+))
>  >>
>  >>
>  >> Why not skip the math lessons and use the Point class?
>  >
>  > Yes, my explanation was what was completely pointless..
>  _______________________________________________
>  Flashcoders mailing list
>  Flashcoders@chattyfig.figleaf.com
>  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>


-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to