diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/metapost/contrib/macros/repere/README.md | 2 | ||||
-rw-r--r-- | graphics/metapost/contrib/macros/repere/repere-doc.pdf | bin | 1032694 -> 1032684 bytes | |||
-rw-r--r-- | graphics/metapost/contrib/macros/repere/repere.mp | 15 |
3 files changed, 12 insertions, 5 deletions
diff --git a/graphics/metapost/contrib/macros/repere/README.md b/graphics/metapost/contrib/macros/repere/README.md index e96a0a0292..7ecab7d1c3 100644 --- a/graphics/metapost/contrib/macros/repere/README.md +++ b/graphics/metapost/contrib/macros/repere/README.md @@ -1,4 +1,4 @@ -Package repere - Version 23.05 - May 2, 2023 +Package repere - Version 23.05.b - May 2, 2023 --- diff --git a/graphics/metapost/contrib/macros/repere/repere-doc.pdf b/graphics/metapost/contrib/macros/repere/repere-doc.pdf Binary files differindex 67f192c9eb..ddcd415513 100644 --- a/graphics/metapost/contrib/macros/repere/repere-doc.pdf +++ b/graphics/metapost/contrib/macros/repere/repere-doc.pdf diff --git a/graphics/metapost/contrib/macros/repere/repere.mp b/graphics/metapost/contrib/macros/repere/repere.mp index 292d415a9b..96397ccba8 100644 --- a/graphics/metapost/contrib/macros/repere/repere.mp +++ b/graphics/metapost/contrib/macros/repere/repere.mp @@ -2,7 +2,7 @@ %% repere.mp %% %% Macros pour la construction de figures dans un repère %% %% o.peault@posteo.net %% -%% Version 23.05 (Mai 2023) %% +%% Version 23.05.b (Mai 2023) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This work may be distributed and/or modified under the conditions of @@ -2421,11 +2421,11 @@ vardef suiterecprojx@#(text t)= %projections et étiquettes sur axe x, utilis endfor elseif nom="_val": if deb=_suiterecdeb_: - draw etiquettex.@#(arrondi(10**_prec,un)); + draw etiquettex.@#(arrondidec(_prec,un)); deb:=deb+1;un:=_suiterecfonc_(un) fi; for i=deb upto fin: - lab:="$\num{" & decimal(arrondi(10**_prec,un)) & "}$"; + lab:="$\num{" & decimal(arrondidec(_prec,un)) & "}$"; draw projectionx.@#((un,un),lab,-taillegrad); un:=_suiterecfonc_(un); endfor @@ -2475,7 +2475,7 @@ vardef suiterecprojy@#(text t)= %projections et étiquettes sur axe y, utilis deb:=deb+1; fi; for i=deb-1 upto fin-1: - lab:="$\num{" & decimal(arrondi(10**_prec,un)) & "}$"; + lab:="$\num{" & decimal(arrondidec(_prec,un)) & "}$"; draw projectiony.@#((un,_suiterecfonc_(un)),lab,-taillegrad); un:=_suiterecfonc_(un); endfor @@ -4451,6 +4451,13 @@ enddef; %%%%%%%%%%%%%%% MATHS %%%%%%%%%%%%%%%%% +vardef arrondidec(expr n,x)= % arrondi de x à 10^-n + save pp; + numeric pp; + pp:= 1 for i=1 upto n: *10 endfor; + round(pp*x)/pp +enddef; + vardef arrondi(expr p,x)= %arrondi de x au p-ième % round((x-floor(x))*p)/p+floor(x) |