Recently i have been toying and learning a bit of HTML and SCRIPTING. I have found this quite useful for making little helpful utilities. Here is the code for a little web based program that uses user input to calculate 'X' and 'Y' coordinates for hole centres.Copy it to an editor such as notepad and save the file with the extension .html then try it out. I am not an expert on browsers so i couldnt tell you if this works on any others than IE that i use.
Any feedback or comments would be great, hope this proves useful to someone.
<html>
<head>
<!-- Program for calculating 'X' and 'Y' coordinates values
from angular information. For example drill hole centers-->
<title>Bolt Circle Calculator</title>
<script language=vbscript>
option explicit
sub calc_onclick
dim vholes,vstart,vend,vpitch,vstart2,vpcr,vx,vy
vstart=document.frm1.start.value
vend=document.frm1.end.value
vpcr=document.frm1.pcr.value
vholes=document.frm1.holes.value
'error handling msgs
if (vend+0)<=(vstart+0) then
msgbox("End Angle Must Be Greater Than Start Angle")
exit sub
end if
if (vholes+0)<1.0 then
msgbox("Number Of Holes Must Be Greater Than Zero")
exit sub
end if
if (vpcr+0)<1.0 then
msgbox("Pitch Circle Radius Must Be Greater Than Zero")
exit sub
end if
vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)
vpitch=formatnumber(vpitch,4)
vstart2=vstart
document.write("<html><head><title>Bolt Results</title></head>")
document.write("<body bgcolor=gray>")
document.write("<h1>Bolt Circle Results</h1>")
document.write("<table border=double bgcolor=#6464ff><tr><th colspan=2>You Entered:</th></tr>")
document.write("<tr><td align=right>Start Angle </td><td bgcolor=white>= "&vstart&"</td></tr>")
document.write("<tr><td align=right>End Angle </td><td bgcolor=white>= "&vend& "</td></tr>")
document.write("<tr><td align=right>PCR </td><td bgcolor=white>= "&vpcr& "</td></tr>")
document.write("<tr><td align=right>Number Of Holes </td><td bgcolor=white>= "&vholes&"</td></tr>")
document.write("<tr><td align=right>Calculated Pitch</td><td bgcolor=white>= "&vpitch&"</td></tr>")
document.write("</table>")
document.write("<strong>These Are The X&Y Coordinates<br>")
document.write("You can cut and paste from here</strong><br>")
document.write("<textarea cols=25 rows=18>")
do
vx=vstart2*3.14159265
vx=vx/180
vx=cos(vx)*vpcr
vx=formatnumber(vx,3)
vy=vstart2*3.14159265
vy=vy/180
vy=sin(vy)*vpcr
vy=formatnumber(vy,3)
document.write("X"&vx&" "&"Y"&vy&vbcrlf)
vstart2=(vstart2+0)+(vpitch+0)
vholes=(vholes+0)-1.0
loop until (vholes+0)<1.0
document.write("</textarea>")
document.write("</body></html>")
end sub
</script>
</head>
<body bgcolor="gray">
<form name="frm1">
<table border=double bgcolor=#6464ff>
<tr><th colspan="2" align="center"><h1>Bolt Circle Calculator</h1></th></tr>
<tr><th>Start Angle?</th><td><input type="text" name="start" value="0"></td></tr>
<tr><th>End Angle?</th><td><input type="text" name="end" value="180"></td></tr>
<tr><th>Pitch Circle Radius?</th><td><input type="text" name="pcr" value="100"></td></tr>
<tr><th>Number of holes?</th><td><input type="text" name="holes" value="19"></td></tr>
<tr><td colspan="2" align="center"><input type="button" name="calc" value="Calculate"></td></tr>
</table>
<form>
</body>
</html>