Create an ellipse with equal distance between two points

6 ビュー (過去 30 日間)
Muhammad Usman
Muhammad Usman 2019 年 9 月 26 日
コメント済み: philio63 2022 年 8 月 1 日
I have created an ellipse as shown
The distance between two consecutive nodes is different I want to create an ellipse with constant distance between the nodes (e.g. 0.125)
Is there any way that I can do this?
Thanks in advance
ellipCenter_x = 0;
ellipCenter_y = 0;
ellipRadius_x = 8;
ellipRadius_y = 2.5;
theta = 0:0.1:2*pi;
x1 = ellipRadius_x*cos(theta)+ellipCenter_x;
y1 = ellipRadius_y*sin(theta)+ellipCenter_y;
x1(end) = x1(1); y1(end) = y1(1);
plot(x1,y1,'ro','Linewidth',0.5);
axis equal
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 9 月 26 日
編集済み: KALYAN ACHARJYA 2019 年 9 月 26 日
The distance between two consecutive nodes is different I want to create an ellipse with constant distance between the nodes (e.g. 0.125)
How you are measuring the distance from one node to other?
Muhammad Usman
Muhammad Usman 2019 年 9 月 26 日
編集済み: Muhammad Usman 2019 年 9 月 26 日
Coordinates of each point is stored in ' x1 ' and ' y1 '

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

採用された回答

John D'Errico
John D'Errico 2019 年 9 月 26 日
編集済み: John D'Errico 2019 年 9 月 26 日
The simplest way to do this is to use my interparc tool.
Just take the set of points on the ellipse. Then pass them into interparc.
pt = interparc(100,x1,y1,'csape');
plot(pt(:,1),pt(:,2),'o')
axis equal
interparc is on the file exchange, here:
Could you solve this using other tools? Well, yes. I can think of several ways to do so. But they would all take at least some thought, and are not worth the effort when a trivial solution is already available.
  3 件のコメント
philio63
philio63 2022 年 8 月 1 日
I get an error... when attempting the above:
CSAPE was requested, but you lack the necessary toolbox.
oh no. is this something Matlab has discontinued? and if so, I hate when that happens
philio63
philio63 2022 年 8 月 1 日
ok Replace
'csape' with 'spline'
and it will work!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by