This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/OOoGdmath/RepereTrace.xba is in libreoffice-dmaths 3.4+dfsg1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="RepereTrace" script:language="StarBasic">&apos;OOoGdmath
&apos;Copyright (C) 2005-2009  Gilles Daurat

&apos;This program is free software; you can redistribute it and/or
&apos;modify it under the terms of the GNU General Public License
&apos;as published by the Free Software Foundation; either version 2
&apos;of the License, or (at your option) any later version.ReperePoint

&apos;This program is distributed in the hope that it will be useful,
&apos;but WITHOUT ANY WARRANTY; without even the implied warranty of
&apos;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
&apos;GNU General Public License for more details.

&apos;You should have received a copy of the GNU General Public License
&apos;along with this program; if not, write to the Free Software
&apos;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Option Explicit

Private Sub RepereTraceConiques(Shapes)
Dim j, i, TypeConique, a, b, BFoyers, BDirectrices, BAsymptotes, k
Dim uneConique as Object

	oRepereForm.Model.Label20.Label = Chaine(&quot;tracconi&quot;)  &apos;&quot;Tracé des coniques&quot;
    For j = 0 To ListCount(oRepereForm, &quot;ListBox6&quot;) - 1
        i = 1
        ExtraitConique GetList(oRepereForm, &quot;ListBox6&quot;, j), i, TypeConique, a, b
        BFoyers = GetList(oRepereForm, &quot;ComboBox29&quot;, j)
        BDirectrices = GetList(oRepereForm, &quot;ComboBox30&quot;, j)
        BAsymptotes = GetList(oRepereForm, &quot;ComboBox31&quot;, j)
        If i &lt;&gt; -1 Then
            Select Case TypeConique
            Case 0
                uneConique = TraceEllipse(posx, posy, xmin, xmax, ymin, ymax, dx, dy, angleaxe, a, b, BFoyers, BDirectrices, Shapes)
            Case 1
                uneConique = TraceParabole(posx, posy, xmin, xmax, ymin, ymax, dx, dy, angleaxe, a, BFoyers, BDirectrices, Shapes)
            Case 2
                uneConique = TraceHyperbole(posx, posy, xmin, xmax, ymin, ymax, dx, dy, angleaxe, a, b, BFoyers, BDirectrices, BAsymptotes, Shapes)
            End Select
            OAttribut uneConique, GetList(oRepereForm, &quot;ComboBox22&quot;, k), GetList(oRepereForm, &quot;ComboBox23&quot;, k), GetList(oRepereForm, &quot;ComboBox24&quot;, k)
        End If
    Next j
End Sub

Private Sub RepereTraceVecteurs(Shapes as Object)
Dim j, texte$, i, x0, y0, x1, y1
Dim unVecteur as Object

	oRepereForm.Model.Label20.Label = Chaine(&quot;tracvect&quot;) &apos;&quot;Tracé des vecteurs&quot;
    For j = 0 To ListCount(oRepereForm, &quot;ListBox3&quot;) - 1
        texte$ = GetList(oRepereForm, &quot;ListBox3&quot;, j)
        If InStr(1, texte$, &quot;;&quot;) &lt;&gt; 0 Then
            i = 1
            ExtraitVecteur texte$, i, x0, y0, x1, y1
        Else
            i = 1
            ExtraitSegmentPoint texte$, i, x0, y0, x1, y1
        End If
        If i &lt;&gt; -1 Then
            x0 = posx + x0 * dx + y0 * dy * Cos(angleaxe)
            y0 = posy - y0 * dy * Sin(angleaxe)
            x1 = posx + x1 * dx + y1 * dy * Cos(angleaxe)
            y1 = posy - y1 * dy * Sin(angleaxe)
            unVecteur=InsereVecteur(x0, y0, x1, y1, Shapes)
            OAttribut UnVecteur, GetList(oRepereForm, &quot;ComboBox12&quot;, j), GetList(oRepereForm, &quot;ComboBox13&quot;, j), GetList(oRepereForm, &quot;ComboBox14&quot;, j)
        End If
    Next j
    
End Sub

Private Sub RepereTracePoints(Shapes as Object)
Dim j, i, txx, tyy, np$, xx, yy, xxx, yyy, uneMarque as Object
Dim xx1, yy1, xx2, yy2, Pointille1, Pointille2, Coord$, gf, tf

	oRepereForm.Model.Label20.Label = Chaine(&quot;tracpoi&quot;) &apos;&quot;Tracé des points&quot;
    For j = 0 To ListCount(oRepereForm, &quot;ListBox1&quot;) - 1
        i = 1
        txx = &quot;*&quot;
        tyy = &quot;*&quot;
        ExtraitPoint GetList(oRepereForm, &quot;ListBox1&quot;, j), i, np$, xx, yy, txx, tyy
        If i &lt;&gt; -1 Then
            xxx = posx + xx * dx + yy * dy * Cos(angleaxe)
            yyy = posy - yy * dy * Sin(angleaxe)
            Select Case Val(GetList(oRepereForm, &quot;ComboBox38&quot;, j))
            Case 0
                uneMarque=InsereCercle(xxx, yyy, 100, Shapes)
            Case 1
                uneMarque=croix(xxx, yyy, Shapes)
            Case 2
                uneMarque=Plus(xxx, yyy, Shapes)
            Case 3
                uneMarque=InsereQuadrilatere(xxx - 100, yyy - 100, xxx + 100, yyy - 100, xxx + 100, yyy + 100, xxx - 100, yyy + 100, Shapes)
            Case 4
                uneMarque=InsereQuadrilatere(xxx, yyy - 100, xxx + 100, yyy, xxx, yyy + 100, xxx - 100, yyy, Shapes)
            End Select
            OAttribut uneMarque, GetList(oRepereForm, &quot;ComboBox18&quot;, j), GetList(oRepereForm, &quot;ComboBox19&quot;, j), GetList(oRepereForm, &quot;ComboBox20&quot;, j)
            If np$ &lt;&gt; &quot;&quot; Then InsereTexte np$, xxx, yyy, Shapes,0,sgn(xx),-sgn(yy)
