You are on page 1of 2

<html>

<center>
<body>
<font style="comic sans ms" size="55">
<font color="blue sky">
<head>
MID KOMPUTASI FISIKA
<head/>
<br/>
<br/>
GERAK PARABOLA<br/><br/>
<?php
$h=0.01;
$g=9.8;
$m=0.1;
$c=0.46;
$alpha=30;
$rho=1.2;
$r=0.03;
$k=0.5*$rho*$c*pi()*$r*$r/$m;
$t=0;
$v=25;
$x=0;
$y=0;
$vx=$v*cos (deg2rad($alpha));
$vy=$v*sin(deg2rad($alpha));
$v=sqrt($vx*$vx + $vy*$vy);
$ax= -$k*$v*$vx;
$ay=-$g-$k*$v*$vy;
echo "<center><table border=5 bgcolor=FF0066 style=\"border-collapse: collapse;\
"></center>";
echo "<tr>";
echo "<td bgcolor=PURPLE>";
echo "theta";
echo "</td>";
echo "<td bgcolor=PURPLE>";
echo "waktu(s)";
echo "</td>";
echo "<td bgcolor=PURPLE>";
echo "x(m)";
echo "<td bgcolor=PURPLE>";
echo "y(m)";
echo "</tr>";
for ($t=0;$t<=1;$t+=$h){
echo "<tr>";
echo "<td>";
echo "$alpha";
echo "<td>";
echo "$t";
echo "</td>";
echo "<td>";
$x=$x+$h*$vx;
echo "$x";
echo "</td>";
echo "<td>";
$y=$y+$h*$vy;
echo "$y";
echo "</td>";

echo "<td>";
}
echo "</table>";
?>
</font>
</center>

</body>
</html>