Offsetting race track centre line data

20 views (last 30 days)
Hi
I have read through many of the posts on here but I am struggling to find a solution wherby I need to offset the centre line coordinates of a track. As the race circuit is a closed system, typical ways of offsetting a curve seems to create cross over of the inner and outer circuit parameters.
I have the centre line of the race track (attached file) that has been extracted from the race vehicle at 20Hz, so quite a large data set. I do have 5 and 2 Hz if it is easier. I need to create an inner and outer circuit limit that contains the same amount of points but with an offset of 7.5m either side of the centre line, to make the overall track width 15m from inner to outer. This data is set with global coordinates so the 0,0 is based at the centre of the overall track architeture. The first x,y coordinates can be set to 0,0 (centre of start/finish line) if that also helps with the solution.
I have tried this code but potentially messed it up so it so did not work for my coordinates: https://uk.mathworks.com/matlabcentral/answers/427870-i-have-one-curve-i-want-to-create-another-curve-offset-to-that-one-at-right-angle
Can anybody help in creating the 2 additional (inner and outer) plots that have the 7.5m offset from the centre line?
Regards
Kieran

Accepted Answer

darova
darova on 20 May 2020
Try the attached script. It's pretty simple. I leaved some comments so all should be clear
There is a function self_inter inside the script. It calculates points where a curve is intersecting itself. You can cancel/remove it if you don't need it
Result
  3 Comments
Furkan Bek
Furkan Bek on 26 Nov 2021
This was very helpful, thank you for sharing this.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!