Soucis Mathématique en php
Alors voila je galère avec GD .
Je doit faire un héxagone de stat style :
http://vlad76.unblog.fr/files/2006/0...debuter_02.gif
Je bute sur le calcule des coordonnée du point par rapport a son axe.
Pr exemple j'ai un axe
Hungry : 70%
J'en suis la :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
$x = 100;
$y = 100;
$image = imagecreatetruecolor($x,$y);
///// CES UN EXAMPLE de droite
$y = (-3 /10 * $x) + 65;
$init = array();
$fin = array();
$init["x"] = 0;
$init["y"] = 65;
$fin["x"] = 100;
$fin["y"] = 35;
$long = sqrt( ( $fin["x"]*$fin["x"] - $init["x"]*$init["x"] ) + ( $fin["y"]*$fin["y"] - $init["y"]*$init["y"] ) );
$newlong = $long * 0.7;
$x1 = sqrt( ( $x1*$x1 ) - $init["x"]*$init["x"] ) + ( (((-3 /10 * $x1) + 65)*((-3 /10 * $x1) + 65)) - $init["y"]*$init["y"] );
$y1 = (-3 /10 * $x1) + 65; |
Je me demande si php peut interprêter et résoudre cette équation :
Code:
$x1 = sqrt( ( $x1*$x1 ) - $init["x"]*$init["x"] ) + ( (((-3 /10 * $x1) + 65)*((-3 /10 * $x1) + 65)) - $init["y"]*$init["y"] );
J'ai besoin d'aide merci d'avance