From: cire g on 4 Feb 2010 06:25 Hello Guys, How to set CountourPlot3D to plot the intersection of two surfaces. For example I would like to see the curve of the intersection of these cones: ContourPlot3D[{((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z ) Sin[Pi/4])^2 == 0 , 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}] Best regards, eric
From: dh on 5 Feb 2010 03:29 Hi Eric, we may calculate the intersection curves by: intersec = {x, y, z} /. Solve[{((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z) Sin[Pi/4])^2 == 0, 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {z, y}] we may then insert these curves into the plot of the two surfaces: Show[{ContourPlot3D[{((x - 1)^2 + (y)^2) Cos[ Pi/4]^2 - ((z) Sin[Pi/4])^2 == 0, 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}], ParametricPlot3D[intersec, {x, -2, 1}, PlotStyle -> Thickness[0.01]] }] Daniel cire g wrote: > Hello Guys, > How to set CountourPlot3D to plot the intersection of two surfaces. > For example I would like to see the curve of the intersection of these > cones: > ContourPlot3D[{((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z > ) Sin[Pi/4])^2 == 0 , > 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, -5, 6}, {y, -5, > 5}, {z, -5, 5}] > Best regards, > eric >
From: Bill on 5 Feb 2010 03:33 Hi Eric: This isn't exactly what you asked for, but perhaps it will suffice... Solve[{((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z) Sin[Pi/4])^2 == 0, 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, z}] // N; Flatten[{{x, y, z}} /. {%[[1]], %[[2]], %[[3]], %[[4]]}]; curves = ParametricPlot3D[{Out[2]}, {y, -Pi, Pi}, PlotRange -> All, PlotStyle -> {Magenta, Thickness[.01]}]; cones = ContourPlot3D[{((x - 1)^2 + (y)^2) Cos[ Pi/4]^2 - ((z) Sin[Pi/4])^2 == 0, 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}, Mesh -> False, ImageSize -> 600]; Show[cones, curves] Hth, Bill (Mathematica 6.0.1, Win XP on a pc.)
From: Bob Hanlon on 5 Feb 2010 03:34 eqns = { ((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z) Sin[Pi/4])^2 == 0, 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2} plt1 = ContourPlot3D[Evaluate[eqns], {x, -5, 6}, {y, -5, 5}, {z, -5, 5}] (sub = {Reduce[eqns] // ToRules}) // Column plt2 = ParametricPlot3D[ Evaluate[{x, y, z} /. sub], {z, -5, 5}, PlotStyle -> Directive[Red, Thick]] Show[plt1, plt2] Bob Hanlon ---- cire g <eric.phys(a)gmail.com> wrote: ============= Hello Guys, How to set CountourPlot3D to plot the intersection of two surfaces. For example I would like to see the curve of the intersection of these cones: ContourPlot3D[{((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z ) Sin[Pi/4])^2 == 0 , 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}] Best regards, eric
From: David Park on 5 Feb 2010 03:34 Cone equations: cone1 = ((x - 1)^2 + y^2) Cos[\[Pi]/4]^2 - (z Sin[\[Pi]/4])^2 == 0; cone2 = (x^2 + y^2) Cos[\[Pi]/6]^2 - (z Sin[\[Pi]/6])^2 == 0; Solve for x and y: xysols = Solve[{cone1, cone2}, {x, y}] Parameterize the intersections: intersection1[z_] = {x, y, z} /. First[xysols] intersection2[z_] = {x, y, z} /. Last[xysols] Plot the cones and the intersections: Needs["Presentations`Master`"] Draw3DItems[ {(* The two cones *) Opacity[.5], ContourDraw3D[cone1 // Evaluate, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}, ContourStyle -> Orange, Mesh -> False], ContourDraw3D[cone2 // Evaluate, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}, ContourStyle -> Green, Mesh -> False], (* The intersections *) Opacity[1], Black, AbsoluteThickness[2], ParametricDraw3D[intersection1[z], {z, -3, 3}], ParametricDraw3D[intersection2[z], {z, -3, 3}]}, NeutralLighting[0, .5, .1], NiceRotation, Boxed -> False] Each intersection solution is split between the upper and lower cones. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: cire g [mailto:eric.phys(a)gmail.com] Hello Guys, How to set CountourPlot3D to plot the intersection of two surfaces. For example I would like to see the curve of the intersection of these cones: ContourPlot3D[{((x - 1)^2 + (y)^2) Cos[Pi/4]^2 - ((z ) Sin[Pi/4])^2 == 0 , 0 == (x^2 + y^2) Cos[Pi/6]^2 - (z Sin[Pi/6])^2}, {x, -5, 6}, {y, -5, 5}, {z, -5, 5}] Best regards, eric
|
Pages: 1 Prev: DeleteDuplicates is too slow? Next: NonlinearModelFit vector valued functions |