More programming in GW-BASIC?
3 years ago
Am I mad? Possibly. :=3
Yesterday I wrote two more programs in GW-BASIC to do calculations regarding the curvature of railroad tracks.
The first was to convert a radius into degrees of curvature. This one was giving me problems as the formula requires an Arcsin function and GW-BASIC doesn't natively support that function, it requires a formula. I reached out to the community of a forum I belong to and someone wrote part of the program I needed to convert a radius into degrees.
The second one was to do the conversion the other way: degrees into a radius. This one was a bit easier as the Sine function is built into GW-BASIC, but I was still getting weird results. I then found that GW-BASIC uses radians instead of degrees for the Sine function, so I had to find out how to convert degrees into radians. That was quickly solved and the program ran beautifully.
Now you may ask why would I want/need these two programs. Being I'm a railroader knowing the conversions do help in model railroading and I play Railroads Online! and they use a radius in meters for curves and I want to know how tight those curves are in prototype units, as the prototypes, in the U.S., does not figure the radius but the degree of curve in a 100' chord.
An example is if you had a 100' (30.48m) radius curve, which you might find on a streetcar/trolley/tram track, works out to a 60-degree curve and a 90-degree curve works out to a 70.7103' (21.55263m) radius.
Yesterday I wrote two more programs in GW-BASIC to do calculations regarding the curvature of railroad tracks.
The first was to convert a radius into degrees of curvature. This one was giving me problems as the formula requires an Arcsin function and GW-BASIC doesn't natively support that function, it requires a formula. I reached out to the community of a forum I belong to and someone wrote part of the program I needed to convert a radius into degrees.
The second one was to do the conversion the other way: degrees into a radius. This one was a bit easier as the Sine function is built into GW-BASIC, but I was still getting weird results. I then found that GW-BASIC uses radians instead of degrees for the Sine function, so I had to find out how to convert degrees into radians. That was quickly solved and the program ran beautifully.
Now you may ask why would I want/need these two programs. Being I'm a railroader knowing the conversions do help in model railroading and I play Railroads Online! and they use a radius in meters for curves and I want to know how tight those curves are in prototype units, as the prototypes, in the U.S., does not figure the radius but the degree of curve in a 100' chord.
An example is if you had a 100' (30.48m) radius curve, which you might find on a streetcar/trolley/tram track, works out to a 60-degree curve and a 90-degree curve works out to a 70.7103' (21.55263m) radius.

2Pi radians is 360 degrees
FA+
