Generating way points based on other waypoints

1 次查看(过去 30 天)
Hej guys am trying to generate (x1,y1) based on other (x,y).Imagine these points as a waypoints for a car1 and car2.I want to make the way points parallel to each other.Giving a constant offset between two waypoints is not changing.How to make them parallel in whatever direction the frst way point goes.
I have attached the image .Red is the default waypoints and blue is the waypoint am trying to make it parallel in wwhatever direction it goes.This is what i got when i tried with a contant offset.

回答(1 个)

José-Luis
José-Luis 2016-7-5
If you have the mapping toolbox, you could adapt bufferm to your needs.
Otherwise, there are options in the file exchange, best summarized here.
  1 个评论
Suriya Prasanna Bhubalan
Hej thank you for your suggestion. I was working on this
vec.x = B.x - A.x;
vec.y = B.y - A.y;
To rotate a 2d vector by 90 degrees, switch the components and negate one. So you could create:
rightVec.x = vec.y;
rightVex.y = -vec.x;
And then position C at :
C = A + t*rightVec;
This seems to work well :D

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Parallel Server 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by