Re: ContourPlot3D Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg75241] Re: ContourPlot3D Problem
- From: Roger Bagula <rlbagula at sbcglobal.net>
- Date: Sat, 21 Apr 2007 23:14:53 -0400 (EDT)
- References: <f079vc$4a0$1@smc.vnet.net>
dennis wrote:
>I am trying to plot a cone with a spherical cap. The code I am using
>is shown below.
>
>=CE=B8 = 10.*Degree;
>sMax = 10;
>a = {1., 1., 1}/Sqrt[3.];
>{x0, y0, z0} = sMax*(1 + Tan[=CE=B8]^2)*a;
>rCirc = sMax*(Tan[=CE=B8]/Cos[=CE=B8]);
>g1 = ContourPlot3D[
>If[{x, y, z} . a <= sMax, {x, y, z} . a -
> Sqrt[x^2 + y^2 + z^2]*Cos[=CE=B8], (x - x0)^2 + (y - y0)^2 + (z -
>z0)^2 -
> rCirc^2], {x, 0, 10}, {y, 0, 10}, {z, 0, 10}, PlotPoints -> {8,
>6},
> ViewPoint -> {2.651, -2.103, -0.026}, PlotRange ->
> {{0, 12}, {0, 12}, {0, 10}}];
>
>This produces the cone with a spherical cap, but it also produces a
>plane perpendicular to the cone axis at the junction of the cone and
>sphere. How can I get the cone-sphere without the plane?
>
>Thanks,
>Dennis
>
>
>
>
Your code doesn't work here either.
Try plotting it as g1 and g2:
g1-> cone
{x, y, z} . a -
Sqrt[x^2 + y^2 + z^2]*Cos[ang]
g2->sphere
(x - x0)^2 + (y - y0)^2 + (z - z0)^2 - rCirc^2
Show[{g1,g2}]
Doing this isolates the plane to the cut off cone section.
You have to specify that:
Sqrt[x^2 + y^2 + z^2]*Cos[ang]<>10
My code works worse than yours but elementates the plane
((0.5773502691896258` x + 0.5773502691896258` y + 0.5773502691896258`
z-10==0)
\!\(\*
StyleBox[\(g1\ = \
ContourPlot3D[If[0.5773502691896258`\ x + 0.5773502691896258`\
y + 0.5773502691896258`\ z > 10, \n103.10912041257637`\
\[InvisibleSpace] - 11.906015685221298`\ x +
x\^2 - 11.906015685221298`\ y + y\^2 -
11.906015685221298`\ z +
z\^2, 0], \ {x, \ 0, \ 10}, \ {y, \ 0, \ 10}, \ {z, \ 0, \
10}, \ \
PlotPoints\ -> \ {8, \n6}, \n\ \ \ \ ViewPoint\ -> \ {
2.651, \ \(-2.103\), \ \(-0.026\)}, \ PlotRange\ -> \n\ \ \
\ \ \
{{0, \ 12}, \ {0, \ 12}, \ {0, \ 10}}]\),
FontFamily->"Lucida Grande",
FontSize->13]\)
\!\(\*
StyleBox[\(g2\ = \
ContourPlot3D[If[\((
0.5773502691896258`\ x + 0.5773502691896258`\
y + 0.5773502691896258`\ z > 10)\) &&
\((0.984807753012208`\ \@\
\(\(x\^2\)\(+\)\(y\^2\)\(+\)\(z\^2\)\(\ \ \ \ \ \ \ \ \)\))\) <> 10, \n0, \
0.5773502691896258`\ x +
0.5773502691896258`\ y + 0.5773502691896258`\ z - \
0.984807753012208`\ \@\(x\^2 + y\^2 + z\^2\)], \ {x, \ 0, \ 10}, \ {y, \
0, \ \
10}, \ {z, \ 0, \ 10}, \ PlotPoints\ -> \ {8, \n6}, \n\ \ \ \
ViewPoint\ -> \
\ {2.651, \ \(-2.103\), \ \(-0.026\)}, \ PlotRange\ -> \n\ \ \ \ \ {{0, \ \
12}, \ {0, \ 12}, \ {0, \ 10}}]\),
FontFamily->"Lucida Grande",
FontSize->13]\)
Show[{g1, g2}]
The plane shows up when:
0.984807753012208*Sqrt[x^2+y^2+z^2]==0