The length of the intersection curve between a sphere and a cylinder

6 ビュー (過去 30 日間)
Sora Kagami
Sora Kagami 2019 年 5 月 26 日
コメント済み: John D'Errico 2019 年 5 月 27 日
How can I compute the length of the intersection curve between the sphere
x^2+y^2+z^2=16
and the cylinder
x^2+y^2=2x
  3 件のコメント
Sora Kagami
Sora Kagami 2019 年 5 月 26 日
Though I've managed to draw the 2 solids, I still can't compute the length of the curve
John D'Errico
John D'Errico 2019 年 5 月 26 日
It would seem this would have been a far more interesting problem if they changed the cylinder by a bit. Perhaps something like:
x^2 + y^2 = 6*x - 4
That should probably combine the disjoint segments into one continuous curve.
Or, if they had made it a cylinder with an elliptical cross-section.
So maybe good that I am not teaching this class. ;-)

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

採用された回答

John D'Errico
John D'Errico 2019 年 5 月 26 日
編集済み: John D'Errico 2019 年 5 月 26 日
I won't do your homework. I'll get you off to a good start, in fact, probably more than you deserve, since you appear to have made no serious effort.
The sphere is a sphere centered at the origin, of radius 4.
The cylinder is a circle in the (x,y) plane, so the same for all z. Completing the square, it can be written as:
(x^2 - 2*x +1) + y^2 = 1
or
(x - 1)^2 + y^2 = 1
So the cylinder has center (1,0,z), for all z.
That tells me the two objects do intersect, as well, they will intersect in TWO disjoint curves, one for positive z, the second for negative z.
In fact, if you view the intersection curve from the top, it will look perfectly circular. And this should be the clue you need.
Suppose you thought about this in terms of polar coordinates? To make it simple, translate the problem so the cylinder is centered at (0,0) in (x,y). Then the equation of the sphere is just:
(x+1)^2 + y^2 + z^2 == 16
The cylinder is now
x^2 + y^2 == 1
Nothing changes about the length of the curve. But perhaps now you can visualize that happens when we re-write this all in polar form. Actually, cylindrical coordiantes, thus (r,theta,z)
In cylindrical coordinates, the cylinder has equation
r == 1
Now, substitute into the sphere equation. Remember, since we now know that r==1,
x = r*cos(theta) = cos(theta)
y = r*sin(theta) = sin(theta)
now, lets look at what happened to the sphere.
(I've deleted the stuff that gives you a formula for z as a function of theta. In fact there is a remarkably simple form for z that will result.)
z = stufffffffffffff
Can you now find the arc length of that function, as theta varies from 0 to 2*pi? (I hope so.) A quick numerical computation of my own had the arc length as roughly 6.3864. My guess is only the first few digits of that are accurate, because of the approach I took for that first pass. But it should be close to 2*pi, but a bit larger, just as a visual assessment from a plot.
How do you find the arc length of a curve? I might be lazy, and use my arclength utility, as posted on the file exchange.
theta = linspace(0,2*pi,10000);
x = cos(theta);y = sin(theta);z = ????????;
arclength(x,y,z,'spline')
ans =
6.39448891369661
You should be able to do the same however, using an integration. A google search for the phrase
"arc length of a parametric curve"
might give you some ideas. Don't forget that this curve is in the form (x(theta),y(theta),z(theta)). x(theta) is just cos(theta), etc. In fact, when I do that computation, integral tells me the arc length should be
ans =
6.39448891369662
int did not find a symbolic solution however. Que sera, sera. But vpaintegral gives me:
ans =
6.3944889136966193144
I would note that the answer is indeed just a wee bit more than 2*pi, as I predicted it should be.
So, now all you need to do is do the algebra, then do some numerical methods work to replicate my results. IF you do decide to make a serious effort, then show what you did as a comment here. If you come at least close, showing that you have thought about the problem, then I might raise some of the veil on my answer.
  4 件のコメント
Sora Kagami
Sora Kagami 2019 年 5 月 27 日
Thank you so much for this answer.
But I want to say this. I'm new to matlab and my lecturer didn't give any guidance about this problem.
So you can think that I've made no serious effort but I tried every possible ways that I know, I've tried my own methods, searched for solutions, but it's all incorrect.
But once again, thank you for helping me.
John D'Errico
John D'Errico 2019 年 5 月 27 日
The point of much that I said was you did not need MATLAB to do it. In fact, almost everything I did was written first on a piece of paper, where I needed to know nothing more than how to convert to polar coordinates, thus
x = r*cos(theta)
y = r*sin(theta)
and the basic identity
sin(theta)^2 + cos(theta)^2 = 1
Anyway, I gave you explicit instructions of what to do. You can follow them, and derive a simple solution on paper for z as a function of theta in polar form. Once you have that, IF you show what you get, and make any credible shot at putting it into MATLAB, I'll be more forthcoming. But until then, I don't do homework, although I am willing to help a person who seriously tries and shows the effort made. So go for it. I gave you entirely enough to solve the problem.

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

その他の回答 (1 件)

darova
darova 2019 年 5 月 26 日
It's clear enough to see that all x, y of the curve are belong to cylinder:
img1.png
And z coordinate we can get from sphere equation since we have all x,y:
img2.png
Curve intersection looks like circle so its length has to be about 2pi*r:
img.png

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by