Earlier quoted context omitted.
I'd agree with 1-based indexing problems, but not 0-based, which seems very natural. And if you have -2-based, I'd argue that perhaps you don't want an array.
I think it's down to personal preferences/how you think. I haven't actually used any languages that didn't have 0 based indexing, but I remember it being very painful and super unintuitive to learn, it just didn't make sense at all (still doesn't, but it's not a problem for me anymore). I always thought 1 based would make a lot more sense and be way easier to learn.
Translating a Fortran F-16 Simulator to Unity3D
31–40 of 129 posts
Re: Translating a Fortran F-16 Simulator to Unity3D
#32I'm somewhat surprised the physical units matter in a computer simulation. As long as the simulation is internally consistent (which I would assume the original code is) it seems odd to me that the nominal units are important at all. Is that video game character walking 100 yards? Or maybe the character is 500 feet tall and he's walking 50 leagues?
Re: Translating a Fortran F-16 Simulator to Unity3D
#33Earlier quoted context omitted.
I'd agree with 1-based indexing problems, but not 0-based, which seems very natural. And if you have -2-based, I'd argue that perhaps you don't want an array.
I think it's down to personal preferences/how you think. I haven't actually used any languages that didn't have 0 based indexing, but I remember it being very painful and super unintuitive to learn, it just didn't make sense at all (still doesn't, but it's not a problem for me anymore). I always thought 1 based would make a lot more sense and be way easier to learn.
Re: Translating a Fortran F-16 Simulator to Unity3D
#34> The program requires a minimum of a 12MHz 80286, 1MB RAM, DOS 5.0 or DR DOS, one 1.2MB 5 1⁄4" or 1.44MB 3 1⁄2" disk drive, hard drive with 11MB of free disk space, and VGA graphics. In addition, Falcon3.O supports a joystick, a joystick with a throttle, dual joysticks, rudder pedals or the ThrustMaster controls. The game also supports a mouse and various sound cards, including the Ad Lib, Sound Blaster and Roland. The 80x87 math coprocessor is supported for the HighFidelity flight model.
> Optimal system requirements are a 20MHz 80386 system or faster, 80x87 math coprocessor, 4MB RAM with EMS (expanded memory), DOS 5.0 or DR DOS, one 1.2MB 51⁄411 or 1.44MB 31⁄2" disk drive, hard drive with 11MB of free space, a 16-bit VGA card, a mouse and a joystick.
* https://vtda.org/docs/computing/SpectrumHolobyte/Falcon_3.0_...
* https://en.wikipedia.org/wiki/Falcon_3.0
"Wow!" we thought at the time.
Re: Translating a Fortran F-16 Simulator to Unity3D
#35Re: Translating a Fortran F-16 Simulator to Unity3D
#36I'm somewhat surprised the physical units matter in a computer simulation. As long as the simulation is internally consistent (which I would assume the original code is) it seems odd to me that the nominal units are important at all. Is that video game character walking 100 yards? Or maybe the character is 500 feet tall and he's walking 50 leagues?
Author is at least partially reusing Unity physics engine instead of using physics integrator from original simulation. It is not a mechanical 1:1 translation of Fortran code to C#. Once you start mixing the two sims units and other constants matter. Also the unity physics engine is finetuned for operating at certain scale with certain units. You could operate it in different units, but that will potentially require…
Re: Translating a Fortran F-16 Simulator to Unity3D
#37Earlier quoted context omitted.
Ok but if you did a global find-replace for "meters" with "smoots" do you think that the simulated plane would crash?
Ah but smoots would still follow the same maths as a meter right?
That's the point of my question.
Re: Translating a Fortran F-16 Simulator to Unity3D
#38A nautical mile is ~6,076 feet or exactly 1,852 meters (???). That is actually defined by distances on Earth (which is of course an approximation, but still ...). So, 1 nautical mile equals to one minute in the 90 degrees hemisphere arc. It's approximately 10k km from equator to the pole, so 10,000km/90/60 equals 1.852km.
> 1 nautical mile equals to one minute in the 90 degrees hemisphere arc The nautical mile is not an SI unit, so it is not defined by a single organization, Your definition used to be the common definition, but it seems like the relevant organizations has updated the definition to be exactly 1852 m. If the original definition of the meter applies, then it would have been 1851.85 or 15 cm shorter, but with newer measur…
"In 1929 the International Hydrographic Bureau obtained an agreement from a large number of countries to adopt a value of 1852 metres for the nautical mile, the unit thus defined to be called the International Nautical Mile."
* https://usma.org/laws-and-bills/adoption-of-international-na...
* https://en.wikipedia.org/wiki/International_Hydrographic_Org...
But there was no treaty or anything with a fancy ceremony, just a 'handshake', and so it was up to each country to adopt it with a domestic law or regulation, which (e.g.) the US did in 1954:
* https://usma.org/wp-content/uploads/2015/06/Nautical-Mile.pd...
Previously in the US it was 1853.25 m (because the US is actually metric "officially": all of its customary units (ft, oz) are defined in terms of metric equivalents):
Re: Translating a Fortran F-16 Simulator to Unity3D
#39> Note that Fortran supports arrays with an arbitrary starting index, in this case -2. So this table supports indices in the range [-2, 9]. That is such a useful feature! Surprised I haven’t seen that more often. So much fiddly code exists that’s just fixing offsets to conform to 0 (or 1 for Lua) -based indexing!
not sure why would i want that. Now to get the 3rd element from array, you have to know the start index, so another parameter to pass to function.
Re: Translating a Fortran F-16 Simulator to Unity3D
#40"It turns out, Fortran is actually pretty good at translating formulas." I'm hoping they know that the language's name comes from FORmula TRANslator...