-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewton-examples.php
34 lines (27 loc) · 995 Bytes
/
newton-examples.php
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
<?php
examples("1,2,3,4,5");
function bind_examples ($id,$tex,$function,$a,$b,$n,$c)
{
echo '$("#e-'.$id.'").tooltip({ content: \'<img src="http://um.mendelu.cz/mathtex/mathtex.php?'.$tex.'">\' });';
echo '$("#e-'.$id.'").bind("click", function() {';
echo '$("#exampleform")[0].reset();';
echo '$("#in-funkce").val("'.$function.'");';
echo '$("#in-a").val("'.$a.'");';
echo '$("#in-b").val("'.$b.'");';
echo '$("#in-n").val("'.$n.'");';
echo '$("#in-c").val("'.$c.'");';
echo '$("#exampleform").submit();});';
}
?>
<script>
window.onload = function() {
$("#in-funkce").tooltip({ content: '<img src="http://um.mendelu.cz/mathtex/mathtex.php?{\\color{red}f(x)}=x">' });
<?php
bind_examples(1,'\\\\cos(x)=0',"cos(x)",0,2,10,1);
bind_examples(2,'x^3+2x-2&=0',"x^3+2*x-2",0.7,1,10,1);
bind_examples(3,'x^5+3x^2-20&=0',"x^5+3*x^2-20",0.7,2.6,10,1);
bind_examples(4,'e^{-2x}+x-3&=0',"exp(-2*x)+x-3",-1,0,10,-1);
bind_examples(5,'e^{x^2}+e^{x}&=4',"exp(x^2)+exp(x)-4",0.6,1,10,1);
?>
}
</script>