Subversion Repositories wimsdev

Rev

Rev 5763 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2071 zjchen 1
!set methtit=重写不等式
2
!set methenv=ZZ QQ RR
3
!set methparmtype=parm inequality, function, choice 5, function
4
!set methhelp=这个方法允许你通过综合使用项的相加、交换两边以及乘非零常数等手段,\
5
把已知(不)等式变换成等价的(不)等式.
6
 
7
!if $wims_read_parm iswordof form check
8
 !goto $wims_read_parm
9
!endif
10
 
11
!exit
12
:form
13
 重写不等式
14
 !read deduc/methparm.phtml 1
17234 bpr 15
 为 <br>
16
 <input size=15 name=methparm2 value="$methparm2">
2071 zjchen 17
 !formselect methparm3 from 1 to 5 prompt =,<,>,<=,>=
17234 bpr 18
 <input size=15 name=methparm4 value="$methparm4">
2071 zjchen 19
 !set methremark=你的新不等式必须与原来的等价.
20
!exit
21
:check
22
 !distribute items $methparmobj1 into data,left1,sign1,right1
23
 sign2=!item $methparm3 of =,<,>,<=,>=
24
 sign3=!item $methparm3 of =,>,<,>=,<=
25
 !if $sign2 notsametext $sign1 and $sign3 notsametext $sign1
26
  :badequiv
27
  error=你的新不等式不等价于原来的!
28
  !advance penalty
29
  !exit
30
 !endif
17234 bpr 31
 
2071 zjchen 32
 check1=($left1) - ($right1)
33
 !if $sign2 issametext $sign1
34
  check2=($methparm2) - ($methparm4)
35
 !else
36
  check2=($methparm4) - ($methparm2)
37
 !endif
17234 bpr 38
 
2071 zjchen 39
 !read deduc/sub/checkzero $check1\
40
    $check2
41
 !distribute line $out into out1, out2
42
 !read deduc/sub/_Simplify ($check1) / ($check2)
43
 out3=$out
44
 !if $out1=yes or $out2=yes
45
  !if $out1!=yes or $out2!=yes
46
   !goto badequiv
47
  !endif
48
 !else
49
  out3=$[$out3]
50
  !if NaN isin $out3 or Inf isin $out3
51
   !goto badequiv
52
  !endif
53
  !if $out3<=0 and $sign2 notsametext $sign3
54
   !goto badequiv
55
  !endif
56
 !endif
57
 methexp=重写 \($left1 $sign1 $right1)
58
 
59
 newobject1=$methparm2 $sign2 $methparm4
60
 oldobject=1
61
 
62
!exit
63