independent direction vectors of a plane -凯发k8网页登录
solution stats
problem comments
-
7 comments
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!
solution comments
problem recent solvers
suggested problems
-
4112 solvers
-
7199 solvers
-
1115 solvers
-
142 solvers
-
320 solvers
more from this author
problem tags
community treasure hunt
find the treasures in matlab central and discover how the community can help you!
start hunting!