How to shift, add, and extended a vector?
5 次查看(过去 30 天)
显示 更早的评论
Hi All,
I am having trouble figuring out how to shift, add, and extened a vector in MATLAB. I have a picture below to try an illustrate what I am trying to accomplish
I am able to calaculate the angle between the blue vector and green vector. I then want to take the green vector and "shift" it so the tail of the green vector is added to the tip of the lower oragne vector, while maintianing the angle I claculated between the blue and green vector. Finally I want to extend the green vector until it is as long as the second orange vector (meant to illsuarate the final result I am trying to gain), which extends to the dashed blue line that is perpendicular to the second blue vector.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/208890/image.png)
4 个评论
Jan
2019-3-19
Please post, what your inputs are. Then it is much easier to post a solution, because inventing own data migt not match your needs.
"X,Y point that would be located at the the tip of the top oragne vector based on the angle between the blue and green vectors."
This is not clear yet. You have the start point and directions of the orange, blue and green vectors (in which format? [X,Y] coordinate and signed angle between the direction and the X-axis and the length of the vector? Or [X1, Y1; X2, Y2] as start and endpoint of the vectors?). What is now "based on the angle"?
I assume, that actual code has 2 or 3 trivial lines only. But the problem is not explained exactly yet.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Author Block Masks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!