Астрономия и телескопы
Главная КНИГИ Статьи ГОСТЕВАЯ КНИГА ССЫЛКИ НОВОСТИ Копии старинных атласов Астроюмор
Система авторегистрации в каталогах, статьи про раскрутку сайтов, web дизайн, flash, photoshop, хостинг, рассылки; форум, баннерная сеть, каталог сайтов, услуги продвижения и рекламы сайтов
Программа расчёта телескопа системы Кассегрен
<html><head>
 <meta name="generator" content="HTML Tidy, see www.w3.org">
 <meta content="text/html; charset=windows-1250" http-equiv="Content-Type">
 <meta name="Author" content="Tomáš Maruška">
 <link rel="StyleSheet" href="cassegrain
.css" type="text/css">
 <title>
 Cassegrain calculator
 </title>
<script type="text/javascript" language="JavaScript">
<!--
var F, F1, B, v, p, R2, C1, C2, CT, ef, H1, D1, U, l, pp, Coma, Ast, PetzCur, FC, ComaArc, AstA,
 RF, Ax2, w, EP1, EP2, SL1, SL2, un, frm, s, sFoc, OneRad = 57.29577951, FH, H2, R1, fst, UH,
 sArcSecods = " \"", ST;
vType = new Array("Classical cassegrain","Dall-Kirkham","Ritchey-Chrétien","Pressmann-Camichel","Stigmatic combination");
function fncCalcParameters() {
Ax2 = p * D1 / F1;
//w = Ax2 + l * FH;
w = F/OneRad * U; // updated by Ric Rokosz
H2 = w / 2.0;
EP1 = C1 / 32.0 * Math.pow(H1, 4) / Math.pow(R1, 3);
EP2 = C2 / 32.0 * Math.pow(H2, 4) / Math.pow(R2, 3);
SL1 = C1 * Math.pow(H1, 3) / (Math.pow(R1, 3) * 4.0 );
SL2 = C2 / 4.0 * Math.pow(H2, 3) / Math.pow(R2, 3);
Coma = ef * ef / 2.0 * (1.0 / (ef * ef) - (1.0 + C1) * l / (l * 2.0 - R1));
Ast = ef * ((l * 2.0 - ef * R1) / (ef * ef * (l * 2.0 - R1)) - Math.pow((l / (l * 2.0 - R1)), 2) * (C1 + 1.0));
PetzCur = ef * (1 + R1 * (ef - 1) / (ef * (l * 2.0 - R1)));
FC = PetzCur - 2.0 * Ast;
RF = F / FC;
fst = D1 / F;
UH = FH / 2.0;
ComaArc = Coma * UH * fst * fst * 77349.0;
AstA = Ast * UH * UH * fst * 103132.0;
}