&apos; pointilles
            If val(GetList(oRepereForm, &quot;ComboBox35&quot;, j)) Or val(GetList(oRepereForm, &quot;ComboBox36&quot;, j)) Then
                xx1 = posx + 0 * dx + yy * dy * Cos(angleaxe)
                yy1 = posy - yy * dy * Sin(angleaxe)
                xx2 = posx + xx * dx
                yy2 = posy
                If val(GetList(oRepereForm, &quot;ComboBox35&quot;, j)) Then
                    Pointille1 = InsereLigne(xx1, yy1, xxx, yyy,Shapes,oRepereForm.Model.Image5)
                    OAttribut Pointille1, GetList(oRepereForm, &quot;ComboBox18&quot;, j), GetList(oRepereForm, &quot;ComboBox19&quot;, j), &quot;msoLineDash&quot;
                    Pointille2 = InsereLigne(xx2, yy2, xxx, yyy,Shapes,oRepereForm.Model.Image5)
                    OAttribut Pointille2, GetList(oRepereForm, &quot;ComboBox18&quot;, j), GetList(oRepereForm, &quot;ComboBox19&quot;, j), &quot;msoLineDash&quot;
                End If
                If val(GetList(oRepereForm, &quot;ComboBox36&quot;, j)) Then
                    If xx &lt;&gt; Int(xx) Or Not oRepereForm.Model.CheckBox4.State Then
                        Coord$ = Str(xx)
                        SupprimeEspace Coord$
                        gf = oRepereForm.Model.CheckBox25.State And InStr(1, txx, &quot;/&quot;) &lt;&gt; 0
                        tf = oRepereForm.Model.CheckBox26.State And InStr(1, Coord$, &quot;.&quot;) &lt;&gt; 0
                        If gf Then
                            Coord$ = txx
                        Else
                            If tf Then
                                TrouveFraction Coord$
                            Else
                                RemplacePointVirgule Coord$
                            End If
                        End If
                        InsereTexte Coord$, xx2, yy2, Shapes,0,0,sgn(yy)
                        If gf Or tf Then FractionZoneTexte objet(NbObjet - 1)
                    End If
                    If yy &lt;&gt; Int(yy) Or Not oRepereForm.Model.CheckBox4.State Then
                        Coord$ = Str(yy)
                        SupprimeEspace Coord$
                        gf = oRepereForm.Model.CheckBox25.State And InStr(1, tyy, &quot;/&quot;) &lt;&gt; 0
                        tf = oRepereForm.Model.CheckBox26.State And InStr(1, Coord$, &quot;.&quot;) &lt;&gt; 0
                        If gf Then
                            Coord$ = tyy
                        Else
                            If tf Then
                                TrouveFraction Coord$
                            Else
                                RemplacePointVirgule Coord$
                            End If
                        End If
                        InsereTexte Coord$, xx1, yy1, Shapes,0,-sgn(xx),0
                        If gf Or tf Then FractionZoneTexte objet(NbObjet - 1)
                    End If
                End If
            End If
            NbPoint = NbPoint + 1
        End If
    Next j
End Sub

Private Sub RepereTraceNuages(Shapes)
Dim secArray() As Single
Dim ptInflex() as Long
Dim listePoints as New com.sun.star.awt.Point
Dim BezCoo as New com.sun.star.drawing.PolyPolygonBezierCoords
Dim arg() As String
Dim k, uneListe, texte$, i, j, np$, xx, yy, uneMarque as Object, LaCourbe
Dim nbPoint as Integer

	oRepereForm.Model.Label20.Label = Chaine(&quot;tracnuage&quot;) &apos;&quot;Tracé des nuages de points&quot;
    For k = 0 To 4
        uneListe = LesListes(k)
        texte$ = GetList(oRepereForm, &quot;ComboBox41&quot;, k)
        ChargeParametre texte$, arg
        nbPoint = ListCount(oRepereForm, LesListes(k))
        If nbPoint &gt; 0 Then
            ReDim secArray(0 To nbPoint - 1, 0 To 1)
            ReDim ptInflex(0 To nbPoint - 1)
            ReDim listePoints(0 To nbPoint - 1)
            For i = 0 To ListCount(oRepereForm, LesListes(k)) - 1
                texte$ = GetList(oRepereForm, LesListes(k), i)
                j = 1
                ExtraitPoint texte$, j, np$, xx, yy
                secArray(i, 0) = posx + xx * dx + yy * dy * Cos(angleaxe)
                secArray(i, 1) = posy - yy * dy * Sin(angleaxe)
                xx = secArray(i, 0)
                yy = secArray(i, 1)
                listePoints(i).X=xx
                listePoints(i).Y=yy
                ptInflex(i) = com.sun.star.drawing.PolygonFlags.SMOOTH
                Select Case Val(arg(8))
                Case 0
                    uneMarque = InsereCercle(xx, yy, 100, Shapes)
                Case 1
                    uneMarque = croix(xx, yy, Shapes)
                Case 2
                    uneMarque = Plus(xx, yy, Shapes)
                Case 3
                    uneMarque = InsereQuadrilatere(xx - 100, yy - 100, xx + 100, yy - 100, xx + 100, yy + 100, xx - 100, yy + 100, Shapes)
                Case 4
                    uneMarque = InsereQuadrilatere(xx, yy - 100, xx + 100, yy, xx, yy + 100, xx - 100, yy, Shapes)
                End Select
                OAttribut uneMarque, Val(arg(9)), ExtraitEpaisseur(arg(10)), ExtraitTypeTrait(arg(10))
            Next i
            If (arg(3)) Then
            	if (arg(5)) then
            		BezCoo.Coordinates = Array(listePoints())
            		BezCoo.Flags = Array(ptInflex())
            		laCourbe = oDocumentDessin.createInstance(&quot;com.sun.star.drawing.OpenBezierShape&quot;)
            		oPageDessin.add(laCourbe)
            		laCourbe.PolyPolygonBezier = BezCoo
					Shapes.add(laCourbe)
            	else
	                laCourbe = InsereCourbe(secArray(), i, Shapes)
				end if
                OAttribut laCourbe, Val(arg(6)), ExtraitEpaisseur(arg(7)), ExtraitTypeTrait(arg(7))
            End If
        End If
    Next k
End Sub

