returning to the curve after distance from point established

4 ビュー (過去 30 日間)
Giorgio Scolozzi
Giorgio Scolozzi 2012 年 5 月 7 日
Hi, I'm writing some code to determine the coordinates of the points of a line that are r distant from each other. I'm using an intuitive process of convergence toward a desired r through a distance d in a loop.
while abs((d-r)/(d+r))*100>t
if d<r
x(inizio)=(x(fine)+x(inizio))/2;
y(inizio)=(y(fine)+y(inizio))/2;
d=d+sqrt((x(inizio)-x(fine))^2+(y(inizio)-y(fine))^2);
else if d>r
x(fine)=(x(fine)+x(inizio))/2;
y(fine)=(y(fine)+y(inizio))/2;
d=d-sqrt((x(inizio)-x(fine))^2+(y(inizio)-y(fine))^2);
The problem is that since I create iteratively new points ( x(fine) and so on) every time I'm going to find new coordinates that are not on the line I inputed in the script. Do you have any idea how to stay on this line? Thanks a lot, I know I'm not clear (maybe if you ask me something directly I'll make my self clearer).
  1 件のコメント
Oleg Komarov
Oleg Komarov 2012 年 5 月 7 日
Do you have the analytical expression for the line?

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

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 5 月 7 日
Some files that may be useful to you.

その他の回答 (1 件)

Giorgio Scolozzi
Giorgio Scolozzi 2012 年 5 月 8 日
Thanks for your time Sean, but since I don't have an analytical function..... or I can still use interpolation with just coordinates? my data set are just point traced with a plugin (NeuronJ)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by