in reply to Re: Seeing if two numbers have the same sign ($x / abs $x)
in thread Seeing if two numbers have the same sign
Triangle equality:
for vectors a, b,
(Note here || is "norm", not or.)
Angle between two vectors:
The angle theta between two vectors a, b satisfies
(That the second theorem implies the first is left as an exercise for the reader. :-)
For one dimensional vectors ("numbers") the norm is the absolute value, and there are only two "directions" -- out along the positive axis and out along the negative axis. So syphilis is applying the triangle equality, while lodin is computing the cosine directly (note cos 0 = 1 -> "same sign" while cos 180 degrees = -1 -> "opposite sign").
</obsMathRef>
We now return to our regular interpretation of line noise as script.
--woody
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Seeing if two numbers have the same sign ($x / abs $x)
by lodin (Hermit) on Jan 12, 2008 at 05:28 UTC | |
by WoodyWeaver (Monk) on Jan 12, 2008 at 13:24 UTC |