function fncCompute1() {
ef = F / F1;
p = (F1 + B) / (ef + 1.0);
v = p * ef;
R1 = F1 * 2.0;
H1 = D1 / 2.0;
l = F1 - p;
R2 = v * 2.0 / (ef - 1.0);
CT = ((ef + 1.0) / (ef - 1.0)) * ((ef + 1.0) / (ef - 1.0));
}
function fncCompute2() {
p = R2 * v / (2.0 * v + R2);
ef = v / p;
F = F1 * ef;
l = F1 - p;
H1 = D1 / 2.0;
B = v - l;
R1 = F1 * 2.0;
CT = ((ef + 1.0) / (ef - 1.0)) * ((ef + 1.0) / (ef - 1.0));
}
function fncCompute3() {
v = R2 * p / (R2 - 2.0 * p);
ef = v / p;
F = F1 * ef;
l = F1 - p;
H1 = D1 / 2.0;
B = v - l;
R1 = F1 * 2.0;
CT = ((ef + 1.0) / (ef - 1.0)) * ((ef + 1.0) / (ef - 1.0));
}
function fncCompute4() {
pp = F1 + B;
p = (pp + R2 - Math.sqrt(pp * pp + R2 * R2)) / 2.0;
v = pp - p;
ef = v / p;
F = F1 * ef;
l = F1 - p;
H1 = D1 / 2.0;
R1 = F1 * 2.0;
CT = ((ef + 1.0) / (ef - 1.0)) * ((ef + 1.0) / (ef - 1.0));
}
function fncCompute5() {
ef = (Math.sqrt(C2) + 1.0) / (Math.sqrt(C2) - 1.0);
v = R2 * (ef - 1.0) / 2.0;
p = v / ef;
F = F1 * ef;
l = F1 - p;
B = v - l;
R1 = F1 * 2.0;
H1 = D1 / 2.0;
CT = ((ef + 1.0) / (ef - 1.0)) * ((ef + 1.0) / (ef - 1.0));
C2 = -C2;
}
function fncConic1() {
C1 = -1.0;
C2 = -CT;
}
function fncConic2() {
C1 = 1.0 - R2 / R1 * Math.pow((ef * ef - 1.0), 2) / Math.pow(ef, 4);
C1 = -C1;
C2 = 0;
}
function fncConic3() {
C1 = -(p * 2.0 / (l * ef * ef) + 1.0);
C2 = -(ef * R1 / (l * Math.pow((ef - 1.0), 3)) + CT);
}
function fncConic4() {
C1 = 0;
C2 = R1 / R2 * Math.pow((ef / (ef - 1.0)), 4) - CT;
}
function fncConic5() {
if ( isNaN(C1) ) {
C1 = R2 / R1 * Math.pow(((ef - 1.0) / ef), 4) * (CT + C2) - 1.0;
}else{
C2 = (1.0 + C1) * R1 / (R1 - 2.0 * l) * Math.pow((ef / (ef - 1.0)), 3) - CT;
}
}
function fncExponent( fNum ) {
var iExp = 0, sValue;
if ( Math.abs(fNum) > 1 ) {
sSign = "+"
while (Math.abs(fNum) > 1 ) {
iExp++;
fNum /= 10;
}
iExp--;
fNum *= 10;
}else{
sSign = "-"
while (( Math.abs(fNum) < 1) && ( Math.abs(fNum) > 0)) {
iExp++;
fNum *= 10;
}
if ( iExp == 0 ) {
sValue = fNum;
}else{
sValue = fNum + "e" + sSign + iExp;
}
}
return sValue;
}

function fncGetRadioValue( frm, sRBname ) {
var vValue = null;
for ( var i = 0; i < frm[sRBname].length; i++ ) {
if ( frm[sRBname][i].checked == true ) {
vValue = frm[sRBname][i].value;
}
}
return vValue;
}

function fncGetValues(frm) {
un = " " + fncGetRadioValue( frm, "fldRBunit" );
sRBtype = fncGetRadioValue( frm, "fldRBtype" );
D1 = parseFloat(frm.fldPriDia.value);
F1 = parseFloat(frm.fldPriFoc.value);
U = parseFloat(frm.fldField.value);
FH = U / OneRad;
F = parseFloat(frm.fldSysFoc.value);
B = parseFloat(frm.fldBackFocLen.value);
v = parseFloat(frm.fldSysFocSecDist.value);
p = parseFloat(frm.fldPriFocSecDist.value);
R2 = parseFloat(frm.fldSecRadCur.value);
C1 = parseFloat(frm.fldPriConic.value);
C2 = parseFloat(frm.fldSecConic.value);
var iErr = 0, iCompute;
if ( (sRBtype == 5) && isNaN(C1) && isNaN(C2) ) {
iErr = 4;
}
if ( isNaN(D1) || (D1 == 0) || isNaN(F1) || (F1 == 0) || isNaN(U) || (U == 0) ) {
iErr = 1;
}else{
if ( isNaN(R2) || (R2 == 0) ) {
if ( isNaN (F) || (F == 0) || isNaN(B) ) {
iErr = 2;
}else{
iCompute = 1;
}
}else{
if ( isNaN(C2) ) {
if ( isNaN(p) ) {
if ( isNaN(v) ) {
if ( isNaN(B) ) {
iCompute = 4;
}else{
iErr = 3;
}
}else{
iCompute = 2;
}
}else{
iCompute = 3;
}
}else{
iCompute = 5;
}
}
}
if ( iErr != 0 ) {
fncHandleErr(iErr);
return;
}else{
eval ("fncCompute" + iCompute + "()");
eval ("fncConic" + sRBtype + "()");
fncCalcParameters();
fncOutput();
}
}

