Skip to main content
deleted 21 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
  • A starting point.
  • Using f[k] x^2 + g[k] y^2 - h[k] as MeshFunctions in the Plot3D.
  • A starting point.
  • Using f[k] x^2 + g[k] y^2 - h[k] as MeshFunctions in the Plot3D.
  • Using f[k] x^2 + g[k] y^2 - h[k] as MeshFunctions in the Plot3D.
added 645 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
  • To get a surface {x, y, z[x, y, k]} with the constraint f[k] x^2 + g[k] y^2 - h[k] == 0, we could at first get the ContourPlot3D according the three variables {x,y,k}, then using the map {x,y,k} -> {x,y,z[x,y,k]}.
ContourPlot3D[ f[k] x^2 + g[k] y^2 - h[k] == 0 // Evaluate, {x, -3, 3}, {y, -3, 3}, {k, 0, 1}, PlotRange -> All, BoxRatios -> Automatic, DisplayFunction -> ReplaceAll[{x_Real, y_Real, k_Real} :> {x, y, z[x, y, k]}], BoxRatios -> Automatic, ColorFunction -> Function[{x, y, z}, Hue[z]], Mesh -> None] 

enter image description here

  • To get a surface {x, y, z[x, y, k]} with the constraint f[k] x^2 + g[k] y^2 - h[k] == 0, we could at first get the ContourPlot3D according the three variables {x,y,k}, then using the map {x,y,k} -> {x,y,z[x,y,k]}.
ContourPlot3D[ f[k] x^2 + g[k] y^2 - h[k] == 0 // Evaluate, {x, -3, 3}, {y, -3, 3}, {k, 0, 1}, PlotRange -> All, BoxRatios -> Automatic, DisplayFunction -> ReplaceAll[{x_Real, y_Real, k_Real} :> {x, y, z[x, y, k]}], BoxRatios -> Automatic, ColorFunction -> Function[{x, y, z}, Hue[z]], Mesh -> None] 

enter image description here

added 485 characters in body
Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
  • A starting point.
  • Using f[k] x^2 + g[k] y^2 - h[k] as MeshFunctions in the Plot3D.
Clear["Global`*"]; f[k_] := Sin[k]; g[k_] := Cos[k]; h[k_] := k z[x_, y_, k_] := (-3 k^2)*x^2 + (2 k^2)*y^2; Manipulate[{ContourPlot[ f[k] x^2 + g[k] y^2 - h[k] == 0, {x, -3, 3}, {y, -3, 3}, PerformanceGoal -> "Quality", AspectRatio -> Automatic], Plot3D[z[x, y, k], {x, -3, 3}, {y, -3, 3}, MeshFunctions -> Function[{x, y, z}, f[k] x^2 + g[k] y^2 - h[k]], Mesh -> {{0}}, PlotStyle -> None, BoundaryStyle -> None, PlotPoints -> 60, MaxRecursion -> 2, PlotRange -> 5, ClippingStyle -> None, BoxRatios -> Automatic]}, {{k, .5}, 0, 1}] 

enter image description here

  • Another way is map the ContourPlot to 3D curve.
f[k_] := Sin[k]; g[k_] := Cos[k]; h[k_] := k z[x_, y_, k_] := (-3 k^2)*x^2 + (2 k^2)*y^2; list = Table[ ContourPlot[f[k] x^2 + g[k] y^2 - h[k] == 0, {x, -3, 3}, {y, -3, 3}, ContourStyle -> Hue@k] /. {{x_Real, y_Real} :> {x, y, z[x, y, k]}, Graphics -> Graphics3D}, {k, 0, 1, .1}]; Show[list, PlotRange -> All] 

enter image description here

  • A starting point.
  • Using f[k] x^2 + g[k] y^2 - h[k] as MeshFunctions in the Plot3D.
Clear["Global`*"]; f[k_] := Sin[k]; g[k_] := Cos[k]; h[k_] := k z[x_, y_, k_] := (-3 k^2)*x^2 + (2 k^2)*y^2; Manipulate[{ContourPlot[ f[k] x^2 + g[k] y^2 - h[k] == 0, {x, -3, 3}, {y, -3, 3}, PerformanceGoal -> "Quality", AspectRatio -> Automatic], Plot3D[z[x, y, k], {x, -3, 3}, {y, -3, 3}, MeshFunctions -> Function[{x, y, z}, f[k] x^2 + g[k] y^2 - h[k]], Mesh -> {{0}}, PlotStyle -> None, BoundaryStyle -> None, PlotPoints -> 60, MaxRecursion -> 2, PlotRange -> 5, ClippingStyle -> None, BoxRatios -> Automatic]}, {{k, .5}, 0, 1}] 

enter image description here

  • A starting point.
  • Using f[k] x^2 + g[k] y^2 - h[k] as MeshFunctions in the Plot3D.
Clear["Global`*"]; f[k_] := Sin[k]; g[k_] := Cos[k]; h[k_] := k z[x_, y_, k_] := (-3 k^2)*x^2 + (2 k^2)*y^2; Manipulate[{ContourPlot[ f[k] x^2 + g[k] y^2 - h[k] == 0, {x, -3, 3}, {y, -3, 3}, PerformanceGoal -> "Quality", AspectRatio -> Automatic], Plot3D[z[x, y, k], {x, -3, 3}, {y, -3, 3}, MeshFunctions -> Function[{x, y, z}, f[k] x^2 + g[k] y^2 - h[k]], Mesh -> {{0}}, PlotStyle -> None, BoundaryStyle -> None, PlotPoints -> 60, MaxRecursion -> 2, PlotRange -> 5, ClippingStyle -> None, BoxRatios -> Automatic]}, {{k, .5}, 0, 1}] 

enter image description here

  • Another way is map the ContourPlot to 3D curve.
f[k_] := Sin[k]; g[k_] := Cos[k]; h[k_] := k z[x_, y_, k_] := (-3 k^2)*x^2 + (2 k^2)*y^2; list = Table[ ContourPlot[f[k] x^2 + g[k] y^2 - h[k] == 0, {x, -3, 3}, {y, -3, 3}, ContourStyle -> Hue@k] /. {{x_Real, y_Real} :> {x, y, z[x, y, k]}, Graphics -> Graphics3D}, {k, 0, 1, .1}]; Show[list, PlotRange -> All] 

enter image description here

Source Link
cvgmt
  • 91.7k
  • 6
  • 113
  • 194
Loading