フィルターのクリア

how to find the end of major and minor axis of an ellipsoid

2 ビュー (過去 30 日間)
nadia nadi
nadia nadi 2017 年 3 月 10 日
編集済み: Walter Roberson 2017 年 4 月 21 日
Dear,
I have this information of an ellipse
a=29.2139; b=17.7345; xC= 43.9666; yC=42.9211; angle=29.7207;
can any one tell me why the end of the major and minor axis are not in the right place. I tried to rotate them using matrix H, but still it gives me wrong places. can any one help please.
Many thanks,
Nadia,

回答 (3 件)

Image Analyst
Image Analyst 2017 年 3 月 10 日
Looks like you forgot to apply your rotation matrix to the "g" coordinates.
  2 件のコメント
nadia nadi
nadia nadi 2017 年 3 月 13 日
編集済み: nadia nadi 2017 年 4 月 21 日
hello, thanks for replying. I applied but still gives me the wrong positions.
Image Analyst
Image Analyst 2017 年 4 月 21 日
See attached demo.

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


Roger Stafford
Roger Stafford 2017 年 3 月 13 日
I think you need
axis equal
so that scaling is the same for both axes.
  1 件のコメント
nadia nadi
nadia nadi 2017 年 3 月 13 日
編集済み: nadia nadi 2017 年 3 月 13 日
Sorry I did it but it does not work. Best,

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


Roger Stafford
Roger Stafford 2017 年 4 月 21 日
編集済み: Walter Roberson 2017 年 4 月 21 日
I will make some assumptions about the ellipse you describe:
  1. The ‘a’ and ‘b’ values are the lengths of the ellipse’s semi-major and semi-minor axes, respectively.
  2. xC and yC are the cartesian coordinates of the ellipse’s center.
  3. The ‘angle’ is the angle in degrees, measured counterclockwise, from the x-axis to the ellipse major axis.
The ellipse axes’ four ends will then be:
Major axis, upper right: x1 = xC+a*cosd(angle)
y1 = yC+a*sind(angle)
lower left: x2 = xC-a*cosd(angle)
y2 = yC-a*sind(angle)
Minor axis, upper left: x3 = xC-b*sind(angle)
y3 = yC+b*cosd(angle)
lower right: x4 = xC+b*sind(angle)
y4 = yC-b*cosd(angle)
You can make a plot of the ellipse as:
t = linspace(-180,180,1000);
x = xC+a*cosd(t)*cosd(angle)-b*sind(t)*sind(angle);
y = yC+a*cosd(t)*sind(angle)+b*sind(t)*cosd(angle);
plot(x,y,y-,[x1,x2],[y1,y2],r*,[x3,x4],[y3,y4],g*)
axis equal
Note: It is not a good practice to use 'angle' for the name of your variable, since that is a reserved name for one of matlab's functions.

カテゴリ

Help Center および File ExchangeMotion Modeling and Coordinate Systems についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by