function fncHandleErr(iErr) {
s = "";
if ( iErr == 1 ) {
s = "You must enter default parameters\n\tmirror diameter,\tmirror focal length\tand field.";
}else{
if ( iErr == 2 || iErr == 3 ) {
s = "Not enough parameters!";
}else{
if ( iErr == 4 ) {
s = "Please enter one - Primary or Secondary conic";
document.forms[0].fldPriConic.focus();
}else{
s = "Undefined error.";
}
}
}
iErr = 0;
alert (s);
}

function fncOutput() {
ST = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
ST += '<HTML><HEAD><TITLE>Výstup</TITLE>';
ST += '<META content="text/html; charset=windows-1250" http-equiv=Content-Type>';
ST += '<link rel="StyleSheet" href="cassegrain.css" type="text/css">';
ST += '</HEAD><BODY>';
ST += '<h4>General parameters for ' + vType[sRBtype - 1] + '</h4>';
ST += '<TABLE width="100%" cellspacing="0" cellpadding="2" border="0">';
ST += '<tr class="row"><td width="70%">Primary mirror diameter</td><td width="30%">' + fncTrimFP( D1, 4) + un + '</td></tr>';
ST += '<tr><td>Primary mirror focal length</td><td>' + fncTrimFP( F1, 4) + un + '</td></tr>';
ST += '<tr class="row"><td>System focal length</td><td>' + fncTrimFP( F, 4) + un + '</td></tr>';
ST += '<tr><td>Back focal length</td><td>' + fncTrimFP( B, 4) + un + '</td></tr>';
ST += '<tr class="row"><td>Distance secondary from system focus</td><td>' + fncTrimFP( v, 4) + un + '</td></tr>';
ST += '<tr><td>Distance secondary from prime focus</td><td>' + fncTrimFP( p, 4) + un + '</td></tr>';
ST += '<tr class="row"><td>Distance secondary from primary</td><td>' + fncTrimFP( l, 4) + un + '</td></tr>';
ST += '<tr><td>Radius of curvature of secondary mirror</td><td>' + fncTrimFP( R2, 4) + un + '</td></tr>';
ST += '<tr class="row"><td>Primary mirror conic constant</td><td>' + fncTrimFP( C1, 4) + '</td></tr>';
ST += '<tr><td>Secondary mirror conic constant</td><td>' + fncTrimFP( C2, 4) + '</td></tr>';
ST += '<tr class="row"><td>Extension factor</td><td>' + fncTrimFP( ef, 4) + '</td></tr>';
ST += '</table>'
ST += '<H4>Schwarzschild coeficients</H4>';
ST += '<TABLE width="100%" cellspacing="0" cellpadding="2" border="0">';
ST += '<tr class="row"><td width="70%">Coma</td><td width="30%">' + fncTrimFP( Coma, 4) + '</td></tr>';
ST += '<tr><td>Astigmatism</td><td>' + fncTrimFP( Ast, 4) + '</td></tr>';
ST += '<tr class="row"><td>Petzval Curvature</td><td>' + fncTrimFP( PetzCur, 4) + '</td></tr>';
ST += '<tr><td>Curvature of field</td><td>' + fncTrimFP( FC, 4) + un + '</td></tr>';
ST += '<tr class="row"><td>Coma</td><td>' + fncTrimFP( ComaArc, 4) + sArcSecods + '</td></tr>';
ST += '<tr><td>Astigmatism</td><td>' + fncTrimFP( AstA, 4) + sArcSecods + '</td></tr>';
ST += '<tr class="row"><td>Radius of field curvature</td><td>' + fncTrimFP( RF, 4) + un + '</td></tr>';
ST += '<tr><td colspan="2">&nbsp;&nbsp;&nbsp;(curvature is ';
ST += (RF <= 0) ? "toward" : "from";
ST += ' sky)</td></tr>';
ST += '<tr class="row"><td>Axial diameter of the secondary</td><td>' + fncTrimFP( Ax2, 4) + un + '</td></tr>';
ST += '<tr><td>Optical diameter for field</td><td>' + fncTrimFP( w, 4) + un + '</td></tr>';
ST += '<tr class="row"><td>Epsilon 0.707 of:</td></tr>';
ST += '<tr><td>&nbsp;&nbsp;&nbsp;Primary</td><td>' + fncTrimFP( fncExponent( EP1 ), 4) + un + '</td></tr>';
ST += '<tr class="row"><td>&nbsp;&nbsp;&nbsp;Secondary</td><td>' + fncTrimFP( fncExponent( EP2 ), 4) + un + '</td></tr>';
ST += '<tr><td colspan="2">Slope at edge of:</td></tr>';
ST += '<tr class="row"><td>&nbsp;&nbsp;&nbsp;Primary</td><td>' + fncTrimFP( fncExponent( SL1 ), 4) + un + '</td></tr>';
ST += '<tr><td>&nbsp;&nbsp;&nbsp;Secondary</td><td>' + fncTrimFP( fncExponent( SL2 ), 4) + un + '</td></tr>';
ST += '</TABLE>';
ST += '</body>';
ST += '</html>';
parent.Output.document.write(ST);
parent.Output.document.close();
}

