There's more than one way to do things PerlMonks

### Re: The intersection of M hyperplanes (Ndim)

by hippo (Archbishop)
 on Jul 18, 2024 at 15:07 UTC Need Help??

in reply to The intersection of M hyperplanes (Ndim)

I have also experimented with transforming the planes matrix to the Reduced Row Echelon Form.

Isn't it amazing how a simple phrase like "Reduced Row Echelon Form" can transport you back decades to when you last used it (or probably even heard/read it). Thanks for that sudden slip out of the present!

My question is: what happens if any coefficient is zero (or actually both coefficients (e.g. a1 and a2) are zero?

If both are zero, then that is fine because your normal vectors are not divergent in that axis. If only one or other is zero then they are divergent and the planes are not parallel and will then intersect. You can always rotate your co-ordinate system through something other than π to prove this. That's the only one of your questions I can attempt off the top of my head, sorry.

🦛

• Comment on Re: The intersection of M hyperplanes (Ndim)

Replies are listed 'Best First'.
Re^2: The intersection of M hyperplanes (Ndim)
by bliako (Abbot) on Jul 18, 2024 at 15:59 UTC

So, I understand that if a1=0 and a2=0 then the vectors are "parallel on that axis", and so I proceed to check the other coefficients in order to determine if the planes are parallel. If one of a1 OR a2 is zero then I conclude the vectors (and the planes) are not parallel and the test can stop right there.

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

• either only one is 0 (next if both are)
• or the ratio k is not like before (unless undef)

##### 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

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.

Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11160681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-08-07 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When will the AI bubble burst?

Results (12 votes). Check out past polls.

Notices?
 • erzuuli ‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.