Problem 2083. Independent direction vectors of a plane
For the vectors to be independent, the test suite should have assert(dot(v1,v2)==0).
instead of assert(dot(v1,v2)~=0) ...
I agree. First, I did not succeed for that reason.
I am curious about the 26-node solution.
This is unfortunately suffering from many issues.
1. Many cases (planes parallel to one or two axes) aren't covered in the test suite.
2. Exact equality tests are used for floating-point comparisons, which can lead to spurious failures.
3. assert(dot(v1, v2) ~= 0) doesn't make sense, as remarked.
4. Neither would assert(dot(v1, v2) == 0), however, since the direction vectors are required to be (linearly) independent, not orthogonal.
Christian, I think the assertion dot(v1,v2)~=0 is placed to ensure that the two vectors are not parallel and therefore are independent.
I have modified the assert conditions and added some test cases to reflect planes parallel to axis/axes.
Thank you, Dyuman!
Problem Recent Solvers15
It dseon't mettar waht oedrr the lrettes in a wrod are.
All your base are belong to us
Reverse the elements of an array
More from this Author10
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!