Re: Fw: Distance between 2 points
Ralf Nieuwenhuijsen wrote:
> What do right-triangles have to do with this ?
errr.... everything... your using the pythagorean
theorem to determine a hypoteneuse(sp?) of the legs
of a right triangle to determine distance and
angle... ummm... where do you think the arctan()
part of this came from??? *shrug*
>>ummmmm what should we do if adj is 0?
>>if it's zero, theta is *not* zero, in theory,
>>theta is *undefined*, is it not? :>
> Angle would be 0 or 180 wouldnt it be ?
>snip
> a = a - b
> angles = {arctan(a[1]/a[2])} ***look here
> b = a * a
ummmm this is what i was trying to point out to ya :)
if in your function, a[2] is 0, which in my function
would have been adj(as above), then division by
0 is *undefined* and you can read that as **CRASH**.
and the adj (a[2]) can most definitely turn up
on occassion as 0, which would describe a straight
line vector along one of your axis.
so i ask again, if adj (a[2]) is 0, what would you
like done with it, and the subsequent calculation
of theta, which at that point is ALSO _undefined_...
(if division by zero is undefined, then any result
based upon that calcuation is undefined)
see, theta being zero is *already* defined if opp (a[1])
is 0 as you would get 0/num which is 0, so that would
describe one of your two vectors along the respective
axis that you have sent to the function.
you cannot use 180 since that would indicate (-) direction
along the axis we define if either opp (a[1]) is 0
(giving you 0/adj) or theta actually winds up as 0.
since 0 and 180 are taken, and we are looking at a
truly _undefined_ value in the first place...
things get ugly, which is why i phrased my question
the way i did in the first place :)
see? :)
--Hawke' the headache giver :)
|
Not Categorized, Please Help
|
|