Représentation de données en 3 dimensions

N'oubliez pas de consulter les sujets avant de poser votre question, merci.

Représentation de données en 3 dimensions

Messagepar Alphonse Capriani » 22 Juil 2009 11:07

Salut tout le monde!!!

J'ai un petit souci por représenter des données en 3 dimensions, alors si quelqu'un pouvait me venir en aide, ca m'arrangerait beaucoup!!!

En fait, je possède une liste Z de données chacune associée à deux coordonnées x et y. Le tout forme donc un surface, mais je ne sais pas réellement comment faire pour pouvoir la dessiner sous TeXgraph et l'exporter après sous povRay.

Les coordonnées (x, y) forment une grille régulière (ca simplifie les choses. En fait, ce dont j'ai besoin, c'est d'une macro ressemblant à la fonction GetSurface, sauf qu'elle prendrait en paramètre les objets suivants :
  • une liste d'abscisses X à p éléments
  • une liste d'ordonnées Y à q éléments
  • une liste de valeurs Z pour chaque coordonnées (x, y) : liste à p*q éléments

J'ai créer ma propre fonction, mais ca marche pas comme je le voudrais!!! Ya moyen de faire ça simplement?

Voici un exemple de surface dont je parle.
Code: Tout sélectionner
[
$Z:=ReadData("Donnees", "#"),
$x:=Seq(Seq(x, x, -1, 1, 0.05), y, -1, 1, 0.05),
$y:=Seq(Seq(y, x, -1, 1, 0.05), y, -1, 1, 0.05),
$z:=10*Map([Re(x), Im(x)], x, Z),
$Pt:=Map(M(x[k], y[k], z[k]), k, Seq($a, a, 1, Nops(x))),
Point(Proj3D(Pt))
]

Image
Et voici le fichier "Donnees" utilisé dans mon code :
Code: Tout sélectionner
0.001466365#0.002872811#0.004164347#0.005295409#0.006233521
0.006961798#0.007480075#0.007804563#0.007966057#0.00800687
0.007976754#0.00792818#0.0079114#0.007969724#0.008135436
0.008426717#0.008845848#0.009378845#0.009996577#0.01065725
0.01131004#0.01189958#0.01237085#0.01267410#0.01276928
0.01262972#0.01224455#0.01161984#0.01077818#0.009756907
0.008604935#0.007378689#0.00613733#0.00493778#0.003829963
0.002852685#0.002030520#0.001371975#0.0008690938#0.0004985368
0.0002240351#0.002854157#0.005589203#0.008095857#0.01028363
0.01208814#0.01347608#0.01444747#0.01503500#0.01530043
0.01532845#0.01521859#0.01507577#0.01500049#0.01507935
0.01537694#0.01592971#0.01674237#0.01778715#0.01900607
0.02031583#0.02161513#0.02279355#0.02374134#0.02435923
0.02456729#0.02431220#0.02357218#0.02235916#0.02071802
0.01872300#0.01647144#0.01407560#0.01165320#0.00931747
0.007167659#0.00528083#0.003705645#0.002458708#0.001523780
0.000853933#0.0003764443#0.004091494#0.008006103#0.01158162
0.01468387#0.01721765#0.01913412#0.02043421#0.02116754
0.02142712#0.02134018#0.02105602#0.02073198#0.02051870
0.02054603#0.02091095#0.02166830#0.02282549#0.02434139
0.02612966#0.02806612#0.02999962#0.03176536#0.03319944
0.03415354#0.03450815#0.03418342#0.0331465#0.03141483
0.02905500#0.02617731#0.02292653#0.01946967#0.01598179
0.01263123#0.009565411#0.006898574#0.004702535#0.003001214
0.00176947#0.0009363197#0.0003922552#0.005119287#0.01000595
0.01444679#0.01826575#0.02133831#0.02360139#0.02505776
0.02577463#0.02587662#0.02553362#0.02494467#0.02431937
0.02385835#0.02373464#0.02407756#0.02496056#0.02639411
0.02832431#0.03063719#0.0331686#0.03571852#0.03806868
0.04000195#0.04132165#0.04186917#0.0415383#0.04028498
0.03813164#0.03516570#0.03153235#0.02742238#0.02305590
0.01866364#0.01446728#0.01066076#0.007393971#0.004760568
0.002790689#0.001449445#0.000641188#0.0002192094#0.005896203
0.01150659#0.01656939#0.02086887#0.02425312#0.02664631
0.02805418#0.02856226#0.02832715#0.02756143#0.02651372
0.02544559#0.02460735#0.02421496#0.02443004#0.02534481
0.02697326#0.02924939#0.03203261#0.03511991#0.03826366
0.04119343#0.04363997#0.04535924#0.04615417#0.04589247
0.0445187#0.04205965#0.0386225#0.03438588#0.02958478
0.02449037#0.01938686#0.01454711#0.01020948#0.006557651
0.003705455#0.001687956#0.0004595384#-0.0001007802#-0.0001773091
0.006402063#0.01246804#0.01789040#0.02241622#0.02586835
0.0281599#0.02930075#0.02939548#0.02863288#0.02726814
0.02559906#0.02393866#0.02258641#0.02180078#0.02177549
0.02262164#0.02435719#0.02690486#0.03009856#0.03369782
0.03740892#0.04091080#0.04388362#0.04603713#0.04713669
0.04702431#0.04563305#0.04299337#0.03923098#0.03455627
0.02924629#0.02362091#0.01801527#0.01275091#0.008108163
0.004302343#0.001465677#-0.0003632788#-0.001241870#-0.00131702
-0.0008109193#0.006639355#0.01289554#0.01841827#0.02292013
0.02620097#0.02816457#0.02882610#0.02830971#0.02683648
0.02470379#0.02225798#0.01986266#0.01786564#0.01656723
0.01619288#0.01687254#0.01862855#0.02137322#0.02491624
0.02898125#0.03323022#0.03729336#0.0408019#0.04342092
0.04487925#0.04499375#0.04368591#0.0409892#0.03704655
0.03209821#0.02646098#0.02050079#0.01460093#0.009128795
0.004404127#0.00067154#-0.001920240#-0.003330568#-0.003629428
-0.002990122#-0.001672759#0.006632752#0.01283855#0.01822746
0.02248032#0.02537623#0.02681125#0.02680682#0.02550701
0.02316491#0.02011938#0.01676420#0.01351240#0.01075891
0.008844906#0.008026903#0.00845352#0.01015183#0.01302462
0.01685866#0.02134352#0.02609888#0.03070828#0.03475609
0.03786443#0.03972692#0.040136#0.03900165#0.03635968
0.0323689#0.02729745#0.02149947#0.01538411#0.009379855
0.003897029#-0.000707946#-0.004163494#-0.00630625#-0.007094764
-0.006612362#-0.005058875#-0.002732009#0.006426665#0.01238588
0.01745116#0.02127428#0.02361568#0.02436515#0.02355112
0.02133756#0.01800893#0.01394441#0.00958371#0.005387609
0.001796561#-0.0008087954#-0.002141811#-0.002035603#-0.0004581553
0.002484607#0.006558037#0.01141946#0.01664853#0.0217845
0.02636713#0.02997763#0.03227593#0.03303097#0.03214143
0.0296449#0.02571477#0.02064509#0.01482477#0.00870335
0.002751452#-0.002580650#-0.006902582#-0.009918094#-0.01145089
-0.0114598#-0.01004187#-0.007423212#-0.003938372#0.006081047
0.01165735#0.01626882#0.01954068#0.02121663#0.02118134
0.01947060#0.01626790#0.01188796#0.006748603#0.001333479
-0.003851075#-0.008321162#-0.01165845#-0.01354746#-0.01380371
-0.01239019#-0.009420732#-0.005149974#4.92298e-05#0.005718894
0.01135658#0.01646001#0.02057175#0.02331983#0.02445085
0.02385255#0.02156387#0.01777151#0.01279350#0.007051013
0.001031069#-0.004756614#-0.009824766#-0.01375171#-0.01621867
-0.01703793#-0.01616933#-0.01372367#-0.009952636#-0.0052263
0.005665837#0.01079266#0.01488953#0.01755745#0.01852496
0.01767248#0.01504312#0.01083904#0.005403619#-0.0008088182
-0.007273264#-0.01344050#-0.01878578#-0.02285528#-0.02530636
-0.02593787#-0.02470794#-0.02173761#-0.01730003#-0.01179611
-0.005718894#0.0003903076#0.005989994#0.01058659#0.01377830
0.01529074#0.01500127#0.01294986#0.009335432#0.00449808
-0.001111228#-0.006970854#-0.01253496#-0.01728217#-0.02076202
-0.02263515#-0.02270365#-0.02092880#-0.01743468#-0.01249737
-0.006520584#0.005254526#0.009938574#0.01353294#0.01561638
0.01590365#0.01427139#0.01076960#0.005617788#-0.0008140545
-0.00803784#-0.01549028#-0.02258248#-0.02875191#-0.03351192
-0.03649472#-0.03748373#-0.03643251#-0.0334687#-0.02888249
-0.02310065#-0.01664853#-0.01010331#-0.004042674#0.001006462
0.004614735#0.006488362#0.006495103#0.004675811#0.001240577
-0.003450211#-0.0089182#-0.01460992#-0.01994633#-0.02437469
-0.02741813#-0.02871844#-0.02806844#-0.02543086#-0.02094223
-0.01490124#-0.007742819#0.004917419#0.009235512#0.01240911
0.01399656#0.01369984#0.01139193#0.007128939#0.001145992
-0.0061629#-0.01427906#-0.02260451#-0.03051441#-0.03741192
-0.04278067#-0.04623008#-0.04752959#-0.04662872#-0.04366119
-0.03893272#-0.03289369#-0.02609888#-0.01915811#-0.01268203
-0.007227864#-0.003250035#-0.001059928#-0.0007984722#-0.002423914
-0.005715891#-0.01029544#-0.01565915#-0.02122443#-0.02638187
-0.03055004#-0.03322782#-0.03403968#-0.03276982#-0.02938212
-0.02402421#-0.01701518#-0.008818162#0.004715204#0.008804677
0.01169944#0.01293899#0.01221332#0.009391606#0.004534934
-0.002108093#-0.01012241#-0.01896239#-0.02799938#-0.03657673
-0.04406726#-0.04992826#-0.05374906#-0.05528682#-0.05448767
-0.05149094#-0.04661645#-0.04033581#-0.03323022#-0.0259388
-0.01910168#-0.01330321#-0.009020127#-0.006579462#-0.006129737
-0.007628171#-0.01084494#-0.01538414#-0.02071957#-0.02624220
-0.031315#-0.03533041#-0.03776516#-0.03822771#-0.03649404
-0.03252855#-0.02648828#-0.01871009#-0.0096818#0.004693384
0.008736975#0.01154002#0.01262459#0.01166932#0.00853924
0.003298976#-0.003791788#-0.01230023#-0.02165775#-0.03120945
-0.04027132#-0.0481901#-0.05440051#-0.05847463#-0.06015931
-0.059398#-0.05633528#-0.05130357#-0.04479327#-0.03740892
-0.02981536#-0.02267860#-0.01660671#-0.01209588#-0.009486645
-0.008933908#-0.01039364#-0.01362729#-0.01822362#-0.02363590
-0.0292313#-0.03434793#-0.0383546#-0.04070789#-0.04100148
-0.03900334#-0.03467753#-0.02818855#-0.01988799#-0.01028453
0.004878081#0.00908464#0.01200915#0.01315767#0.01219801
0.008990555#0.003601938#-0.003699681#-0.01246725#-0.02211344
-0.03196171#-0.04130549#-0.04946993#-0.05587107#-0.0600669
-0.06179593#-0.0609998#-0.05782793#-0.05262383#-0.0458942
-0.03826366#-0.03041914#-0.02304875#-0.01678069#-0.01212763
-0.009441345#-0.008881832#-0.01040353#-0.01375991#-0.01852599
-0.02413679#-0.02993836#-0.03524675#-0.0394097#-0.0418656
-0.04219452#-0.04015658#-0.0357145#-0.02903809#-0.02049045
-0.01059698#0.005273582#0.009856336#0.01312006#0.01455623
0.01382242#0.01077391#0.005477712#-0.001792198#-0.01057817
-0.02027849#-0.0301998#-0.03961782#-0.04784078#-0.05427011
-0.05845286#-0.06012129#-0.05921609#-0.05589116#-0.05049947
-0.04356147#-0.03571852#-0.02767581#-0.02013966#-0.0137548
-0.00904719#-0.006377567#-0.005909682#-0.007596172#-0.01118326
-0.01623390#-0.02216725#-0.02831103#-0.03396209#-0.03844971
-0.04119623#-0.04176927#-0.0399213#-0.03561267#-0.02901630
-0.02050347#-0.01061208#0.005861837#0.01101616#0.01481937
0.01674999#0.01645606#0.01378737#0.008809849#0.001800619
-0.006775681#-0.01630730#-0.0260889#-0.03538343#-0.04348686
-0.04979009#-0.05383244#-0.05534201#-0.05425936#-0.05074238
-0.04515192#-0.03801945#-0.02999962#-0.02181202#-0.01417718
-0.007752555#-0.003074286#-0.0005097096#-0.000225006#-0.002170775
-0.006086843#-0.01152587#-0.01789366#-0.02450255#-0.03063324
-0.03559940#-0.03880947#-0.03982007#-0.03837624#-0.03443508
-0.02817046#-0.01995858#-0.01034559#0.006603974#0.01248666
0.01699162#0.01958633#0.01991022#0.0178075#0.01334163
0.006790442#-0.001377926#-0.01054596#-0.02000107#-0.02899828
-0.03682594#-0.04286845#-0.04666051#-0.04792807#-0.04661233
-0.04287463#-0.03708194#-0.02977396#-0.02161513#-0.01333541
-0.005665476#0.0007282482#0.005302668#0.007686161#0.007711394
0.005429945#0.001107420#-0.004800502#-0.01168895#-0.01885808
-0.0255757#-0.03114291#-0.03495676#-0.03656441#-0.03570401
-0.03232867#-0.02661126#-0.01892980#-0.009834575#0.007443671
0.01415557#0.01946933#0.0228436#0.02391055#0.02250891
0.01869866#0.01275611#0.005149642#-0.003501531#-0.01248209
-0.02104388#-0.02847207#-0.03414846#-0.03760614#-0.03857079
-0.03698486#-0.03301252#-0.02702495#-0.01956728#-0.01131004
-0.002989541#0.004657526#0.01095957#0.01536973#0.01751436
0.01722616#0.0145589#0.009782487#0.003358791#-0.004099596
-0.01188403#-0.01925303#-0.02549845#-0.0300087#-0.03232339
-0.03217460#-0.02951099#-0.02450277#-0.01752691#-0.009134072
0.008312114#0.01588566#0.02204770#0.02625070#0.02812121
0.02749303#0.02442197#0.01918091#0.01223555#0.004203001
-0.004203001#-0.01223555#-0.01918091#-0.02442197#-0.02749303
-0.02812121#-0.02625070#-0.02204770#-0.01588566#-0.008312114
1.211002e-16#0.008312114#0.01588566#0.02204770#0.02625070
0.02812121#0.02749303#0.02442197#0.01918091#0.01223555
0.004203001#-0.004203001#-0.01223555#-0.01918091#-0.02442197
-0.02749303#-0.02812121#-0.02625070#-0.02204770#-0.01588566
-0.008312114#0.009134072#0.01752691#0.02450277#0.02951099
0.03217460#0.03232339#0.0300087#0.02549845#0.01925303
0.01188403#0.004099596#-0.003358791#-0.009782487#-0.0145589
-0.01722616#-0.01751436#-0.01536973#-0.01095957#-0.004657526
0.002989541#0.01131004#0.01956728#0.02702495#0.03301252
0.03698486#0.03857079#0.03760614#0.03414846#0.02847207
0.02104388#0.01248209#0.003501531#-0.005149642#-0.01275611
-0.01869866#-0.02250891#-0.02391055#-0.0228436#-0.01946933
-0.01415557#-0.007443671#0.009834575#0.01892980#0.02661126
0.03232867#0.03570401#0.03656441#0.03495676#0.03114291
0.0255757#0.01885808#0.01168895#0.004800502#-0.001107420
-0.005429945#-0.007711394#-0.007686161#-0.005302668#-0.0007282482
0.005665476#0.01333541#0.02161513#0.02977396#0.03708194
0.04287463#0.04661233#0.04792807#0.04666051#0.04286845
0.03682594#0.02899828#0.02000107#0.01054596#0.001377926
-0.006790442#-0.01334163#-0.0178075#-0.01991022#-0.01958633
-0.01699162#-0.01248666#-0.006603974#0.01034559#0.01995858
0.02817046#0.03443508#0.03837624#0.03982007#0.03880947
0.03559940#0.03063324#0.02450255#0.01789366#0.01152587
0.006086843#0.002170775#0.000225006#0.0005097096#0.003074286
0.007752555#0.01417718#0.02181202#0.02999962#0.03801945
0.04515192#0.05074238#0.05425936#0.05534201#0.05383244
0.04979009#0.04348686#0.03538343#0.0260889#0.01630730
0.006775681#-0.001800619#-0.008809849#-0.01378737#-0.01645606
-0.01674999#-0.01481937#-0.01101616#-0.005861837#0.01061208
0.02050347#0.02901630#0.03561267#0.0399213#0.04176927
0.04119623#0.03844971#0.03396209#0.02831103#0.02216725
0.01623390#0.01118326#0.007596172#0.005909682#0.006377567
0.00904719#0.0137548#0.02013966#0.02767581#0.03571852
0.04356147#0.05049947#0.05589116#0.05921609#0.06012129
0.05845286#0.05427011#0.04784078#0.03961782#0.0301998
0.02027849#0.01057817#0.001792198#-0.005477712#-0.01077391
-0.01382242#-0.01455623#-0.01312006#-0.009856336#-0.005273582
0.01059698#0.02049045#0.02903809#0.0357145#0.04015658
0.04219452#0.0418656#0.0394097#0.03524675#0.02993836
0.02413679#0.01852599#0.01375991#0.01040353#0.008881832
0.009441345#0.01212763#0.01678069#0.02304875#0.03041914
0.03826366#0.0458942#0.05262383#0.05782793#0.0609998
0.06179593#0.0600669#0.05587107#0.04946993#0.04130549
0.03196171#0.02211344#0.01246725#0.003699681#-0.003601938
-0.008990555#-0.01219801#-0.01315767#-0.01200915#-0.00908464
-0.004878081#0.01028453#0.01988799#0.02818855#0.03467753
0.03900334#0.04100148#0.04070789#0.0383546#0.03434793
0.0292313#0.02363590#0.01822362#0.01362729#0.01039364
0.008933908#0.009486645#0.01209588#0.01660671#0.02267860
0.02981536#0.03740892#0.04479327#0.05130357#0.05633528
0.059398#0.06015931#0.05847463#0.05440051#0.0481901
0.04027132#0.03120945#0.02165775#0.01230023#0.003791788
-0.003298976#-0.00853924#-0.01166932#-0.01262459#-0.01154002
-0.008736975#-0.004693384#0.0096818#0.01871009#0.02648828
0.03252855#0.03649404#0.03822771#0.03776516#0.03533041
0.031315#0.02624220#0.02071957#0.01538414#0.01084494
0.007628171#0.006129737#0.006579462#0.009020127#0.01330321
0.01910168#0.0259388#0.03323022#0.04033581#0.04661645
0.05149094#0.05448767#0.05528682#0.05374906#0.04992826
0.04406726#0.03657673#0.02799938#0.01896239#0.01012241
0.002108093#-0.004534934#-0.009391606#-0.01221332#-0.01293899
-0.01169944#-0.008804677#-0.004715204#0.008818162#0.01701518
0.02402421#0.02938212#0.03276982#0.03403968#0.03322782
0.03055004#0.02638187#0.02122443#0.01565915#0.01029544
0.005715891#0.002423914#0.0007984722#0.001059928#0.003250035
0.007227864#0.01268203#0.01915811#0.02609888#0.03289369
0.03893272#0.04366119#0.04662872#0.04752959#0.04623008
0.04278067#0.03741192#0.03051441#0.02260451#0.01427906
0.0061629#-0.001145992#-0.007128939#-0.01139193#-0.01369984
-0.01399656#-0.01240911#-0.009235512#-0.004917419#0.007742819
0.01490124#0.02094223#0.02543086#0.02806844#0.02871844
0.02741813#0.02437469#0.01994633#0.01460992#0.0089182
0.003450211#-0.001240577#-0.004675811#-0.006495103#-0.006488362
-0.004614735#-0.001006462#0.004042674#0.01010331#0.01664853
0.02310065#0.02888249#0.0334687#0.03643251#0.03748373
0.03649472#0.03351192#0.02875191#0.02258248#0.01549028
0.00803784#0.0008140545#-0.005617788#-0.01076960#-0.01427139
-0.01590365#-0.01561638#-0.01353294#-0.009938574#-0.005254526
0.006520584#0.01249737#0.01743468#0.02092880#0.02270365
0.02263515#0.02076202#0.01728217#0.01253496#0.006970854
0.001111228#-0.00449808#-0.009335432#-0.01294986#-0.01500127
-0.01529074#-0.01377830#-0.01058659#-0.005989994#-0.0003903076
0.005718894#0.01179611#0.01730003#0.02173761#0.02470794
0.02593787#0.02530636#0.02285528#0.01878578#0.01344050
0.007273264#0.0008088182#-0.005403619#-0.01083904#-0.01504312
-0.01767248#-0.01852496#-0.01755745#-0.01488953#-0.01079266
-0.005665837#0.0052263#0.009952636#0.01372367#0.01616933
0.01703793#0.01621867#0.01375171#0.009824766#0.004756614
-0.001031069#-0.007051013#-0.01279350#-0.01777151#-0.02156387
-0.02385255#-0.02445085#-0.02331983#-0.02057175#-0.01646001
-0.01135658#-0.005718894#-4.92298e-05#0.005149974#0.009420732
0.01239019#0.01380371#0.01354746#0.01165845#0.008321162
0.003851075#-0.001333479#-0.006748603#-0.01188796#-0.01626790
-0.01947060#-0.02118134#-0.02121663#-0.01954068#-0.01626882
-0.01165735#-0.006081047#0.003938372#0.007423212#0.01004187
0.0114598#0.01145089#0.009918094#0.006902582#0.002580650
-0.002751452#-0.00870335#-0.01482477#-0.02064509#-0.02571477
-0.0296449#-0.03214143#-0.03303097#-0.03227593#-0.02997763
-0.02636713#-0.0217845#-0.01664853#-0.01141946#-0.006558037
-0.002484607#0.0004581553#0.002035603#0.002141811#0.0008087954
-0.001796561#-0.005387609#-0.00958371#-0.01394441#-0.01800893
-0.02133756#-0.02355112#-0.02436515#-0.02361568#-0.02127428
-0.01745116#-0.01238588#-0.006426665#0.002732009#0.005058875
0.006612362#0.007094764#0.00630625#0.004163494#0.000707946
-0.003897029#-0.009379855#-0.01538411#-0.02149947#-0.02729745
-0.0323689#-0.03635968#-0.03900165#-0.040136#-0.03972692
-0.03786443#-0.03475609#-0.03070828#-0.02609888#-0.02134352
-0.01685866#-0.01302462#-0.01015183#-0.00845352#-0.008026903
-0.008844906#-0.01075891#-0.01351240#-0.01676420#-0.02011938
-0.02316491#-0.02550701#-0.02680682#-0.02681125#-0.02537623
-0.02248032#-0.01822746#-0.01283855#-0.006632752#0.001672759
0.002990122#0.003629428#0.003330568#0.001920240#-0.00067154
-0.004404127#-0.009128795#-0.01460093#-0.02050079#-0.02646098
-0.03209821#-0.03704655#-0.0409892#-0.04368591#-0.04499375
-0.04487925#-0.04342092#-0.0408019#-0.03729336#-0.03323022
-0.02898125#-0.02491624#-0.02137322#-0.01862855#-0.01687254
-0.01619288#-0.01656723#-0.01786564#-0.01986266#-0.02225798
-0.02470379#-0.02683648#-0.02830971#-0.02882610#-0.02816457
-0.02620097#-0.02292013#-0.01841827#-0.01289554#-0.006639355
0.0008109193#0.00131702#0.001241870#0.0003632788#-0.001465677
-0.004302343#-0.008108163#-0.01275091#-0.01801527#-0.02362091
-0.02924629#-0.03455627#-0.03923098#-0.04299337#-0.04563305
-0.04702431#-0.04713669#-0.04603713#-0.04388362#-0.04091080
-0.03740892#-0.03369782#-0.03009856#-0.02690486#-0.02435719
-0.02262164#-0.02177549#-0.02180078#-0.02258641#-0.02393866
-0.02559906#-0.02726814#-0.02863288#-0.02939548#-0.02930075
-0.0281599#-0.02586835#-0.02241622#-0.01789040#-0.01246804
-0.006402063#0.0001773091#0.0001007802#-0.0004595384#-0.001687956
-0.003705455#-0.006557651#-0.01020948#-0.01454711#-0.01938686
-0.02449037#-0.02958478#-0.03438588#-0.0386225#-0.04205965
-0.0445187#-0.04589247#-0.04615417#-0.04535924#-0.04363997
-0.04119343#-0.03826366#-0.03511991#-0.03203261#-0.02924939
-0.02697326#-0.02534481#-0.02443004#-0.02421496#-0.02460735
-0.02544559#-0.02651372#-0.02756143#-0.02832715#-0.02856226
-0.02805418#-0.02664631#-0.02425312#-0.02086887#-0.01656939
-0.01150659#-0.005896203#-0.0002192094#-0.000641188#-0.001449445
-0.002790689#-0.004760568#-0.007393971#-0.01066076#-0.01446728
-0.01866364#-0.02305590#-0.02742238#-0.03153235#-0.03516570
-0.03813164#-0.04028498#-0.0415383#-0.04186917#-0.04132165
-0.04000195#-0.03806868#-0.03571852#-0.0331686#-0.03063719
-0.02832431#-0.02639411#-0.02496056#-0.02407756#-0.02373464
-0.02385835#-0.02431937#-0.02494467#-0.02553362#-0.02587662
-0.02577463#-0.02505776#-0.02360139#-0.02133831#-0.01826575
-0.01444679#-0.01000595#-0.005119287#-0.0003922552#-0.0009363197
-0.00176947#-0.003001214#-0.004702535#-0.006898574#-0.009565411
-0.01263123#-0.01598179#-0.01946967#-0.02292653#-0.02617731
-0.02905500#-0.03141483#-0.0331465#-0.03418342#-0.03450815
-0.03415354#-0.03319944#-0.03176536#-0.02999962#-0.02806612
-0.02612966#-0.02434139#-0.02282549#-0.02166830#-0.02091095
-0.02054603#-0.02051870#-0.02073198#-0.02105602#-0.02134018
-0.02142712#-0.02116754#-0.02043421#-0.01913412#-0.01721765
-0.01468387#-0.01158162#-0.008006103#-0.004091494#-0.0003764443
-0.000853933#-0.001523780#-0.002458708#-0.003705645#-0.00528083
-0.007167659#-0.00931747#-0.01165320#-0.01407560#-0.01647144
-0.01872300#-0.02071802#-0.02235916#-0.02357218#-0.02431220
-0.02456729#-0.02435923#-0.02374134#-0.02279355#-0.02161513
-0.02031583#-0.01900607#-0.01778715#-0.01674237#-0.01592971
-0.01537694#-0.01507935#-0.01500049#-0.01507577#-0.01521859
-0.01532845#-0.01530043#-0.01503500#-0.01444747#-0.01347608
-0.01208814#-0.01028363#-0.008095857#-0.005589203#-0.002854157
-0.0002240351#-0.0004985368#-0.0008690938#-0.001371975#-0.002030520
-0.002852685#-0.003829963#-0.00493778#-0.00613733#-0.007378689
-0.008604935#-0.009756907#-0.01077818#-0.01161984#-0.01224455
-0.01262972#-0.01276928#-0.01267410#-0.01237085#-0.01189958
-0.01131004#-0.01065725#-0.009996577#-0.009378845#-0.008845848
-0.008426717#-0.008135436#-0.007969724#-0.0079114#-0.00792818
-0.007976754#-0.00800687#-0.007966057#-0.007804563#-0.007480075
-0.006961798#-0.006233521#-0.005295409#-0.004164347#-0.002872811
-0.001466365

Dans un tout autre sujet, je me demandait s'il ne serait pas possible d'ajouter une macro ReadData2(<Fichier>, <Balises>) qui s'utiliserait exactement de la même manière que ReadData, mais renverrait une liste de réels et pas de complexes comme c'est le cas avec ReadData. Une telle fonction permettrait d'éviter l'ajout de commande telle que Map([Re(x), Im(x)], x, Z) dans mon exemple précédent.
Je sais que c'est pas la mort, mais je trouve que ce serait plus simple vu que l'on a pas forcément besoin de charger des données bidimensionnelles.

En y réfléchissant bien, ce qui serait encore mieux, ce serait d'ajouter des macros ReadData1D, ReadData2D (ie le ReadData actuel) et ReadData3D qui permettrait de charger respectivement des listes de réels, des listes de complexes et des listes de points3D. Peut être même qu'il serait possible de mettre ca en option dans la macro ReadData (ReadData(<Fichier>, <Balise>, <Dimension>), avec dimension = 1, 2 ou 3)

T'en penses quoi Patrick?
Ya Ba Da Ba Dooo!!!
Avatar de l’utilisateur
Alphonse Capriani
 
Messages: 576
Inscription: 18 Juil 2009 19:10
Localisation: East Harlem - NY

Re: Représentation de données en 3 dimensions

Messagepar P.Fradin » 22 Juil 2009 21:59

Salut Alphonse,

J'ai enregistré tes données dans le fichier Alphonse.dat (j'ai remplacé les dièses par des espaces), Je te propose ce code:

