Generating way points based on other waypoints

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.

Réponses (1)

José-Luis
José-Luis le 5 Juil 2016

0 votes

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 commentaire

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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Sparse Matrices dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by