Message Boards Message Boards

How get GPT-4 to show a homotopy of a loop on a 2-sphere?

I first asked ChatGPT (GPT-4), through MacGPT, to write Mathematica code that shows a 2-sphere with a simple closed curve on it. That gave a totally reasonable response the first time:

(*Define the 2-sphere*)
sphere = 
  ParametricPlot3D[{Sin[theta]*Cos[phi], Sin[theta]*Sin[phi], 
    Cos[theta]}, {theta, 0, Pi}, {phi, 0, 2*Pi}, 
   PlotStyle -> Opacity[0.5], Mesh -> None];

(*Define a simple closed curve on the sphere's surface*)
curve = ParametricPlot3D[{Sin[theta]*Cos[theta], 
    Sin[theta]*Sin[theta], Cos[theta]}, {theta, 0, 2*Pi}, 
   PlotStyle -> {Thick, Red}];

(*Combine the sphere and the curve*)
Show[sphere, curve]

simple closed curve on 2-sphere

But what I really want, and next asked GPT-4 to do, is write dynamic Mathematica code that shows such a simple closed curve being shrunk continuously to a point on the sphere, with a particular "base point" remaining fixed.

At this, GPT-4 failed over around 10 attempts at producing a Manipulate to do this. Some of the attempts just shrunk the given 2-sphere to a point; others had the curve wandering far off thd surface of the sphere; and still others produced images whose meaning I don't comprehend.

While I would be interested in seeing Mathematica code to shows this, I am more interested in what GPT-4 prompt might actually create such code.

POSTED BY: Murray Eisenberg
Posted 5 months ago

Your curve looks close to Viviani's Curve: enter image description here

See different perspectives of that curve on that MathWorld page.

POSTED BY: Phil Earnhardt
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract