Skip to main content
Became Hot Network Question
Tweeted twitter.com/StackMma/status/1436525030985379841
added 22 characters in body
Source Link
Yaroslav Bulatov
  • 7.7k
  • 2
  • 23
  • 50

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

edit Brett's solution below fixes it (notebook)

enter image description here

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

edit Brett's solution below fixes it (notebook)

enter image description here

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

edit Brett's solution below fixes it (notebook)

added 188 characters in body
Source Link
Yaroslav Bulatov
  • 7.7k
  • 2
  • 23
  • 50

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

edit Brett's solution below fixes it (notebook)

enter image description here

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

edit Brett's solution below fixes it (notebook)

enter image description here

edited body
Source Link
Yaroslav Bulatov
  • 7.7k
  • 2
  • 23
  • 50

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 

I was using MeshFunctions to get intersection of quadratic with plane, but am getting some unexpected curves, any idea how to get rid of them, or maybe a more elegant way to achieve this effect?

genPlot[theta_] := ( plot1 = Plot3D[3 x^2 + y^2, {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3 &, If[#1 != 0, ArcTan[#1, #2], -1] &}, MeshStyle -> {Automatic, Thick}, Mesh -> {5, {theta, theta - Pi}}, Boxed -> False, Axes -> False, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 3], PlotPoints -> 25]; point = 2 {Cos[theta], Sin[theta], 0}; plot2 = Graphics3D[{Opacity[.5], EdgeForm[None], Polygon[{-point, point, point + {0, 0, 10}, -point + {0, 0, 10}}]}]; Show[plot1, plot2, SphericalRegion -> True] ); genPlot[Pi/4] 
Source Link
Yaroslav Bulatov
  • 7.7k
  • 2
  • 23
  • 50
Loading