Code: Tout sélectionner
[
Z:= for z in ReadData1("Alphonse.dat") By 1 do 10*z od,
p:=2/0.05+1,
NewMac("f","-1+(%1-1)*0.05"),
facettes:=for lg from 1 to p-1 do
              for col from 1 to p-1 do
                  pos:=(lg-1)*p+col,
                  M(f(col), f(lg), Z[pos]),
                  M(f(col+1), f(lg), Z[pos+1]),
                  M(f(col+1), f(lg+1), Z[pos+1+p]),
                  M(f(col), f(lg+1), Z[pos+p]),
                  jump
              od
          od,
DrawFacet(facettes, [color:=lightblue])
]     


Image


Je pense que la commande ReadData1 est déjà présente dans le version test 1.94. Cette commande lit le fichier réel par réel et chaque fin de ligne est remplacée par un jump (ce point là peut être sans doute amélioré).
P.Fradin
Avatar de l’utilisateur
P.Fradin
Administrateur du site
 
Messages: 1836
Inscription: 29 Oct 2008 15:04

Re: Représentation de données en 3 dimensions

Messagepar Alphonse Capriani » 23 Juil 2009 10:14

C'est parfait!!

Ca devrait me suffir pour faire ce dont j'ai envie!!! Merci encore...

Concernant la commande ReadData1, je la connaissais pas. Ya un équivalent pour les listes de points 3D?
Ya Ba Da Ba Dooo!!!
Avatar de l’utilisateur
Alphonse Capriani
 
