From: eficas <> Date: Mon, 27 Feb 2006 18:22:31 +0000 (+0000) Subject: ajout sqrt pour parametres X-Git-Tag: merge_mars_06~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f63bc6389dd51b6ee93c1e2900f77dfe606f1af;p=tools%2Feficas.git ajout sqrt pour parametres --- diff --git a/Extensions/param2.py b/Extensions/param2.py index 2ccdac4b..b8c56998 100644 --- a/Extensions/param2.py +++ b/Extensions/param2.py @@ -65,6 +65,7 @@ class Binop(Formula): def __adapt__(self,validator): return validator(self.eval()) +original_sqrt=math.sqrt original_cos=math.cos original_sin=math.sin original_ncos=Numeric.cos @@ -72,6 +73,7 @@ original_nsin=Numeric.sin class Unop(Formula): opmap = { '-': lambda x: -x, + 'sqrt': lambda x: original_sqrt(x), 'sin': lambda x: original_sin(x), 'cos': lambda x: original_cos(x) , 'ncos': lambda x: original_ncos(x), @@ -135,7 +137,9 @@ def cos(f): return Unop('ncos', f) def sin(f): return Unop('nsin', f) Numeric.cos=cos Numeric.sin=sin +def sqrt(f): return Unop('sqrt', f) def cos(f): return Unop('cos', f) def sin(f): return Unop('sin', f) math.cos=cos math.sin=sin +math.sqrt=sqrt