Comentario usuario
5
5
hola soi una estudiante de preparatoria y estoi haciendo un reloj con manecillas peroen la puntodelas manecillas necesitoponerle un triangulito y que el triangulitolleverelleno y no se como hacerle m e pueden ayudar porfavor este es elcodigode mi reloj:
<?php
header("Refresh: 1");
$seg=$segundos;
$min=$minutos;
$hor=$horas;
$seg=$_COOKIE["reloj"] + 1;
$min=$_COOKIE["reloj2"];
$hor=$_COOKIE["reloj3"];
if($seg>59){$min++;$seg=0;}
if($min>59){$hor++;$min=0;}
if($hor>23)$hor=0;
setCookie("reloj",$seg,time() + 3600);
setCookie("reloj2",$min,time()+3600);
setCookie("reloj3",$hor,time()+3600);
//seg=15;
$size = 300;
$radio = $size / 2;
$desp_x = $radio;
$desp_y = $radio;
$centro_x = $radio;
$centro_y = $radio;
$size_segdr = ($radio * 0.97);
$ang_seg = M_PI / 30;//en radianes
$ang_ini = M_PI / 2;
$cos = cos($seg * $ang_seg - $ang_ini);
$x = intval($cos * $size_segdr) + $desp_x;
$sen = sin($seg * $ang_seg - $ang_ini);
$y = intval($sen * $size_segdr) + $desp_y;
//min
$size = 300;
$radio = $size / 2;
$desp_x1 = $radio;
$desp_y1 = $radio;
$centro_x1 = $radio;
$centro_y1 = $radio;
$size_mntr = ($radio * 0.70);
$ang_min = M_PI / 30;//en radianes
$ang_ini1 = M_PI / 2;
$cos1 = cos($min * $ang_min - $ang_ini1);
$x1 = intval($cos1 * $size_mntr) + $desp_x1;
$sen1 = sin($min * $ang_min - $ang_ini1);
$y1 = intval($sen1 * $size_mntr) + $desp_y1;
/*horas*/
$size = 300;
$radio = $size / 2;
$desp_x2 = $radio;
$desp_y2 = $radio;
$centro_x2 = $radio;
$centro_y2 = $radio;
$size_horas = ($radio * 0.50);
$ang_hor = M_PI / 6 ;//en radianes
$ang_ini2 = M_PI / 2;
$cos2 = cos($hor * $ang_hor - $ang_ini2);
$x2 = intval($cos2 * $size_horas) + $desp_x2;
$sen2 = sin($hor * $ang_hor - $ang_ini2);
$y2 = intval($sen2 * $size_horas) + $desp_y2;
//variables del chiqui circulo
//circulo#1
$size_chc = 30;
$centro_xc = 150;
$centro_yc = 15;
//circulo#2
$size_chc1 = 10;
$centro_xc1 = 219;
$centro_yc1 = 30;
//circulo#3
$size_chc2 = 10;
$centro_xc2 = 265;
$centro_yc2 = 85;
//circulo#4
$size_chc3 = 30;
$centro_xc3 = 285;
$centro_yc3 = 150;
//circulo#5
$size_chc4 = 10;
$centro_xc4 = 270;
$centro_yc4 = 220;
//circulo#6
$size_chc5 = 10;
$centro_xc5 = 220;
$centro_yc5 = 270;
//circulo#7
$size_chc6 = 30;
$centro_xc6 = 150;
$centro_yc6 = 285;
//circulo#8
$size_chc7 = 10;
$centro_xc7 = 80;
$centro_yc7 = 270;
//circulo#9
$size_chc8 = 10;
$centro_xc8 = 30;
$centro_yc8 = 220;
//circulo#10
$size_chc9 = 30;
$centro_xc9 = 15;
$centro_yc9 = 150;
//circulo#11
$size_chc10 = 10;
$centro_xc10 = 30;
$centro_yc10 = 80;
//circulo#12
$size_chc11 = 10;
$centro_xc11 = 80;
$centro_yc11 = 34;
//variables para linea de triangulo
$x_seg=30;
$pfs2=15;
$pfs1=15;
$x_s=-30;
$x_y=-30;
header("Content/Type: image/gif");
$ini=0;
$fin=360;
//crear la imagen
$img = ImageCreate($size,$size);
//colores
$blanco = ImageColorAllocate($img,255,255,255);
$negro = ImageColorAllocate($img,0,0,0);
$azul = ImageColorAllocate($img,0,0,255);
$rojo = ImageColorAllocate($img,255,0,0);
$verde = ImageColorAllocate($img,0,255,0);
$amarillo = ImageColorAllocate($img,255,237,33);
$rosita = ImageColorAllocate($img,255,63,209);
$cafe = ImageColorAllocate($img,65,15,00);
$verdeseco = ImageColorAllocate($img,265,115,16);
$morado = ImageColorAllocate($img,129,299,55);
$fuchia = ImageColorAllocate($img,255,19,255);
$rosa = ImageColorAllocate($img,255,150,255);
//para pintar en la pantalla
ImageLine($img,$centro_x,$centro_y,$x,$y,$negro);
ImageArc($img,$centro_x,$centro_y,$size - 1,$size - 1,$ini,$fin,$fuchia);
ImageLine($img,$centro_x1,$centro_y1,$x1,$y1,$azul);
ImageLine($img,$centro_x2,$centro_y2,$x2,$y2,$rojo);
ImageLine($img,$x_seg,$y_seg,$x_pfs1,$y_pfs1,$rosa);
//linea para triaangulo
ImageArc($img,$centro_xc,$centro_yc,$size_chc ,$size_chc ,$ini,$fin,$rosa);
//circulitos y circulotes
ImageArc($img,$centro_xc1,$centro_yc1,$size_chc1 ,$size_chc1 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc2,$centro_yc2,$size_chc2 ,$size_chc2 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc3,$centro_yc3,$size_chc3 ,$size_chc3 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc4,$centro_yc4,$size_chc4 ,$size_chc4 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc5,$centro_yc5,$size_chc5 ,$size_chc5 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc6,$centro_yc6,$size_chc6 ,$size_chc6 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc7,$centro_yc7,$size_chc7 ,$size_chc7 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc8,$centro_yc8,$size_chc8 ,$size_chc8 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc9,$centro_yc9,$size_chc9 ,$size_chc9 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc10,$centro_yc10,$size_chc10 ,$size_chc10 ,$ini,$fin,$rosa);
ImageArc($img,$centro_xc11,$centro_yc11,$size_chc11 ,$size_chc11 ,$ini,$fin,$rosa);
/* para pintar en pantalla */
ImageGif($img);
/* liberar memoria */
ImageDestroy($img);
//tan tan...
?>
ayudenme porfavor es q ya hice todoloposibley no me sale!!!!!