StarMap

About StarMap | Contact me
0) { $select_query = "SELECT * FROM tblGalactic WHERE StarID = $_GET[select_star]"; $select_result = mysql_query($select_query) or die("Query failed"); $select_data = mysql_fetch_array($select_result, MYSQL_ASSOC); $x_c = $select_data[X]; $y_c = $select_data[Y]; $z_c = $select_data[Z]; } else { $x_c = isset($_GET["x_c"])?$_GET["x_c"]:"0"; $y_c = isset($_GET["y_c"])?$_GET["y_c"]:"0"; $z_c = isset($_GET["z_c"])?$_GET["z_c"]:"0"; } $xy_zoom = isset($_GET["xy_zoom"])?$_GET["xy_zoom"]:"20"; $z_zoom = isset($_GET["z_zoom"])?$_GET["z_zoom"]:"20"; $m_limit = isset($_GET["m_limit"])?$_GET["m_limit"]:"20"; if(!(is_numeric($m_limit))) { $m_limit = 20; } $image_size = isset($_GET["image_size"])?$_GET["image_size"]:"600"; $image_type = isset($_GET["image_type"])?$_GET["image_type"]:"normal"; $x_max = $x_c + $xy_zoom; $y_max = $y_c + $xy_zoom; $z_max = $z_c + $z_zoom; $x_min = $x_c - $xy_zoom; $y_min = $y_c - $xy_zoom; $z_min = $z_c - $z_zoom; /* Performing SQL query */ $query = "SELECT StarID FROM tblGalactic WHERE X > $x_min AND X < $x_max AND Y > $y_min AND Y < $y_max AND Z > $z_min AND Z < $z_max"; $result = mysql_query($query) or die("Query failed"); echo <<< END

Center of map
X
Y
Z
Zoom (distance from center to edge in light years)
X-Y
Z
Magnitude Limit


(Leave blank to show all stars)
Select star from current map


Center on selection:
Image type:
Image size (pixels):
END; if($image_type == "3d") { $image_size /= 2; print ""; print ""; } else { print ""; } echo <<< END
Jump to Star Trek star:


END; if($select_star != '') { echo "

$selected_name"; if($selected_trek) { echo " ($selected_trek)"; } echo "

"; echo <<< END
Absolute magnitude$selected_absmag
Spectral type$selected_spectrum
Distance from Sol$selected_distance light years
Galactic coordinates$selected_x, $selected_y, $selected_z
Apparent magnitude$selected_mag
Sky coordinates$selected_ra hr RA, $selected_dec deg Dec
[ Look up this star at stellar-database.com ]
[ Look up this star in SIMBAD ]
[ Plot a sky map centered on this star at fourmilab.ch ]
[ Look back at the Sun from this star using http://www.astronexus.com/ ] END; } else { echo '

Data on selected star:


'; echo '(No star selected)'; } echo <<< END
END; ?>