Private Sub RepereTraceFonctions(Shapes)
    Dim intervalle As String
    Dim triArray(0 To 1002, 0 To 1) As Single
    Dim secArray() As Single
    Dim UnArray(0 To 1002, 0 To 1) As Single
    Dim DeuxArray() As Single
    Dim TroisArray(0 To 1002, 0 To 1) As Single
    Dim QuatreArray() As Single
    Dim x1 As Double
    Dim y1 As Double
    Dim UneCourbe As Object
    Dim MaFonction1 As String, MaFonction2 As String
    Dim k, TraceZone1, TraceZone2, RGBZone1, RGBZone2, MaFonction, TypeFonction
    Dim a, b, c, Defini, tmin, tmax, i,  pas, pasb, ix, UneFonction$
    Dim aDefini, Depassement, aix, bDefini, ancieny1, j, i1, i2, na
    Dim Defini1, Defini2, x2, y2, xint1 as single, yint1 as single, xint2 as single, yint2 as single, xint3 as single, yint3 as single, xint4 as single, yint4 as single
    Dim UneTangente, bDefini1, bDefini2, UneFonction1$, UneFonction2$
    Dim aDefini1, aDefini2, fini, xx1, xx2
    Dim tab() as string
    
	oRepereForm.Model.Label20.Label = Chaine(&quot;tracfonc&quot;) &apos;&quot;Tracé des fonctions&quot;
    For k = 0 To ListCount(oRepereForm, &quot;ListBox5&quot;) - 1
    	ChargeParametre GetList(oRepereForm, &quot;ComboBox45&quot;, k),tab(), &quot;;&quot;	
        TraceZone1 = tab(0)
        RGBZone1 = tab(1)
    	ChargeParametre GetList(oRepereForm, &quot;ComboBox46&quot;, k),tab(), &quot;;&quot;	
        TraceZone2 = tab(0)
        RGBZone2 = tab(1)
        MaFonction = GetList(oRepereForm, &quot;ListBox5&quot;, k)
        TypeFonction = Val(GetList(oRepereForm, &quot;ComboBox42&quot;, k))
        If TypeFonction &gt; 2 Then
            intervalle = GetList(oRepereForm, &quot;ComboBox43&quot;, k)
            a = InStr(1, intervalle, &quot;[&quot;)
            b = InStr(1, intervalle, &quot;]&quot;)
            c = InStr(1, intervalle, &quot;;&quot;)
            tmin = CalculeFonction(Mid(intervalle, a + 1, c - a - 1), Defini)
            tmax = CalculeFonction(Mid(intervalle, c + 1, b - c - 1), Defini)
        End If
        i = 1
        nbcourbe = 0
        Select Case TypeFonction
        Case 1, 2
            If TypeFonction = 2 Then
                Echange xmax, ymax
                Echange xmin, ymin
            End If
            pas = (xmax - xmin) / 100
            pasb = pas
            ix = xmin - pasb
            x1 = Fix(ix * 1000000000) / 1000000000
            If TypeFonction = 2 Then RemplaceY MaFonction, &quot;x&quot;
            UneFonction$ = MaFonction
            RemplaceX UneFonction$, x1
            aDefini = 1
            y1 = CalculeFonction(UneFonction$, aDefini)
            Depassement = False
            If aDefini = 1 Then
                If (y1 &gt; ymax Or y1 &lt; ymin) Then
                    aDefini = 0
                    Depassement = True
                End If
            End If
            aix = ix
            ix = ix + pasb
            Do
                If Sgn(ix) * Sgn(aix) = -1 Then
                    ix = 0
                Else
                    If aDefini &lt;&gt; 0 And SigneDerivee(MaFonction, ix, pasb) * SigneDerivee(MaFonction, aix, pasb) = -1 Then
                        ix = aix
                        ChercheChangementDerivee MaFonction, SigneDerivee(MaFonction, aix, pasb), ix, pasb
                        pasb = pas
                    End If
                End If
                x1 = Fix(ix * 1000000000000#) / 1000000000000#
                aix = ix
                UneFonction$ = MaFonction
                RemplaceX UneFonction$, x1
                Defini = 1
                y1 = CalculeFonction(UneFonction$, Defini)
                Depassement = False
                If Defini = 1 Then
                    If (y1 &gt; ymax Or y1 &lt; ymin) Then
                        Defini = 0
                        Depassement = True
                    End If
                End If
                If aDefini &lt;&gt; Defini Then
                    bDefini = Defini
                    ChercheChangement MaFonction, aDefini, ix - pasb, pasb, x1
                    aix = x1
                    UneFonction$ = MaFonction
                    RemplaceX UneFonction$, x1
                    Defini = 1
                    y1 = CalculeFonction(UneFonction$, Defini)
                    If Defini = 1 Or Depassement Then
                        If TypeFonction = 1 Then
                            triArray(i-1, 0) = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                            triArray(i-1, 1) = posy - y1 * dy * Sin(angleaxe)
                            ancieny1 = y1
                            If Depassement Then
                                If y1 &gt; ymax Then y1 = ymax
                                If y1 &lt; ymin Then y1 = ymin
                            End If
                            UnArray(i-1, 0) = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                            UnArray(i-1, 1) = posy - max(0, y1) * dy * Sin(angleaxe)
                            TroisArray(i-1, 0) = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                            TroisArray(i-1, 1) = posy - Min(0, y1) * dy * Sin(angleaxe)
                            y1 = ancieny1
                        Else
                            triArray(i-1, 0) = posx + y1 * dx + x1 * dy * Cos(angleaxe)
                            triArray(i-1, 1) = posy - x1 * dy * Sin(angleaxe)
                        End If
                        i = i + 1
                    End If
                    Defini = bDefini
                    aDefini = Defini
                    If i &gt; 2 Then
                        pasb = pas
                        ReDim secArray(0 To i - 2, 0 To 1)
                        For j = 1 To i - 1
                            secArray(j-1, 0) = triArray(j-1, 0)
                            secArray(j-1, 1) = triArray(j-1, 1)
                        Next j
                        If TraceZone1 Then
                            ReDim DeuxArray(0 To i, 0 To 1)
                            For j = 1 To i - 1
                                DeuxArray(j-1, 0) = UnArray(j-1, 0)
                                DeuxArray(j-1, 1) = UnArray(j-1, 1)
                            Next j
                            DeuxArray(j-1, 0) = DeuxArray(j - 2, 0)
                            DeuxArray(j-1, 1) = posy
                            DeuxArray(j, 0) = DeuxArray(0, 0)
                            DeuxArray(j, 1) = posy
                            UneCourbe = InserePolygoneB(DeuxArray(), j, Shapes)
                            RemplissageForme UneCourbe, RGBZone1, 80
                        End If
                        If TraceZone2 Then
                            ReDim QuatreArray(0 To i, 0 To 1)
                            For j = 1 To i - 1
                                QuatreArray(j-1, 0) = TroisArray(j-1, 0)
                                QuatreArray(j-1, 1) = TroisArray(j-1, 1)
                            Next j
                            QuatreArray(j-1, 0) = QuatreArray(j - 2, 0)
                            QuatreArray(j-1, 1) = posy
                            QuatreArray(j, 0) = QuatreArray(0, 0)
                            QuatreArray(j, 1) = posy
                            UneCourbe = InserePolygoneB(QuatreArray(), j, Shapes)
                            RemplissageForme UneCourbe, RGBZone2, 80
                        End If
                        If Defini = 0 Or Depassement Then
                            UneCourbe = InsereCourbe(secArray(), ubound(secArray()), Shapes)
                            OAttribut UneCourbe, GetList(oRepereForm, &quot;ComboBox2&quot;, k), GetList(oRepereForm, &quot;ComboBox3&quot;, k), GetList(oRepereForm, &quot;ComboBox4&quot;, k)
                            nbcourbe = nbcourbe + 1
                        End If
    &apos;                    For j = 1 To UneCourbe.Nodes.Count
    &apos;                        UneCourbe.Nodes.SetSegmentType j, msoSegmentCurve
    &apos;                    Next j
                    End If
                    i = 1
                    i1 = 1
                    i2 = 1
                End If
                ix = x1
                pasb = pas
                If Defini = 1 Or Depassement Then
                    aDefini = Defini
                    If TypeFonction = 1 Then
                        triArray(i-1, 0) = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                        triArray(i-1, 1) = posy - y1 * dy * Sin(angleaxe)
                        ancieny1 = y1
                        If Depassement Then
                            If y1 &gt; ymax Then y1 = ymax
                            If y1 &lt; ymin Then y1 = ymin
                        End If
                        UnArray(i-1, 0) = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                        UnArray(i-1, 1) = posy - max(0, y1) * dy * Sin(angleaxe)
                        TroisArray(i-1, 0) = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                        TroisArray(i-1, 1) = posy - Min(0, y1) * dy * Sin(angleaxe)
                        y1 = ancieny1
                    Else
                        triArray(i-1, 0) = posx + y1 * dx + x1 * dy * Cos(angleaxe)
                        triArray(i-1, 1) = posy - x1 * dy * Sin(angleaxe)
                    End If
                    i = i + 1
                End If
                ix = ix + pasb
            Loop While ((ix &lt; xmax) And (TypeFonction = 1)) Or ((ix &lt; ymax) And (TypeFonction = 2))
            If i &gt; 2 Then
                ReDim secArray(0 To i - 2, 0 To 1)
                For j = 1 To i - 1
                    secArray(j-1, 0) = triArray(j-1, 0)
                    secArray(j-1, 1) = triArray(j-1, 1)
                Next j
                If TraceZone1 Then
                    ReDim DeuxArray(0 To i, 0 To 1)
                    For j = 1 To i - 1
                        DeuxArray(j-1, 0) = UnArray(j-1, 0)
                        DeuxArray(j-1, 1) = UnArray(j-1, 1)
                    Next j
                    DeuxArray(j-1, 0) = DeuxArray(j - 2, 0)
                    DeuxArray(j-1, 1) = posy
                    DeuxArray(j, 0) = DeuxArray(0, 0)
                    DeuxArray(j, 1) = posy
                    UneCourbe = InserePolygoneB(DeuxArray(), i+1, Shapes)
                    RemplissageForme UneCourbe, RGBZone1, 80
                End If
                If TraceZone2 Then
                    ReDim QuatreArray(0 To i, 0 To 1)
                    For j = 1 To i - 1
                        QuatreArray(j-1, 0) = TroisArray(j-1, 0)
                        QuatreArray(j-1, 1) = TroisArray(j-1, 1)
                    Next j
                    QuatreArray(j-1, 0) = QuatreArray(j - 2, 0)
                    QuatreArray(j-1, 1) = posy
                    QuatreArray(j, 0) = QuatreArray(0, 0)
                    QuatreArray(j, 1) = posy
                    UneCourbe = InserePolygoneB(QuatreArray(), i+1, Shapes)
                    RemplissageForme UneCourbe, RGBZone2, 80
                End If
                If Not Depassement Then
                    nbcourbe = nbcourbe + 1
                    UneCourbe = InsereCourbe(secArray(), ubound(secArray())+1, Shapes)
                    OAttribut UneCourbe, GetList(oRepereForm, &quot;ComboBox2&quot;, k), GetList(oRepereForm, &quot;ComboBox3&quot;, k), GetList(oRepereForm, &quot;ComboBox4&quot;, k)
                End If
    &apos;            For j = 1 To UneCourbe.Nodes.Count
    &apos;                UneCourbe.Nodes.SetSegmentType j, msoSegmentCurve
    &apos;            Next j
                i = 1
            End If
            Dim tababscisse() As String
            If TypeFonction = 1 And oRepereForm.Model.CheckBox29.State Then
                na = ExtraitAbscisse(oRepereForm.Model.TextBox33.Text, tababscisse)
                For i = 1 To na
                    UneFonction$ = MaFonction
                    RemplaceX UneFonction$, &quot;(&quot; &amp; tababscisse(i) &amp; &quot;)&quot;
                    Defini1 = 1
                    Defini2 = 1
                    x1 = CalculeFonction(tababscisse(i), Defini1)
                    y1 = CalculeFonction(UneFonction$, Defini2)
                    
                    If Defini1 = 1 And Defini2 = 1 Then
                    	Dim unangle
                    	Dim oui1 as Boolean
                    	Dim oui2 as Boolean
                    	Dim oui3 as Boolean
                    	Dim oui4 as Boolean
                        a = CalculeDerivee(MaFonction, x1)
                        unangle = Atn(a)
                        x2 = x1 + 10 * Cos(unangle)
                        y2 = y1 + 10 * Sin(unangle)
                        oui1 = TrouveIntersection(xmin, ymax, xmax, ymax, x1, y1, x2, y2, xint1, yint1)
                        oui2 = TrouveIntersection(xmin, ymin, xmax, ymin, x1, y1, x2, y2, xint2, yint2)
                        oui3 = TrouveIntersection(xmin, ymin, xmin, ymax, x1, y1, x2, y2, xint3, yint3)
                        oui4 = TrouveIntersection(xmax, ymin, xmax, ymax, x1, y1, x2, y2, xint4, yint4)

                        x1 = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                        y1 = posy - y1 * dy * Sin(angleaxe)
                        x2 = posx + x2 * dx + y2 * dy * Cos(angleaxe)
                        y2 = posy - y2 * dy * Sin(angleaxe)
                        
                        unangle = -Atn(a) + Pi / 2
                        UneTangente = InsereLigne(x1 + 50 * Cos(unangle), y1 + 50 * Sin(unangle), x1 - 50 * Cos(unangle), y1 - 50 * Sin(unangle), Shapes)
                        IOAttribut UneTangente, oRepereForm.Model.Image23
                        
                        x1 = xmax + 1
                        If oui1 And xint1 &gt;= xmin And xint1 &lt;= xmax And yint1 &gt;= ymin And yint1 &lt;= ymax Then
                            If x1 = xmax + 1 Then
                                x1 = xint1
                                y1 = yint1
                            Else
                                x2 = xint1
                                y2 = yint1
                            End If
                        End If
                        If oui2 And xint2 &gt;= xmin And xint2 &lt;= xmax And yint2 &gt;= ymin And yint2 &lt;= ymax Then
                            If x1 = xmax + 1 Then
                                x1 = xint2
                                y1 = yint2
                            Else
                                x2 = xint2
                                y2 = yint2
                            End If
                        End If
                        If oui3 And xint3 &gt;= xmin And xint3 &lt;= xmax And yint3 &gt;= ymin And yint3 &lt;= ymax Then
                            If x1 = xmax + 1 Then
                                x1 = xint3
                                y1 = yint3
                            Else
                                x2 = xint3
                                y2 = yint3
                            End If
                        End If
                        If oui4 And xint4 &gt;= xmin And xint4 &lt;= xmax And yint4 &gt;= ymin And yint4 &lt;= ymax Then
                            If x1 = xmax + 1 Then
                                x1 = xint4
                                y1 = yint4
                            Else
                                x2 = xint4
                                y2 = yint4
                            End If
                        End If
                        x1 = posx + x1 * dx + y1 * dy * Cos(angleaxe)
                        y1 = posy - y1 * dy * Sin(angleaxe)
                        x2 = posx + x2 * dx + y2 * dy * Cos(angleaxe)
                        y2 = posy - y2 * dy * Sin(angleaxe)
                        UneTangente = InsereLigne(x1, y1, x2, y2, Shapes)
                        IOAttribut UneTangente, oRepereForm.Model.Image23
                    End If
                Next i
            End If
            If TypeFonction = 2 Then
                Echange xmax, ymax
                Echange xmin, ymin
            End If
        Case 3, 4
            bDefini1 = 1
            bDefini2 = 1
            a = InStr(1, MaFonction, &quot;;&quot;)
            MaFonction1 = Left(MaFonction, a - 1)
            MaFonction2 = Mid(MaFonction, a + 1)
            If TypeFonction = 4 Then
                MaFonction1 = &quot;(&quot; &amp; Left(MaFonction, a - 1) &amp; &quot;)*cos(&quot; &amp; Mid(MaFonction, a + 1) &amp; &quot;)&quot;
                MaFonction2 = &quot;(&quot; &amp; Left(MaFonction, a - 1) &amp; &quot;)*sin(&quot; &amp; Mid(MaFonction, a + 1) &amp; &quot;)&quot;
            End If
            pas = (tmax - tmin) / 100
            pasb = pas
            ix = tmin - pasb
            x1 = Fix(ix * 1000000000) / 1000000000
            RemplaceT MaFonction1, &quot;x&quot;
            RemplaceT MaFonction2, &quot;x&quot;
            UneFonction1$ = MaFonction1
            UneFonction2$ = MaFonction2
            RemplaceX UneFonction1$, x1
            RemplaceX UneFonction2$, x1
            aDefini1 = 1
            aDefini2 = 1
            y1 = CalculeFonction(UneFonction1$, aDefini1)
            y2 = CalculeFonction(UneFonction2$, aDefini2)
            If aDefini1 = 1 And (y1 &gt; xmax Or y1 &lt; xmin) Then aDefini1 = 0
            If aDefini2 = 1 And (y2 &gt; ymax Or y2 &lt; ymin) Then aDefini2 = 0
            aix = ix
            ix = ix + pasb
            fini = 0
            Do
                If Sgn(ix) * Sgn(aix) = -1 Then
                    ix = 0
                Else
                    If aDefini1 &lt;&gt; 0 And SigneDerivee(MaFonction1, ix, pasb) * SigneDerivee(MaFonction1, aix, pasb) = -1 Then
                        ix = aix
                        ChercheChangementDerivee MaFonction1, SigneDerivee(MaFonction1, aix, pasb), ix, pasb
                        pasb = pas
                    End If
                    If aDefini2 &lt;&gt; 0 And SigneDerivee(MaFonction2, ix, pasb) * SigneDerivee(MaFonction2, aix, pasb) = -1 Then
                        ix = aix
                        ChercheChangementDerivee MaFonction2, SigneDerivee(MaFonction2, aix, pasb), ix, pasb
                        pasb = pas
                    End If
                End If
                x1 = Fix(ix * 1000000000000#) / 1000000000000#
                aix = ix
                UneFonction1$ = MaFonction1
                UneFonction2$ = MaFonction2
                RemplaceX UneFonction1$, x1
                RemplaceX UneFonction2$, x1
                Defini1 = 1
                Defini2 = 1
                y1 = CalculeFonction(UneFonction1$, Defini1)
                y2 = CalculeFonction(UneFonction2$, Defini2)
                If Defini1 = 1 And (y1 &gt; xmax Or y1 &lt; xmin) Then Defini1 = 0
                If Defini2 = 1 And (y2 &gt; ymax Or y2 &lt; ymin) Then Defini2 = 0
                If aDefini1 &lt;&gt; Defini1 Or aDefini2 &lt;&gt; Defini2 Then
                    If aDefini1 &lt;&gt; Defini1 Then
                        bDefini1 = Defini1
                        ChercheChangement MaFonction1, aDefini1, ix - pasb, pasb, xx1, True
                        x1 = xx1
                    End If
                    If aDefini2 &lt;&gt; Defini2 Then
                        bDefini2 = Defini2
                        ChercheChangement MaFonction2, aDefini2, ix - pasb, pasb, xx2
                        If xx2 &gt; x1 Then x1 = xx2
                    End If
                    aix = x1
                    UneFonction1$ = MaFonction1
                    UneFonction2$ = MaFonction2
                    RemplaceX UneFonction1$, x1
                    RemplaceX UneFonction2$, x1
                    Defini1 = 1
                    Defini2 = 1
                    y1 = CalculeFonction(UneFonction1$, Defini1)
                    y2 = CalculeFonction(UneFonction2$, Defini1)
                    If Defini1 = 1 And Defini2 = 1 Then
                        triArray(i-1, 0) = posx + y1 * dx + y2 * dy * Cos(angleaxe)
                        triArray(i-1, 1) = posy - y2 * dy * Sin(angleaxe)
                        i = i + 1
                    End If
                    Defini1 = bDefini1
                    Defini2 = bDefini2
                    aDefini1 = Defini1
                    aDefini2 = Defini2
                    If i &gt; 2 Then
                        pasb = pas
                        nbcourbe = nbcourbe + 1
                        ReDim secArray(0 To i - 2, 0 To 1)
                        For j = 1 To i - 1
                            secArray(j-1, 0) = triArray(j-1, 0)
                            secArray(j-1, 1) = triArray(j-1, 1)
                        Next j
                        UneCourbe = InsereCourbe(secArray(), i-1, Shapes)
                        OAttribut UneCourbe, GetList(oRepereForm, &quot;ComboBox2&quot;, k), GetList(oRepereForm, &quot;ComboBox3&quot;, k), GetList(oRepereForm, &quot;ComboBox4&quot;, k)
    &apos;                    For j = 1 To UneCourbe.Nodes.Count
    &apos;                        UneCourbe.Nodes.SetSegmentType j, msoSegmentCurve
    &apos;                    Next j
                    End If
                    i = 1
                End If
                ix = x1
                pasb = pas
                If Defini1 = 1 And Defini2 = 1 Then
                    aDefini1 = 1
                    aDefini2 = 1
                    triArray(i-1, 0) = posx + y1 * dx + y2 * dy * Cos(angleaxe)
                    triArray(i-1, 1) = posy - y2 * dy * Sin(angleaxe)
                    i = i + 1
                End If
                ix = ix + pasb
                If ix &gt;= tmax And fini = 0 Then
                    ix = tmax
                    fini = 1
                End If
            Loop While (ix &lt;= tmax)
            If i &gt; 2 Then
                nbcourbe = nbcourbe + 1
                ReDim secArray(0 To i - 2, 0 To 1)
                For j = 1 To i - 1
                    secArray(j-1, 0) = triArray(j-1, 0)
                    secArray(j-1, 1) = triArray(j-1, 1)
                Next j
                UneCourbe = InsereCourbe(secArray(), i-1, Shapes)
                OAttribut UneCourbe, GetList(oRepereForm, &quot;ComboBox2&quot;, k), GetList(oRepereForm, &quot;ComboBox3&quot;, k), GetList(oRepereForm, &quot;ComboBox4&quot;, k)
    &apos;            For j = 1 To UneCourbe.Nodes.Count
    &apos;                UneCourbe.Nodes.SetSegmentType j, msoSegmentCurve
    &apos;            Next j
                i = 1
            End If
        End Select
    Next k
End Sub

Private Function ExtraitAbscisse(texte, tababscisse) As Integer
Dim i, a, j, b
    If Right(texte, 1) &lt;&gt; &quot;;&quot; Then texte = texte &amp; &quot;;&quot;
    i = NombreTexte(1, texte, &quot;;&quot;)
    ReDim tababscisse(1 To i)
    a = 1
    For j = 1 To i
        b = InStr(a, texte, &quot;;&quot;)
        tababscisse(j) = Mid(texte, a, b - a)
        a = b + 1
    Next j
    ExtraitAbscisse = i
End Function

Private Sub RepereTraceSegments(Shapes as Object)
Dim j, i, texte$, x0, y0, x1, y1, xi, yi, anglesegment, unCode$, k, trait1 as Object, trait2 as Object

	oRepereForm.Model.Label20.Label = Chaine (&quot;tracseg&quot;)  &apos;&quot;Tracé des segments&quot;
    For j = 0 To ListCount(oRepereForm, &quot;ListBox2&quot;) - 1
        i = 1
        texte$ = GetList(oRepereForm, &quot;ListBox2&quot;, j)
        If InStr(1, texte$, &quot;;&quot;) &lt;&gt; 0 Then
            ExtraitSegment texte$, i, x0, y0, x1, y1
        Else
            ExtraitSegmentPoint texte$, i, x0, y0, x1, y1
        End If
        If i &lt;&gt; -1 Then
            x0 = posx + x0 * dx + y0 * dy * Cos(angleaxe)
            y0 = posy - y0 * dy * Sin(angleaxe)
            x1 = posx + x1 * dx + y1 * dy * Cos(angleaxe)
            y1 = posy - y1 * dy * Sin(angleaxe)
            trait1 = InsereLigne(x0, y0, x1, y1, Shapes)
            OAttribut trait1, GetList(oRepereForm, &quot;ComboBox15&quot;, j), GetList(oRepereForm, &quot;ComboBox16&quot;, j), GetList(oRepereForm, &quot;ComboBox17&quot;, j)
            If InStr(1, texte$, &quot;;&quot;) &lt;&gt; 0 Then
                MarqueExtremites x0, y0, x1, y1, Shapes, trait1, trait2
                OAttribut trait1, GetList(oRepereForm, &quot;ComboBox15&quot;, j), GetList(oRepereForm, &quot;ComboBox16&quot;, j), GetList(oRepereForm, &quot;ComboBox17&quot;, j)
                OAttribut trait2, GetList(oRepereForm, &quot;ComboBox15&quot;, j), GetList(oRepereForm, &quot;ComboBox16&quot;, j), GetList(oRepereForm, &quot;ComboBox17&quot;, j)
            End If
            If val(GetList(oRepereForm, &quot;ComboBox32&quot;, j)) Then
                xi = (x0 + x1) / 2
                yi = (y0 + y1) / 2
                anglesegment = CalculeAngle(x0, y0, x1, y1) + Pi / 2
                trait1 = MarqueMilieu(x0, y0, x1, y1, Shapes)
                OAttribut trait1, GetList(oRepereForm, &quot;ComboBox15&quot;, j), GetList(oRepereForm, &quot;ComboBox16&quot;, j), GetList(oRepereForm, &quot;ComboBox17&quot;, j)
                If val(GetList(oRepereForm, &quot;ComboBox34&quot;, j)) Then
                    trait1 = CodeLongueur(x0, y0, xi, yi, 2, Shapes)
                    OAttribut trait1, GetList(oRepereForm, &quot;ComboBox15&quot;, j), GetList(oRepereForm, &quot;ComboBox16&quot;, j), GetList(oRepereForm, &quot;ComboBox17&quot;, j)
                    trait1 = CodeLongueur(xi, yi, x1, y1, 2, Shapes)
                    OAttribut trait1, GetList(oRepereForm, &quot;ComboBox15&quot;, k), GetList(oRepereForm, &quot;ComboBox16&quot;, k), GetList(oRepereForm, &quot;ComboBox17&quot;, k)
                End If
                If GetList(oRepereForm, &quot;ComboBox33&quot;, j) &lt;&gt; &quot;*&quot; Then
                    InsereTexte(xi + 15 * Cos(anglesegment), yi + 15 * Sin(anglesegment), GetList(oRepereForm, &quot;ComboBox33&quot;, j), Shapes)
                End If
            End If
        End If
    Next j
End Sub

Private Sub RepereTraceDroites(Shapes as Object)
Dim secArray() As Single
Dim triArray() As Single
Dim j, i, texte$, a, b, c
Dim x1, y1, x2, y2, xx1, yy1, xx2, yy2, x6, y6, x5, y5, x4, y4, x3, y3
Dim tab1, tab2, zone, zone1, ang1
Dim unVecteur as Object

	oRepereForm.Model.Label20.Label = Chaine(&quot;tracdroi&quot;) &apos;&quot;Tracé des droites&quot;
    For j = 0 To ListCount(oRepereForm, &quot;ListBox4&quot;) - 1
        i = 1
        texte$ = GetList(oRepereForm, &quot;ListBox4&quot;, j)
        If InStr(1, texte$, &quot;(&quot;) &lt;&gt; 0 And InStr(1, texte$, &quot;)&quot;) &lt;&gt; 0 Then
            ExtraitDroitePoint texte$, i, a, b, c, eqdroite$
        Else
            If InStr(1, texte$, &quot;&gt;&quot;) Then AnalyseEquationDroite texte$, a, b, c, &quot;&gt;&quot;
            If InStr(1, texte$, &quot;&lt;&quot;) Then AnalyseEquationDroite texte$, a, b, c, &quot;&lt;&quot;
            If InStr(1, texte$, &quot;=&quot;) Then AnalyseEquationDroite texte$, a, b, c, &quot;=&quot;
&apos;            ExtraitDroite texte$, i, a, b, c, eqdroite$
        End If
        If i &lt;&gt; -1 Then
            If a = 0 Then
                x1 = xmin
                y1 = -c / b
                x2 = xmax
                y2 = -c / b
            Else
                If b = 0 Then
                    x1 = -c / a
                    y1 = ymax
                    x2 = -c / a
                    y2 = ymin
                Else
                    x1 = xmin
                    y1 = (-a * x1 - c) / b
                    If y1 &lt; ymin Then
                        y1 = ymin
                        x1 = (-c - b * y1) / a
                    End If
                    If y1 &gt; ymax Then
                        y1 = ymax
                        x1 = (-c - b * y1) / a
                    End If
                    x2 = xmax
                    y2 = (-a * x2 - c) / b
                    If y2 &gt; ymax Then
                        y2 = ymax
                        x2 = (-c - b * y2) / a
                    End If
                    If y2 &lt; ymin Then
                        y2 = ymin
                        x2 = (-c - b * y2) / a
                    End If
                End If
            End If
            xx1 = x1
            yy1 = y1
            xx2 = x2
            yy2 = y2
            x1 = posx + x1 * dx + y1 * dy * Cos(angleaxe)
            y1 = posy - y1 * dy * Sin(angleaxe)
            x2 = posx + x2 * dx + y2 * dy * Cos(angleaxe)
            y2 = posy - y2 * dy * Sin(angleaxe)
            unVecteur = InsereLigne(x1, y1, x2, y2, Shapes)
            
            If InStr(1, texte$, &quot;&gt;&quot;) &lt;&gt; 0 Or InStr(1, texte$, &quot;&lt;&quot;) &lt;&gt; 0 Then
                x6 = posx + xmin * dx + ymin * dy * Cos(angleaxe)
                y6 = posy - ymin * dy * Sin(angleaxe)
                x5 = posx + xmax * dx + ymin * dy * Cos(angleaxe)
                y5 = posy - ymin * dy * Sin(angleaxe)
                x4 = posx + xmax * dx + ymax * dy * Cos(angleaxe)
                y4 = posy - ymax * dy * Sin(angleaxe)
                x3 = posx + xmin * dx + ymax * dy * Cos(angleaxe)
                y3 = posy - ymax * dy * Sin(angleaxe)
                
                tab1 = Array(&quot;&quot;, &quot;3213&quot;, &quot;34213&quot;, &quot;345213&quot;, &quot;4214&quot;, &quot;45214&quot;, &quot;63216&quot;, &quot;634216&quot;)
                tab2 = Array(&quot;&quot;, &quot;124561&quot;, &quot;12561&quot;, &quot;1261&quot;, &quot;125631&quot;, &quot;12631&quot;, &quot;12451&quot;, &quot;1251&quot;)
                If xx1 = xmin Then
                    If yy2 = ymax Then zone = 1
                    If xx2 = xmax Then zone = 2
                    If yy2 = ymin Then zone = 3
                End If
                If yy1 = ymax Then
                    If xx2 = xmax Then zone = 4
                    If yy2 = ymin Then zone = 5
                End If
                If yy1 = ymin Then
                    If yy2 = ymax Then zone = 6
                    If xx2 = xmax Then zone = 7
                End If
                ReDim secArray(0 To Len(tab1(zone))-1, 0 To 1)
                ReDim triArray(0 To Len(tab2(zone))-1, 0 To 1)
                RempliTableau secArray(), tab1(zone), x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6
                RempliTableau triArray(), tab2(zone), x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6
                If (InStr(1, texte$, &quot;&gt;&quot;) And b &gt; 0) Or (InStr(1, texte$, &quot;&lt;&quot;) And b &lt; 0) Then zone1 = InserePolygoneB(secArray(), Len(tab1(zone)), Shapes)
                If (InStr(1, texte$, &quot;&lt;&quot;) And b &gt; 0) Or (InStr(1, texte$, &quot;&gt;&quot;) And b &lt; 0) Then zone1 = InserePolygoneB(triArray(), Len(tab2(zone)), Shapes)
                RemplissageForme zone1, Val(GetList(oRepereForm, &quot;ComboBox44&quot;, j)),80
            End If
            
            OAttribut UnVecteur, GetList(oRepereForm, &quot;ComboBox9&quot;, j), GetList(oRepereForm, &quot;ComboBox10&quot;, j), GetList(oRepereForm, &quot;ComboBox11&quot;, j)
            If val(GetList(oRepereForm, &quot;ComboBox37&quot;, j)) Then
                If b = 0 Then
                    ang1 = 90
                Else
                    ang1 = Atn(-a / b) * 180 / Pi
                End If
                InsereTexte texte$, x2 - 500 * Sin(ang1 * Pi / 180), y2 - 500 * Cos(ang1 * Pi / 180), Shapes, (ang1 - (90 - angleaxe * 180 / Pi))*100
            End If
            NbDroite = NbDroite + 1
        End If
    Next j
End Sub

Private Sub RempliTableau(secArray, texte, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6)
Dim i
    For i = 1 To Len(texte)
        Select Case Val(Mid(texte, i, 1))
        Case 1
            secArray(i-1, 0) = x1
            secArray(i-1, 1) = y1
        Case 2
            secArray(i-1, 0) = x2
            secArray(i-1, 1) = y2
        Case 3
            secArray(i-1, 0) = x3
            secArray(i-1, 1) = y3
        Case 4
            secArray(i-1, 0) = x4
            secArray(i-1, 1) = y4
        Case 5
            secArray(i-1, 0) = x5
            secArray(i-1, 1) = y5
        Case 6
            secArray(i-1, 0) = x6
            secArray(i-1, 1) = y6
        End Select
    Next i
End Sub

Function TraceParabole(posx, posy, xmin, xmax, ymin, ymax, dx, dy, angleaxe, p, TraceFoyer, TraceDirectrice, Ajoute) as Object
Dim secArray(0 To 127, 0 To 1) As Single
Dim secArray2() As Single
Dim i, xi, j, xx, yy, x0, y0, x1, y1
Dim courbe1 as Object

    i = 1
    xi = Min(p * 2.5, xmax)
    For j = xi To 0 Step -xi / 63
        xx = j
        yy = Sqr(2 * p * j)
        If yy &lt;= ymax Then
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            secArray(i-1, 0) = xx
            secArray(i-1, 1) = yy
            i = i + 1
        End If
    Next j
    For j = 0 + xi / 63 To xi Step xi / 63
        xx = j
        yy = -Sqr(2 * p * j)
        If yy &gt;= ymin Then
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            secArray(i-1, 0) = xx
            secArray(i-1, 1) = yy
            i = i + 1
        End If
    Next j
    ReDim secArray2(0 To i - 2, 0 To 1) As Single
    For j = 1 To i - 1
        secArray2(j-1, 0) = secArray(j-1, 0)
        secArray2(j-1, 1) = secArray(j-1, 1)
    Next j
    courbe1 = InsereCourbe(secArray2(), i-1, Ajoute)
    If TraceFoyer Then
        xx = p / 2
        yy = 0
        CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
        croix xx, yy, Ajoute
        InsereTexte &quot;F&quot;, xx - 10, yy - 10, Ajoute
    End If
    If TraceDirectrice Then
        x0 = -p / 2
        y0 = ymin
        x1 = x0
        y1 = ymax
        CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
        CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
        InsereLigne x0, y0, x1, y1, Ajoute
    End If
    TraceParabole = courbe1
End Function

Function TraceHyperbole(posx, posy, xmin, xmax, ymin, ymax, dx, dy, angleaxe, a, b, TraceFoyer, TraceDirectrice, TraceAsymptote, Ajoute)  as Object
Dim secArray(0 To 127, 0 To 1) As Single
Dim secArray2() As Single
Dim i, j, xx, yy, x0, y0, x1, y1
Dim pgroupe as Object
Dim courbe1 as Object

	pgroupe = InitialiseGroupe()
    i = 1
    For j = ymin To ymax Step (ymax - ymin) / 127
        xx = Sqr((1 + j ^ 2 / (b ^ 2)) * a ^ 2)
        yy = j
        If xx &gt;= xmin And xx &lt;= xmax Then
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            If i &lt; 128 Then
                secArray(i-1, 0) = xx
                secArray(i-1, 1) = yy
                i = i + 1
            End If
        End If
    Next j
    ReDim secArray2(0 To i - 2, 0 To 1) As Single
    For j = 1 To i - 1
        secArray2(j-1, 0) = secArray(j-1, 0)
        secArray2(j-1, 1) = secArray(j-1, 1)
    Next j
    InsereCourbe(secArray2(), i-1, pgroupe)
    i = 1
    For j = ymin To ymax Step (ymax - ymin) / 127
        xx = -Sqr((1 + j ^ 2 / (b ^ 2)) * a ^ 2)
        yy = j
        If xx &gt;= xmin And xx &lt;= xmax Then
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            If i &lt; 128 Then
                secArray(i-1, 0) = xx
                secArray(i-1, 1) = yy
                i = i + 1
            End If
        End If
    Next j
    ReDim secArray2(0 To i - 2, 0 To 1) As Single
    For j = 1 To i - 1
        secArray2(j-1, 0) = secArray(j-1, 0)
        secArray2(j-1, 1) = secArray(j-1, 1)
    Next j
    InsereCourbe(secArray2(), i-1, pgroupe)
	courbe1=GroupeObjet(pGroupe)
	Ajoute.add(courbe1)
    If TraceFoyer Then
        xx = -Sqr(a ^ 2 + b ^ 2)
        yy = 0
        CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
        croix xx, yy, Ajoute
        InsereTexte &quot;F&quot;, xx - 10, yy - 10, Ajoute
        xx = Sqr(a ^ 2 + b ^ 2)
        yy = 0
        CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
        croix xx, yy, Ajoute
        InsereTexte &quot;F&apos;&quot;, xx - 10, yy - 10, Ajoute
    End If
    If TraceDirectrice Then
        x0 = -(a ^ 2 / Sqr(a ^ 2 + b ^ 2))
        y0 = ymin
        x1 = x0
        y1 = ymax
        CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
        CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
        InsereLigne x0, y0, x1, y1, Ajoute
        x0 = a ^ 2 / Sqr(a ^ 2 + b ^ 2)
        x1 = x0
        y0 = ymin
        y1 = ymax
        CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
        CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
        InsereLigne x0, y0, x1, y1, Ajoute
    End If
    If TraceAsymptote Then
        y0 = ymin
        x0 = y0 * a / b
        If x0 &lt; xmin Or x0 &gt; xmax Then
            x0 = xmin
            y0 = x0 * b / a
        End If
        y1 = ymax
        x1 = y1 * a / b
        If x1 &lt; xmin Or x1 &gt; xmax Then
            x1 = xmax
            y1 = x1 * b / a
        End If
        CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
        CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
        InsereLigne x0, y0, x1, y1, Ajoute
        y0 = ymin
        x0 = -y0 * a / b
        If x0 &lt; xmin Or x0 &gt; xmax Then
            x0 = xmin
            y0 = -x0 * b / a
        End If
        y1 = ymax
        x1 = -y1 * a / b
        If x1 &lt; xmin Or x1 &gt; xmax Then
            x1 = xmax
            y1 = -x1 * b / a
        End If
        CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
        CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
        InsereLigne x0, y0, x1, y1, Ajoute
    End If
    TraceHyperbole = courbe1
End Function

Function TraceEllipse(posx, posy, xmin, xmax, ymin, ymax, dx, dy, angleaxe, a, b, TraceFoyer, TraceDirectrice, Ajoute) as Object
Dim secArray(0 To 126, 0 To 1) As Single
Dim secArray2() As Single
Dim i, j, xx, yy, k, InverseAxe, x0, y0, x1, y1
Dim pgroupe as Object
Dim courbe1 as Object

	pgroupe = InitialiseGroupe()
    i = 1
    For j = 0 To 2 * Pi Step 0.05
        xx = a * Cos(j)
        yy = b * Sin(j)
        If xx &lt; xmin Or xx &gt; xmax Or yy &lt; ymin Or yy &gt; ymax Then
            If i &gt; 2 Then
                ReDim secArray2(0 To i - 2, 0 To 1) As Single
                For k = 1 To i - 1
                    secArray2(k-1, 0) = secArray(k-1, 0)
                    secArray2(k-1, 1) = secArray(k-1, 1)
                Next k
                InsereCourbe(secArray2(), i-1, pgroupe)
            End If
            i = 1
        Else
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            secArray(i-1, 0) = xx
            secArray(i-1, 1) = yy
            i = i + 1
        End If
    Next j
    If i = 127 Then
        secArray(i-1, 0) = secArray(0, 0)
        secArray(i-1, 1) = secArray(0, 1)
        InsereCourbe secArray(), 127, pgroupe
    Else
        If i &gt; 2 Then
        ReDim secArray2(0 To i - 2, 0 To 1) As Single
            For k = 1 To i - 1
                secArray2(k-1, 0) = secArray(k-1, 0)
                secArray2(k-1, 1) = secArray(k-1, 1)
            Next k
            InsereCourbe(secArray2(), i-1, pgroupe)
        End If
    End If

	courbe1=GroupeObjet(pGroupe)
	Ajoute.add(courbe1)

    InverseAxe = (a &lt; b)
    If TraceFoyer Then
        xx = Sqr(max(a, b) ^ 2 - Min(b, a) ^ 2)
        If xx &lt;= MIif(InverseAxe, ymax, xmax) Then
            yy = 0
            If InverseAxe Then Echange xx, yy
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            croix xx, yy, Ajoute
            InsereTexte &quot;F&quot;, xx - 10, yy - 10, Ajoute
        End If
        xx = -Sqr(max(a, b) ^ 2 - Min(b, a) ^ 2)
        If xx &gt;= MIif(InverseAxe, ymin, xmin) Then
            yy = 0
            If InverseAxe Then Echange xx, yy
            CalculeCoordonnees xx, yy, posx, posy, dx, dy, angleaxe
            croix xx, yy, Ajoute
            InsereTexte &quot;F&apos;&quot;, xx - 10, yy - 10, Ajoute
        End If
    End If
    If TraceDirectrice Then
        x0 = a ^ 2 / Sqr(max(a, b) ^ 2 - Min(b, a) ^ 2)
        If x0 &lt;= MIif(InverseAxe, ymax, xmax) Then
            y0 = ymin
            x1 = x0
            y1 = ymax
            If InverseAxe Then
                Echange x0, y0
                Echange x1, y1
            End If
            CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
            CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
            InsereLigne x0, y0, x1, y1, Ajoute
        End If
        x0 = -a ^ 2 / Sqr(max(a, b) ^ 2 - Min(b, a) ^ 2)
        If x0 &gt;= MIif(InverseAxe, ymin, xmin) Then
            x1 = x0
            y0 = ymin
            y1 = ymax
            If InverseAxe Then
                Echange x0, y0
                Echange x1, y1
            End If
            CalculeCoordonnees x0, y0, posx, posy, dx, dy, angleaxe
            CalculeCoordonnees x1, y1, posx, posy, dx, dy, angleaxe
            InsereLigne x0, y0, x1, y1, Ajoute
        End If
    End If
    TraceEllipse = courbe1
End Function

Sub AnalyseEquationDroite(texte$, a, b, c, Optional carac as String)
Dim i, i1, i2, i3, j, oppose, pp$, Defini
Dim ai
	if ismissing(carac) then carac=&quot;=&quot;
    i = 0
    a = &quot;*&quot;
    b = &quot;*&quot;
    c = &quot;*&quot;
    oppose = 1
    Do
        i1 = InStr(i + 1, texte$, &quot;+&quot;)
        If i1 = 0 Then i1 = 1000
        i2 = InStr(i + 1, texte$, &quot;-&quot;)
        If i2 = 0 Then i2 = 1000
        i3 = InStr(i + 1, texte$, carac)
        If i3 = 0 Then i3 = 1000
        j = Min(i1, Min(i2, i3))
        If j = 1000 Then j = Len(texte$) + 1
        if i=0 then ai=1 else ai=i
        pp$ = Mid(texte$, ai, j - ai)
        If InStr(1, pp$, &quot;x&quot;) &lt;&gt; 0 Then
            RemplaceTexte pp$, &quot;x&quot;, &quot;*1&quot;
            RemplaceTexte pp$, &quot;**&quot;, &quot;*&quot;
            RemplaceTexte pp$, &quot;-*&quot;, &quot;-&quot;
            RemplaceTexte pp$, &quot;+*&quot;, &quot;-&quot;
            If Left(pp, 1) = &quot;*&quot; Then pp$ = Mid(pp, 2)
            a = CalculeFonction(pp$, Defini) * oppose
        ElseIf InStr(1, pp$, &quot;y&quot;) &lt;&gt; 0 Then
            RemplaceTexte pp$, &quot;y&quot;, &quot;*1&quot;
            RemplaceTexte pp$, &quot;**&quot;, &quot;*&quot;
            RemplaceTexte pp$, &quot;-*&quot;, &quot;-&quot;
            RemplaceTexte pp$, &quot;+*&quot;, &quot;-&quot;
            If Left(pp, 1) = &quot;*&quot; Then pp$ = Mid(pp, 2)
            b = CalculeFonction(pp$, Defini) * oppose
        Else
            If Left(pp, 1) = &quot;=&quot; Then pp$ = Mid(pp, 2)
            c = CalculeFonction(pp$, Defini) * oppose
        End If
        If j = i3 Then oppose = -1
        i = j
    Loop While (j &lt;&gt; Len(texte$) + 1)
    If a = &quot;*&quot; Then a = 0
    If b = &quot;*&quot; Then b = 0
    If c = &quot;*&quot; Then c = 0
End Sub


</script:module>