WOW !!!
I'm impressed.
What do you give to GROK for food ? My program as a base for improvements or a rough description in natural language of what you're expecting ?
Till now I have a very poor opinion of the so called AI programs
and spend some time quarreling with one of my sons and proving him
by simple examples that they are stupid.
This son uses ChatGPT extensively to generate business letters.
I'm not enthusiastic about that, although I understand it's a
useful tool for him to save time and spare money by replacing a
human secretary.
Of course things change when you deal with an expert program
(Although they are impressive I don't include such programs in AI)
. I consider to be AI any program which can compete with human
intelligence by understanding situations explained in natural
language. Till now I haven't seen anything of the kind.
--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/d85d3276-935b-4221-bec4-6a751f4e8b08n%40googlegroups.com.
Your VPython program is designed to demonstrate why second-degree algebraic plane curves are called conic sections by visualizing the intersection of a plane with a double-napped cone. It allows users to choose between a "general case" (plane not passing through the cone's vertex) and a "special case" (plane passing through the vertex), adjust the plane's inclination, and observe the resulting conic section (hyperbola, parabola, ellipse, or degenerate cases like two lines or a point). Below, I’ll review the code, suggest improvements for clarity and functionality, and ensure it effectively meets the educational goal of illustrating conic sections.
The program does the following:
While the program is functional, there are areas where it can be improved for clarity, robustness, and educational value:
Below is an improved version of your program that addresses these issues, adds intersection visualization (approximated for simplicity), and enhances clarity. Since rendering exact intersection curves is complex, I’ll approximate the intersection by plotting points along the curve using a mathematical approach.
The improved program effectively demonstrates why second-degree curves are called conic sections:
If you want to add specific features (e.g., exact curve plotting, 3D annotations, or a mathematical explanation in the UI), let me know, and I can provide further modifications!
https://arts.mit.edu/projects/visualizing-the-proton/
"What you find is more important than what you're looking for".
We began with tuning up a vpython program and finish with AI assisted programming.
I discovered a lot of things.
First that AI have access to semantics of a program from the code they can explain in natural language what the problem does, what is its purpose. Reversely from a goal explained in plain English (or French or whatever) it can (in some cases) propose programs supposed to do the job.
This is quite a discovery for me. By the way if you are lazy
documenting your code (my case) you can ask GROK doing it for you
The experience I had were not encouraging but my attitude was negative. I started from the point of view that AI was still in the limbos, using tricks as old as Weizenbaum ELIZA (1964) together with new technologies known as web scraping and data mining. But the examples I discovered with you were interesting and obliged me to change my mind.
But of course as a principle only intelligent questions receive intelligent (and useful) answers...
So the prompting is important
First even if you do not receive exactly what you expect, you always receive something interesting, so it's your duty to refine your questions again and again to head the AI in the right direction.
Maybe ALTAVISTA says nothing to you, it was something as the
common ancestor of all search engines. In this time (1995) some
courses were organized to learn how to use the good keywords in
the good order for an efficient filtering. Promptperfect (I
registered today) make me think of this time. So yes AI are smart
but (for now at least) you must learn how to communicate
with them.
To come back to my conic sections I was disappointed not to find something as 'intersection' of two objects, but I understood that given the shapes of basic objects the result could be nothing but a 'Points' with position(s) (precision or definition) defined by program. But this doesn't exist in standard VPython. So the use of equations was quite natural. But in our case we had a linear equation for the plan and a quadratic equation for the cone. So the generic point is defined by 2 parameters (which you can choose). And GROK was smart enough to come to this conclusion and propose the corresponding code. Of course there is something wrong because it doesn't work. But it's my duty now to find out why, unless I become enough prompt expert to ask GROK to correct its own mistake. That would be a challenge.
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/d74c4041-acbe-4d46-a1ce-37f673e4ffb1n%40googlegroups.com.
Perfect ! I had a version of my own correct for general case but not satisfactory for degenerated (special) one.
Here's my code
from vpython import * scene.width = 500 scene.height = 500 scene.title = """Coniques - Intro Intersection d'un plan avec un cône Dans notre exemple l'angle du cône est de 45° """ C1 = cone(pos=vec(0, -7, 0), axis=vec(0, 7, 0), color=color.cyan, opacity=0.5, radius=7) C2 = cone(pos=vec(0, 7, 0), axis=vec(0, -7, 0), color=color.cyan, opacity=0.5, radius=7
) P = box(pos=vec(-2, 0, 0), length=15, height=0.02, width=15, color=color.red, opacity=0.5, axis=vec(0, 1, 0)) V1=P.axis V2=P.up V3=cross(V1,V2) scene.caption = """Pour faire tourner la caméra : drag avec bouton droit ou bien Ctrl-drag.
Pour zoomer utiliser la roulette. Pour panorama droite/gauche et haut/bas : Maj-drag. Ci-dessous réglez l'inclinaison du plan par rapport à l'axe du cone\n """ oldangle = 0 angle=0 case = 'G' curve_points = [] def update_intersection
():
global V1,V2,V3,P,curve_points
for pt in curve_points: pt.visible = False
curve_points.clear() V1 = P.axis V2 = P.up V3 = cross(V1, V2) L=[P.pos+(h/100)*V1+(k/100)*V3 for h in range(-50,51) for k in range(-50,51)] I=[] for V in L: if abs(V.x*V.x+V.z*V.z-V.y*V.y)<0.2: I.append(V) for V in I: pt=sphere(pos=V,radius=0.05, color=color.yellow) curve_points.append(pt)
update_intersection() sl = slider(min=0, max=180, value=0, length=360, bind=setincli, step=5) wt = wtext(text=str(sl.value) + '°') scene.append_to_caption('\n') inter = wtext(text='Hyperbole') scene.append_to_caption('\n\ncas')
update_intersection() r1 = radio(bind=setcas, checked=True, text='Général', name='cas') r2 = radio(bind=setcas, text='Particulier', name='cas') update_intersection() while True: rate(30)
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/f96ae99d-cae6-4534-939d-6ace7601ab87n%40googlegroups.com.
Simply perfect !
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/f96ae99d-cae6-4534-939d-6ace7601ab87n%40googlegroups.com.
Yes it would be good. Again the same trick will work (intersection of the normal to the plane passing through the center of the sphere). BTW I have been knowing this trick for ever and I show this method in my geometry course in the explicit example 7 of this page . Simply it's you you remind me to use it with the generatrices of the cone, that was the good idea.
I have a few remarks (positive and negative) about programming
directly in web vpython.
I'm a little busy right now, but I will come back to it.
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/172b0aca-af02-425d-b5a6-4e6c74782351n%40googlegroups.com.