/* La courbe de Lissajous, aussi dénommée figure de Lissajous ou courbe de Bowditch, est la trajectoire d'un point dont les composantes rectangulaires ont un mouvement sinusoïdal. Cette famille de courbes fut étudiée par Nathaniel Bowditch en 1815, puis plus en détail par Jules Lissajous en 1857. x = a sin (p*t) y = b sin (q*t + phi) où phi appartient à [0;pi/(2p)] t décrivant[0;2pi] */ import graph; size(7cm,0); // a=1, b=1, p=1, q=2, phi=0 real x(real t) {return sin(t);} real y(real t) {return sin(2t);} dot((0,0)); draw(graph(x,y,0,pi),red); draw(graph(x,y,pi,2pi),blue); |
/* La courbe de Lissajous, aussi dénommée figure de Lissajous ou courbe de Bowditch, est la trajectoire d'un point dont les composantes rectangulaires ont un mouvement sinusoïdal. Cette famille de courbes fut étudiée par Nathaniel Bowditch en 1815, puis plus en détail par Jules Lissajous en 1857. x = a sin (p*t) y = b sin (q*t + phi) où phi appartient à [0;pi/(2p)] t décrivant[0;2pi] */ import graph; size(7cm,0); // a=1, b=1, p=2, q=3, phi=0 real x(real t) {return sin(2*t);} real y(real t) {return sin(3*t);} dot((0,0)); draw(graph(x,y,0,pi),red); draw(graph(x,y,pi,2pi),blue); |
/* La courbe de Lissajous, aussi dénommée figure de Lissajous ou courbe de Bowditch, est la trajectoire d'un point dont les composantes rectangulaires ont un mouvement sinusoïdal. Cette famille de courbes fut étudiée par Nathaniel Bowditch en 1815, puis plus en détail par Jules Lissajous en 1857. x = a sin (p*t) y = b sin (q*t + phi) où phi appartient à [0;pi/(2p)] t décrivant[0;2pi] */ import graph; size(7cm,0); // a=1, b=1, p=5, q=6, phi=0 real x(real t) {return sin(5*t);} real y(real t) {return sin(6*t);} dot((0,0)); draw(graph(x,y,0,pi,800),red); draw(graph(x,y,pi,2pi,800),blue); |
/* Une astroïde est une courbe plane, qui peut se définir de plusieurs façons. En particulier, il est possible de l'obtenir en faisant rouler un cercle de rayon 1/4 à l'intérieur d'un cercle de rayon 1. Pour cette raison, l'astroïde est une hypocycloïde de cercle à quatre points de rebroussement. Elle a pour équations paramétriques x = (cos t)^3 y = (sin t)^3. Elle a pour équation cartésienne (x²+y²-1)^3+27x²y²=0. */ import graph; size(7cm,0); real x(real t) {return (cos(t))^3;} real y(real t) {return (sin(t))^3;} dot((0,0)); draw(graph(x,y,0,pi),red); draw(graph(x,y,pi,2pi),blue); |
/* Une deltoïde est une courbe plane, qui peut se définir de plusieurs façons. En particulier, il est possible de l'obtenir en faisant rouler un cercle de rayon a à l'intérieur d'un cercle de rayon 3a. Pour cette raison, l'astroïde est une hypocycloïde de cercle à trois points de rebroussement. Elle a pour équations paramétriques x = 2a cos(t) + a cos(2t) y = 2a sin(t) - a sin(2t). Elle a pour équation cartésienne (x²+y²)^2+18(x²+y²)=8x^3-24y²x+27. */ import graph; size(7cm,0); // pour a = 1 : real x(real t) {return 2*cos(t)+cos(2*t);} real y(real t) {return 2*sin(t)-sin(2*t);} dot((0,0)); draw(graph(x,y,0,pi),red); draw(graph(x,y,pi,2pi),blue); |
/* Une cardioïde */ import graph; size(7cm,0); real f(real t) {return 1+cos(t);} path g=polargraph(f,0,2pi,operator ..)--cycle; filldraw(g,lightblue+white); xaxis("$x$"); yaxis("$y$"); draw((0,0)--(1,0),.8bp+blue,Arrow()); draw((0,0)--(0,1),.8bp+blue,Arrow()); dot("$(2,0)$",(2,0),N+E); |
/* Une cardioïde */ import graph; size(7cm,0); real f(real t) {return 1+cos(t);} path g=polargraph(f,0,2pi,operator ..)--cycle; draw(g,lightblue+white); xaxis("$x$"); yaxis("$y$"); draw((0,0)--(1,0),.8bp+blue,Arrow()); draw((0,0)--(0,1),.8bp+blue,Arrow()); dot("$(2,0)$",(2,0),N+E); |
import geometry; import graph; unitsize(1cm); // On définit les pointillés. pen p=linetype("0 4.94739",offset=0,scale=false,adjust=false); // Le format("0 %f",pi/18*cm) initial a été remplacé par "0 4.94739" // pour un problème de virgule à la place du point. // On définit la fonction polaire real f(real t) {return 2*cos(t)-1;} // et sa courbe représentative. path g=polargraph(f,0,2pi,operator ..)--cycle; // puis on trace axes, et cercles en pointillés int nb=4; for(int j=0; j<12; ++j) draw((0,0)--nb*dir(j*30),palered); for(int k=1; k<=nb; ++k) draw(circle((0,0),k),p); // et enfin la courbe. draw(g,1bp+blue); // "Découpe" de l'image clip(square((-.9nb,-.9nb),(.9nb,-.9nb))); |
/* polargraph guide polargraph(picture pic=currentpicture, real f(real), real a, real b, int n=ngraph, interpolate join=operator --); Returns a polar-coordinate graph using the scaling information for picture pic of the function f on the interval [a,b], sampling at n evenly spaced points, with the given interpolation type. */ import graph; size(7cm,0); real f(real t) {return sqrt(2)/2-cos(3t);} path g1=polargraph(f,0,2pi,n=720,operator ..)--cycle; path g2=polargraph(f,0,2pi,n=13,operator --)--cycle; draw(g1,1bp+red); draw(g2,dotted+blue); xaxis("$x$"); yaxis("$y$"); draw((0,0)--(1,0),.8bp+blue,Arrow()); draw((0,0)--(0,1),.8bp+blue,Arrow()); shipout(bbox(2mm,Fill(white))); |
/* polargraph guide polargraph(picture pic=currentpicture, real[] r, real[] theta, interpolate join=operator--); Returns a polar-coordinate graph using the scaling information for picture pic of the elements of the arrays (r,theta), using the given interpolation type. */ import graph; size(7cm,0); real[] rayonspolaires={2, 3, 2, 3, 2, 3, 2, 3, 2}, anglespolaires={0,30,60,90,120,150,180,210,240}; anglespolaires *= pi/180; path g=polargraph(rayonspolaires,anglespolaires,operator ..); draw(g,1bp+red); xaxis("$x$"); yaxis("$y$"); draw((0,0)--(1,0),.8bp+blue,Arrow()); draw((0,0)--(0,1),.8bp+blue,Arrow()); shipout(bbox(2mm,Fill(white))); |
/* Une rosace */ import graph; size(7.5cm,0); real a=2, exc=1.2, n=9/2; real f(real t) {return a*(1+exc*cos(n*t));} path g=polargraph(f,0,4pi,800,operator ..)--cycle; filldraw(g,lightblue+white); |
/* Une rosace */ import graph; size(7.5cm,0); real a=2, exc=1.2, n=9/4; real f(real t) {return a*(1+exc*cos(n*t));} path g=polargraph(f,0,8pi,800,operator ..)--cycle; filldraw(g,lightblue+white); |
/* Une rosace */ import graph; size(7.5cm,0); real a=2, exc=.8, n=9/4; real f(real t) {return a*(1+exc*cos(n*t));} path g=polargraph(f,0,8pi,800,operator ..)--cycle; filldraw(g,lightgreen+white); |
Dernière modification le Fri Oct 28 12:58:03 CEST 2011 par G.Marris Valide XHTML