Messages: 576
Inscription: 18 Juil 2009 19:10
Localisation: East Harlem - NY

Re: Représentation de données en 3 dimensions

Messagepar P.Fradin » 23 Juil 2009 10:18

Alphonse Capriani a écrit: Ya un équivalent pour les listes de points 3D?


Pas encore, mais c'est possible bien sûr. Il faudrait mettre bien à plat le mode de lecture souhaitée, l'histoire des balises est intéressante, le coup d'une liste par ligne également dans certains cas (matrices).
P.Fradin
Avatar de l’utilisateur
P.Fradin
Administrateur du site
 
Messages: 1836
Inscription: 29 Oct 2008 15:04

Re: Représentation de données en 3 dimensions

Messagepar Alphonse Capriani » 23 Juil 2009 10:53

Oui!!

J'avais pensé aussi à ca vu que le calcul matriciel fait défaut dans TeXgraph!!
Maintenant, de la à faire des calculs sur des matrices enregistrées dans des fichiers!!!
Ca m'a quand même l'air compliqué cette histoire! :roll:
Ya Ba Da Ba Dooo!!!
Avatar de l’utilisateur
Alphonse Capriani
 
Messages: 576
Inscription: 18 Juil 2009 19:10
Localisation: East Harlem - NY

Re: Représentation de données en 3 dimensions

