Live data from Hacker News

Translating a Fortran F-16 Simulator to Unity3D

vazgriz.com

11–20 of 129 posts

Re: Translating a Fortran F-16 Simulator to Unity3D

#11
post #2

The "UNITS" part is wonderful. I had no idea slugs even existed. You want to measure how much air mass is in a given volume? That’s gonna be slugs/ft3.

The 'List of non-coherent units of measurement' [1] and 'List of humorous units of measurement' [2] pages are always a fun rabbit hole to go down.

[1] https://en.wikipedia.org/wiki/List_of_non-coherent_units_of_...

[2] https://en.wikipedia.org/wiki/List_of_humorous_units_of_meas...

Re: Translating a Fortran F-16 Simulator to Unity3D

#12
post #6

> 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!

Pascal (and Modula if I'm not mistaken) supports this too.

Ada too, which is of course Pascal-based. Like many programming language features, it feels like it was lost simply because C didn't have it and everyone wanted to copy C.

Re: Translating a Fortran F-16 Simulator to Unity3D

#13
I'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

#14

Earlier quoted context omitted.

Pascal (and Modula if I'm not mistaken) supports this too.

Ada too, which is of course Pascal-based. Like many programming language features, it feels like it was lost simply because C didn't have it and everyone wanted to copy C.

Many BASIC dialects as well.

Hence why the whole base index discussion only became relevant in C based languages.

Re: Translating a Fortran F-16 Simulator to Unity3D

#15

I'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?

In mechanics simulations we often change the units to avoid adding small and large floats.

Re: Translating a Fortran F-16 Simulator to Unity3D

#16

Earlier quoted context omitted.

Pascal (and Modula if I'm not mistaken) supports this too.

Ada too, which is of course Pascal-based. Like many programming language features, it feels like it was lost simply because C didn't have it and everyone wanted to copy C.

Reminds me of this fantastic talk: https://www.youtube.com/watch?v=wo84LFzx5nI

Re: Translating a Fortran F-16 Simulator to Unity3D

#18
post #6

> 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!

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.

Re: Translating a Fortran F-16 Simulator to Unity3D

#19
post #4

A 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 measurement of the earth, it would have been more like 1855 m.

Re: Translating a Fortran F-16 Simulator to Unity3D

#20

I'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?

Would you want to fly in an aircraft that's been modelled with pretend computer units? Or the one that was modelled correctly in a simulator? :)
Post reply on HN