60 |
jpm |
1 |
<html>
|
|
|
2 |
<head>
|
|
|
3 |
<title>Documentation</title>
|
|
|
4 |
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
|
|
|
5 |
<link rel='stylesheet' href='style.css' />
|
|
|
6 |
</head>
|
|
|
7 |
|
|
|
8 |
<body>
|
|
|
9 |
<div align='center'>
|
|
|
10 |
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
|
|
|
11 |
<tr>
|
|
|
12 |
<td class='borderhg'> </td>
|
|
|
13 |
<td class='borderh'> </td>
|
|
|
14 |
<td class='cornerhd'></td>
|
|
|
15 |
</tr>
|
|
|
16 |
<tr>
|
|
|
17 |
<td class='borderg'> </td>
|
|
|
18 |
<td><a id="top"></a><h2> Class MathPlot</h2><div class="extends"><ul>
|
|
|
19 |
<li><a href="Component.html">Component</a></li>
|
|
|
20 |
<ul><li>MathPlot</li></ul>
|
|
|
21 |
</ul></div><div class="description">
|
|
|
22 |
<p>
|
|
|
23 |
Cette classe permet de représenter simplement des fonctions f(x) sur un graphique.
|
|
|
24 |
L'archive de Artichow contient plusieurs exemples pour vous aider dans la conception de ces graphiques.
|
|
|
25 |
</p>
|
|
|
26 |
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
|
|
|
27 |
<li>
|
|
|
28 |
<span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="MathPlot.html#property.grid"><span class="argument">$grid</span></a>
|
|
|
29 |
</li>
|
|
|
30 |
<li>
|
|
|
31 |
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.xAxis"><span class="argument">$xAxis</span></a>
|
|
|
32 |
</li>
|
|
|
33 |
<li>
|
|
|
34 |
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.yAxis"><span class="argument">$yAxis</span></a>
|
|
|
35 |
</li>
|
|
|
36 |
</ul><ul class="methods">
|
|
|
37 |
<li>
|
|
|
38 |
<span class="access">public</span> <a href="MathPlot.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$xMin</span>, <span class="type">float</span> <span class="argument">$xMax</span>, <span class="type">float</span> <span class="argument">$yMax</span>, <span class="type">float</span> <span class="argument">$yMin</span>)
|
|
|
39 |
</li>
|
|
|
40 |
<li>
|
|
|
41 |
<span class="access">public</span> <a href="MathPlot.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
|
|
|
42 |
</li>
|
|
|
43 |
<li>
|
|
|
44 |
<span class="access">public</span> <a href="MathPlot.html#method.add">add</a>(<a href="MathFunction.html"><span class="type">MathFunction</span></a> <span class="argument">$function</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$type</span> := <span class="default">Legend::LINE</span>)
|
|
|
45 |
</li>
|
|
|
46 |
</ul><h2>Documentation</h2><ul class="doc">
|
|
|
47 |
<li class="property">
|
|
|
48 |
<a id="property.grid"></a><span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="MathPlot.html#property.grid"><span class="argument">$grid</span></a><div class="description">
|
|
|
49 |
Représente la grille de fond du graphique.
|
|
|
50 |
</div>
|
|
|
51 |
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
|
|
|
52 |
</li>
|
|
|
53 |
<li class="property">
|
|
|
54 |
<a id="property.xAxis"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.xAxis"><span class="argument">$xAxis</span></a><div class="description">
|
|
|
55 |
Représente l'axe des abscisses.
|
|
|
56 |
</div>
|
|
|
57 |
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
|
|
|
58 |
</li>
|
|
|
59 |
<li class="property">
|
|
|
60 |
<a id="property.yAxis"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.yAxis"><span class="argument">$yAxis</span></a><div class="description">
|
|
|
61 |
Représente l'axe des ordonnées.
|
|
|
62 |
</div>
|
|
|
63 |
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
|
|
|
64 |
</li>
|
|
|
65 |
<li class="method">
|
|
|
66 |
<a id="method.__construct"></a><span class="access">public</span> <a href="MathPlot.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$xMin</span>, <span class="type">float</span> <span class="argument">$xMax</span>, <span class="type">float</span> <span class="argument">$yMax</span>, <span class="type">float</span> <span class="argument">$yMin</span>)
|
|
|
67 |
<div class="description">
|
|
|
68 |
Construit le graphique.
|
|
|
69 |
L'axe des X va des valeurs $xMin à $xMax tandis que l'axe de Y va des valeurs $yMin à $yMax.
|
|
|
70 |
<pre>
|
|
|
71 |
|
|
|
72 |
<?php
|
|
|
73 |
|
|
|
74 |
require_once "MathPlot.class.php";
|
|
|
75 |
|
|
|
76 |
$graph = new <a href="Graph.html">Graph</a>(300, 300);
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
$plot = new <a href="MathPlot.html">MathPlot</a>(-3, 3, 3, -3);
|
|
|
80 |
$plot-><a href="MathPlot.html#method.setInterval">setInterval</a>(0.1);
|
|
|
81 |
|
|
|
82 |
// On dessine cos(x)
|
|
|
83 |
$function = new <a href="MathFunction.html">MathFunction</a>('cos');
|
|
|
84 |
$plot-><a href="MathPlot.html#method.add">add</a>($function);
|
|
|
85 |
|
|
|
86 |
$graph-><a href="Graph.html#method.add">add</a>($plot);
|
|
|
87 |
$graph-><a href="Graph.html#method.draw">draw</a>();
|
|
|
88 |
|
|
|
89 |
?>
|
|
|
90 |
|
|
|
91 |
</pre>
|
|
|
92 |
</div>
|
|
|
93 |
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
|
|
|
94 |
</li>
|
|
|
95 |
<li class="method">
|
|
|
96 |
<a id="method.setInterval"></a><span class="access">public</span> <a href="MathPlot.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
|
|
|
97 |
<div class="description">
|
|
|
98 |
Change l'interval sur lequel sont calculées les valeurs affichées sur le graphique.
|
|
|
99 |
Par défaut, cet interval est de 1, c'est-à-dire que Artichow calcule f(x) pour toutes les valeurs entières de x.
|
|
|
100 |
</div>
|
|
|
101 |
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
|
|
|
102 |
</li>
|
|
|
103 |
<li class="method">
|
|
|
104 |
<a id="method.add"></a><span class="access">public</span> <a href="MathPlot.html#method.add">add</a>(<a href="MathFunction.html"><span class="type">MathFunction</span></a> <span class="argument">$function</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$type</span> := <span class="default">Legend::LINE</span>)
|
|
|
105 |
<div class="description">
|
|
|
106 |
Ajoute une fonction mathématique au graphique.
|
|
|
107 |
Sur la légende, la fonction aura pour nom $name et le type de légende utilisé sera $type (<a href="Legend.html#constant.LINE">Legend::LINE</a>, <a href="Legend.html#constant.BACKGROUND">Legend::BACKGROUND</a> ou encore <a href="Legend.html#constant.MARK">Legend::MARK</a>).
|
|
|
108 |
Si vous ne souhaitez pas associer de légende à cette fonction, laissez l'argument $name à NULL.
|
|
|
109 |
</div>
|
|
|
110 |
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
|
|
|
111 |
</li>
|
|
|
112 |
</ul>
|
|
|
113 |
</td>
|
|
|
114 |
<td class='borderd'> </td>
|
|
|
115 |
</tr>
|
|
|
116 |
<tr>
|
|
|
117 |
<td class='cornerbg'></td>
|
|
|
118 |
<td class='borderb'> </td>
|
|
|
119 |
<td class='cornerbd'></td>
|
|
|
120 |
</tr>
|
|
|
121 |
</table>
|
|
|
122 |
</div>
|
|
|
123 |
</body>
|
|
|
124 |
</html>
|