Messagepar Alphonse Capriani » 24 Juil 2009 15:59

Tiens?

En cherchant les fameuses fonctions d'enveloppes convexes, je suis tombé sur le même sujet que celui ci sur l'ancien forum!!!
J'aurais dû chercher un peu plus avant de demander :roll:

Je poste le fil consacré à ce sujet sur l'ancien forum se trouve ici
Ya Ba Da Ba Dooo!!!
Avatar de l’utilisateur
Alphonse Capriani
 
Messages: 576
Inscription: 18 Juil 2009 19:10
Localisation: East Harlem - NY

Re: Représentation de données en 3 dimensions

Messagepar P.Fradin » 24 Juil 2009 17:01

En fait il y avait deux sujets la-dessus dans l'ancien forum, voici l'autre.
P.Fradin
Avatar de l’utilisateur
P.Fradin
Administrateur du site
 
Messages: 1836
Inscription: 29 Oct 2008 15:04

Re: Représentation de données en 3 dimensions

Messagepar Alphonse Capriani » 24 Juil 2009 17:05

Ah, ben oui!!! :lol:

Il est vraiment temps que je prenne un peu de repos!!!
Ya Ba Da Ba Dooo!!!
Avatar de l’utilisateur
Alphonse Capriani
 
Messages: 576
Inscription: 18 Juil 2009 19:10
Localisation: East Harlem - NY

