フィルターのクリア

Create a line with variable buffer zone

5 ビュー (過去 30 日間)
Jack Naumann
Jack Naumann 2017 年 12 月 13 日
コメント済み: Jack Naumann 2017 年 12 月 13 日
Hi all,
I have been struggling with this problem for a while.
I have a series of co-ordinates, stored in an x and a y variable. This represents a (curved) path through space. I am trying to create two more paths either side of the original(at a fixed or variable distance).
My general approach so far has been to
1. Calculate the gradient at each point (m)
2. Find the inverse gradient at each point (-1/m)
3. Find the x and y components of the perpendicular distance required
4. Add or subtract these distances from each point on the original curve as necessary.
This approach works for part of the path but I'm having trouble when the path curves round on itself, my new path will jump from being on the left to the right.
I appreciate this is more of a mathematical problem than a matlab one - but I was hoping someone might have a neat solution to do this in matlab (I don't have the Mapping toolbox)
Many thanks
Jack
  2 件のコメント
Jan
Jan 2017 年 12 月 13 日
編集済み: Jan 2017 年 12 月 13 日
If you post your code, it is much easier to fix it. Writing the code from scratch is much harder. The readers can e.g. not guess, how you calculate the gradient.
Jack Naumann
Jack Naumann 2017 年 12 月 13 日
Ok, here is the rough approach I was thinking of. The gradient function isn't perfect but gives a rough approximation for this example
[x,y]=ll2utm(lat,long);
grad=gradient(x,y)
inv_grad=(-1/grad)
y_dist=sqrt(buffer.^2/((inv_grad.^2)+1));
x_dist=abs(y_dist/inv_grad);
x=x+x_dist
y=y+y_dist

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by