I have 3 vectors right now i have determined which vector is at conterclockwise direction by using cross product of vector u*v and u*w. Lets say i found that vector v is at the conterclockwise direction of vector u now What i want right now is to rotate this vector till it don't concide with the vector w. How do i do it using eigen? Here is small code which i've wirtten for it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Eigen::Vector3d u = {pb.front().x-p0.x,pb.front().y-p0.y,0};
Eigen::Vector3d v = {pe.front().x-p0.x,pe.front().y-p0.y,0};
Eigen::Vector3d w = {pe.back().x-p0.x,pe.back().y-p0.y,0};
auto uCrosv = u.cross(v);
if(uCrosv.z()>0) { // anti clockwise direction
Eigen::Vector3d uNormalized = 10*u.normalized();
float la = 360.0/(2*PI*radi);
for(float theta=0;theta<360;theta+=la) {
for(float r=1;r<=radi;r++) {
cv::Point pi = {int(p0.x + r * cos(theta)),int(p0.y + r * sin(theta))};
}
}
}
Here while rotating the vector i also want to check what points/pixels are touched by the vector line segment. eg. for vector u(0,5) it touches pixels/points 0,1,2,3,4,5 in its line segment.
I am using unbutu.
> rotate this vector till it don't concide with the vector w
I don't understand
if u != w, then you do nothing
if u == w, then you rotate a very small (as small as you want) angle
> Eigen::Vector3d uNormalized = 10*u.normalized();
... weird normal