Registered Member
|
the print there is printing 1 for me. exactly 1. I was expecting some thing either greater than 1 or less than 0, since those lines don't intersect. I'm using eigen 2.0.10 with gcc 4.3.4 thanks. |
Registered Member
|
line1 is horizontal, line2 is vertical, so they do intersect. "Through" means that you're defining a line by giving 2 points through which it passes.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Ok, so I made some progress, but I just want to make sure I understand what's going on...
that is the same code as before, but this time instead of using the "Through" function to create the ParameterizedLine I used the origin and direction constructor. the output from that code is 2, which makes sense to me because -1+2*0.5 = 0. Here is what I don't get: the line1 variable in both the bit of code I posted represent the same line, so why is the result of the intersection different? Is it because I didn't specify a direction in the first one that it only returns 1 to say "they do intersect at some point". If so I find it very confusing, if the user passes in a line with created with Through then the code in a library may expect a line with a specific direction and length so the intersection function works a certain way. |
Registered Member
|
Ok so now you are using the ParametrizedLine constructor taking a point and a direction vector. But that constructor assumes the direction vector to be normalized, as is explained in the documentation,
http://eigen.tuxfamily.org/dox/classEig ... 19ea17074f So your first line is faulty, as (-0.5,0) is not a normalized vector. I don't understand the rest of your questions. ParametrizedLine is a class representing a parametrized line, that is the data of a origin point and a direction unit vector. It offers a static method Through() constructing such a ParametrizedLine from the data of two points through which the line must pass. But that is still the same ParametrizedLine type.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
ok, I missed the part about the normalization. intersection tests are as expected now.
thank you. |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]