Generating way points based on other waypoints

7 Ansichten (letzte 30 Tage)
Suriya Prasanna Bhubalan
Suriya Prasanna Bhubalan am 5 Jul. 2016
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.

Antworten (1)

José-Luis
José-Luis am 5 Jul. 2016
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 Kommentar
Suriya Prasanna Bhubalan
Suriya Prasanna Bhubalan am 5 Jul. 2016
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Gamma Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by