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.

답변 (1개)

José-Luis
José-Luis 2016년 7월 5일

0 개 추천

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

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

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Gamma Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by