This content has been marked as final. Show 5 replies
The only place I see would be a problem is if any of these variables were undefined, or of type text because they were coming from a text field (or XML or some such), or if R1 was equal to zero. You can add this line immediately before lambda.
Paste the response.
Most likely, ((x*2)+(y*2)) - R0 < 0. Flash can't square root negative numbers.
D'oh! I should have seen that coming. Yeah.
beyond that being the root of a negative number, when he's getting NaN:
x*2 +y*2 should probably be x*x + y*y.
interesting, this might explain why a few of my pythagorean calcs don't always work too. So other than tracking the quad, and using Math.abs, how could one go about making this calc on a cartesian system? use other trig, I suppose, or Point.distance prop?
EDIT: strike that :)