Re: Représentation de données en 3 dimensions

Messagepar P.Fradin » 24 Juil 2009 19:07

Comme tu me l'as suggéré, j'ai modifié la commande ReadData, comme ceci:

ReadData( <fichier>, [, type_lecture, séparateur de listes] )


Par défaut le type_lecture vaut 2 et peut prendre les valeurs 1, 2 ou 3 selon que l'on lit les données en tant que réels, complexes ou point3D. Le séparateur de listes doit ête une chaîne qui contient le caractère marquant la fin d'une liste, par défaut ce séparateur est vide (ce qui fera une seule liste), on peut utiliser la chaîne "LF" comme séparateur, ce qui répresente la fin de ligne (c'est à dire une liste par ligne de texte). Du coup, plus besoin de la commande ReadData1, elle va donc disparaître.

Ton exemple du message initial peut alors s'écrire:

Code: Tout sélectionner
[Z:=10*ReadData("Alphonse.dat",1),
 p:=2/0.05+1, pos:=0,
sommets:= for z in Z do
              Inc(pos,1), lg:= div(pos-1,p), col:=mod(pos-1,p),
              M( -1+col*0.05, -1+lg*0.05, z)
          od,
facettes:=for lg from 1 to p-1 do
              for col from 1 to p-1 do
                  pos:=(lg-1)*p+col,
                  pos,pos+1,pos+1+p,pos+p,
                  jump
              od
          od,
DrawFacet(MakePoly(sommets, facettes), [color:=lightblue]) ]


Afn de faire un seul parcourt de la liste Z, j'ai utilisé la commande MakePoly.
P.Fradin
Avatar de l’utilisateur
P.Fradin
Administrateur du site
 
Messages: 1836
Inscription: 29 Oct 2008 15:04

Re: Représentation de données en 3 dimensions

Messagepar Alphonse Capriani » 27 Juil 2009 10:44

Parfait!!! :geek:
Ya Ba Da Ba Dooo!!!
Avatar de l’utilisateur
Alphonse Capriani
 
Messages: 576
Inscription: 18 Juil 2009 19:10
Localisation: East Harlem - NY


Revenir vers Questions - Réponses

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 4 invités

cron