in reply to Re^2: The intersection of M hyperplanes (Ndim)
in thread The intersection of M hyperplanes (Ndim)

Look, similar to the rule you already stated:

taking two vectors, for them to be collinear there must exist one k != 0 such that for all coordinate d: d1 = k * d2

Obviously d1 == 0 iff d2 == 0 because k != 0 !!!

But if one coordinate is 0 for both it doesn't matter which k is chosen for the other ones.

Isn't it obvious now?

You check all coordinates in a loop and break if

Edit
FWIW: There is one edge case left, the zero vector. But a normal vector with all coordinates being 0 looks like a bug to me and should raise an exception.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^4: The intersection of M hyperplanes (Ndim)
by bliako (Abbot) on Jul 19, 2024 at 11:10 UTC

    got it, thanks LanX

    fyi, I googled it a lot before asking this particular question. "when are 2 vectors / 2 planes are parallel". What I got was lots and lots of the ratio test but not mentioning at all any of the edge cases. I finally asked here for a clarification : https://math.stackexchange.com/questions/3925150/find-if-2-planes-are-parallel-or-not, the answeree has a huge XP but fails to complete their answer with common sense question.

      FYI, like many others, I did it in "high school" for 3D but most never apply it again. (When studying Math at uni this was covered in just a week at best)

      So while most think they still master it they are quite rusted. Or reluctant like I am.°

      I'm quite confident about 3D because it's very visual. The abstraction to higher dimensions is a door I never really actively passed.

      (It's "too trivial" for mathematicians ;)

      I hope my explanation was of help, do you need the algorithm as explicit code?

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery

      °) instead of remembering the rules like engineers do, we tend to deduce it from basic axioms

        Thanks, I have update the demo code, sub are_planes_parallel()