function fncTrimFP( fNum, iDP) {
var iIndexOfDP, iIndexOfExp, sExp;
fNum = fNum + "";
iIndexOfExp = fNum.indexOf("e")
if (iIndexOfExp == -1) {
sExp = "";
} else {
sExp = fNum.substring(iIndexOfExp, fNum.length);
}
if ( fNum.indexOf(".")==-1 ) {
fNum += ".";
}
fNum += "0000000000000000000000000";
iIndexOfDP = fNum.indexOf(".");
return fNum.substring(0,iIndexOfDP + 1 + iDP) + sExp;
}
//-->
</script>
 </head>
 <body>
 <div class="title">Cassegrain telescope calculator</div>
 <p>This program calculates construction parameters for cassegrain telescopes
 </p><form name="parameters">
 <table border="0" cellpadding="2" cellspacing="0" width="100%">
 <tbody><tr>
 <td>Choose units:</td>
 <td>
 <input name="fldRBunit" value="mm" type="radio"> mm <input name="fldRBunit" value="inch" checked="checked" type="radio"> inch
 </td>
 </tr>
 <tr>
 <td valign="top">
 Choose type:
 </td>
 <td>
 <input name="fldRBtype" value="1" checked="checked" type="radio"> Classical Cassegrain<br>
 <input name="fldRBtype" value="2" type="radio"> Dall-Kirkham<br>
 <input name="fldRBtype" value="3" type="radio"> Ritchey-Chrétien<br>
 <input name="fldRBtype" value="4" type="radio"> Pressmann-Camichel<br>
 <input name="fldRBtype" value="5" type="radio"> Stigmatic combination
 </td>
 </tr>
 <tr>
 <td>
 Primary mirror diameter:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldPriDia" value="12" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Enter field:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldField" value="2" type="text"> (deg)
 </td>
 </tr>
 <tr>
 <td>
 Primary mirror focal length:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldPriFoc" value="36" type="text">
 </td>
 </tr>
 <tr>
 <td>
 System focal length:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldSysFoc" value="108" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Back focal length:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldBackFocLen" value="8" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Distance secondary from system focus:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldSysFocSecDist" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Distance secondary from prime focus:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldPriFocSecDist" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Radius of curvature of secondary mirror:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldSecRadCur" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Primary mirror conic constant:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldPriConic" type="text">
 </td>
 </tr>
 <tr>
 <td>
 Secondary mirror conic constant:
 </td>
 <td>
 <input size="5" maxlength="5" name="fldSecConic" type="text">
 </td>
 </tr>
 <tr>
 <td colspan="2" align="center">&nbsp;<br><input name="calculate" value="Calculate" onclick="fncGetValues(this.form)" type="button">
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="reset" value="Reset" type="reset"></td>
 </tr>
 </tbody></table>
 <p>
 </p><div class="footer">Originally written by Jean Texereau. 
Translated and modified by Will
 Remaklus. JavaScript version by Tomáš Maruška 26-11-1999. Removed 
bug in computing, added 4 decimal places into output 4-8-2006.</div>
 </form>
 


</body></html>
Copyright MyCorp © 2018Бесплатный хостинг uCoz