From 83574102560f18355e51fa82f7cb9013e47889e1 Mon Sep 17 00:00:00 2001 From: Mysaa Date: Sat, 10 Jul 2021 21:50:11 +0200 Subject: [PATCH] =?UTF-8?q?Quelques=20tests=20de=20recherche=20de=20polyn?= =?UTF-8?q?=C3=B4me=20minimal.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CompteRendu/CompteRendu.tex | 2 +- CompteRendu/Makefile | 8 ++++-- Test.ml | 52 ++++++++++++++++++++++++++++--------- 3 files changed, 47 insertions(+), 15 deletions(-) diff --git a/CompteRendu/CompteRendu.tex b/CompteRendu/CompteRendu.tex index 0d2722a..dd35e8c 100644 --- a/CompteRendu/CompteRendu.tex +++ b/CompteRendu/CompteRendu.tex @@ -59,7 +59,7 @@ % 2: Samy % 3: Victor \newcounter{cqd} -\setcounter{cqd}{3} +\setcounter{cqd}{2} \newcommand\lequel[3]{ diff --git a/CompteRendu/Makefile b/CompteRendu/Makefile index d8fe97e..981650c 100644 --- a/CompteRendu/Makefile +++ b/CompteRendu/Makefile @@ -9,11 +9,15 @@ all: dylan: sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{1}/' -i CompteRendu.tex $(MAKE) build -samy: +samy: print_output_path.svg sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{2}/' -i CompteRendu.tex $(MAKE) build -victor: +victor: print_output_path.svg sed 's/\\setcounter{cqd}{[0-9]}/\\setcounter{cqd}{3}/' -i CompteRendu.tex $(MAKE) build + +print_output_path.svg: + inkscape --export-plain-svg=print_output_path.svg --export-text-to-path print_output.svg + build: pdflatex -synctex=1 -shell-escape -interaction=nonstopmode "CompteRendu".tex diff --git a/Test.ml b/Test.ml index 6a3e424..dc92732 100644 --- a/Test.ml +++ b/Test.ml @@ -484,15 +484,43 @@ let lst = naifostene pol;; List.iter (function p -> print_polynome p) lst;; print_polynome (List.fold_left polmul 1 lst);; - - - - - - - - - - - - \ No newline at end of file + + +(*** Test de recherche du polynome minimal de alpha ***) + +type complexe = float*float;; + +let cmul x y = + let (a,b)=x and (c,d)=y in + (a*.c-.b*.d,b*.c+.a*.d);; +let cadd x y = + let (a,b)=x and (c,d)=y in + (a+.c,b+.d);; + +let rec polymise p z = + if p=0 then (0.,0.) + else + let a = if p mod 2 = 0 then (0.,0.) else (1.,0.) in + let q = p lsr 1 in + cadd a (cmul z (polymise q z));; + +let n = 21;; +let alpha = + let th = 2.*.3.14159265358979/.(float_of_int n) in + (cos th,sin th);; + +let isNull z = + let epsilon = 0.00001 in + let (a,b)=z in + -.epsilon