[HN Gopher] Translating a Fortran F-16 Simulator to Unity3D
___________________________________________________________________
Translating a Fortran F-16 Simulator to Unity3D
Author : hggh
Score : 236 points
Date : 2025-09-26 07:06 UTC (15 hours ago)
(HTM) web link (vazgriz.com)
(TXT) w3m dump (vazgriz.com)
| imp0cat wrote:
| 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.
| kataklasm wrote:
| The whole imperial/British side has tons of ugly and weird
| units of measure. Reading old engineering documentation will
| give you headaches and nightmares from all the inconsistent
| systems of units.
| arnsholt wrote:
| My favourite one was when I learned about the existence of US
| survey feet.
| HeyLaughingBoy wrote:
| My property is very irregularly shaped with the longest
| straight dimension being 6" shy of a quarter mile. The
| really scary thing is that I recognized that immediately
| the first time I looked at the property survey map.
| hans_castorp wrote:
| My favorite "strange unit" is poronkusema:
|
| "A Sami measurement of distance; the distance a reindeer can
| travel before needing to stop to urinate. Today used to
| describe something that is at a very obscure distance away"
| (approximately 7.5 km)
|
| https://en.wikipedia.org/wiki/Obsolete_Finnish_units_of_meas...
| sunrunner wrote:
| There's no reason for this to obsolete, I have to factor this
| into route planning for myself so I vote we bring this one
| back.
| sunrunner wrote:
| 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...
| Tor3 wrote:
| Ah, I now learned that "One moment, please" means that I'll
| have to expect to wait 90 seconds.
| jan_g wrote:
| 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.
| alephnil wrote:
| > 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.
| throw0101c wrote:
| > _The nautical mile is not an SI unit, so it is not defined
| by a single organization_
|
| "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_Or
| g...
|
| 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):
|
| * https://usma.org/laws-and-bills/mendenhall-order
| JSR_FDED wrote:
| > 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!
| hans_castorp wrote:
| Pascal (and Modula if I'm not mistaken) supports this too.
| LiamPowell wrote:
| 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.
| pjmlp wrote:
| Many BASIC dialects as well.
|
| Hence why the whole base index discussion only became
| relevant in C based languages.
| ubercore wrote:
| Reminds me of this fantastic talk:
| https://www.youtube.com/watch?v=wo84LFzx5nI
| IsTom wrote:
| In C can't you just offset pointer and then you'll be able
| to index with arbitrary starting value?
| michaelrpeskin wrote:
| Yes. I do this a lot when writing linear algebra stuff.
| All the math texts write things in 1-based notation for
| matrices. The closer I can make the code match the paper
| I'm implementing makes life so much easier. Of course
| there's a big comment at the beginning of the function
| when I modify the pointer to explain why I'm doing it.
| LiamPowell wrote:
| Technically no, a pointer pointing outside of its array
| (or similar) at any point is undefined behaviour. More
| importantly for this discussion, without support from the
| language it's not very ergonomic to work with. What
| happens when you need to call strlen, memcpy, or free?
| kevin_thibedeau wrote:
| It works in this case where you want to move the zero
| index forward a few cells to a valid offset. It is only
| UB for the general case where the offset may land outside
| valid memory. C has always supported negative indices, so
| moving index zero forward into the middle of the array is
| fine.
| zabzonk wrote:
| 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.
| chillfox wrote:
| 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.
| CaptainOfCoit wrote:
| I wonder how many of the "off by one" issues/bugs we
| encounter in the wild are because of arrays typically using
| 0-based indexing vs 1-based indexing.
| zabzonk wrote:
| None, in my experience. 1-based is far, far likely to
| introduce errors, as you have to keep adjusting the index
| to the algorithm and/or what is actually going on
| underneath.
| CaptainOfCoit wrote:
| > as you have to keep adjusting the index to the
| algorithm and/or what is actually going on underneath.
|
| Yeah, that's mixing both of them. Wouldn't it work as
| well if they all used 1-based indexing or 0-based
| indexing? Sounds like the issue was that algorithms/stuff
| underneath wasn't 1-based.
| arethuza wrote:
| I think encountering C arrays and pointers rewrote my brain
| so that 0 based indexing made more sense even though up to
| that point (~40 years ago) I'd only used languages that
| used 1 based indexing (Basic and Pascal).
| johannes1234321 wrote:
| The zero-based approach makes sense in C, where it is
| syntactic sugar and `a[i]` is equal to `*(a + i)` Treating
| it as offset of 0 is logical.
|
| The more you go away from raw pointer semantics the less
| intuitive it gets.
| michaelrpeskin wrote:
| For extra fun, in C you can write i[a] since addition is
| commutative *(i+a) == *(a+i)
| zabzonk wrote:
| I would say it is sensible. Given that an array index is an
| unsigned integer, what are you going to do with an index of
| zero?
|
| Perhaps I've been influenced by writing a lot of code in
| assembler, way back when, but zero-based has always seemed
| completely natural to me, to the extent that I find it very
| hard to understand algorithms expressed in non-zero based
| code.
| Joker_vD wrote:
| An array index can be signed with no problem. If you're
| worried about the address calculations, well, the address
| of an array doesn't have to be the address to its initial
| element, does it? It can be the address of the element
| with index 0 (even if an array does not have such an
| index at all): arr: array[-2..10] of
| integer; pointer(@arr) == pointer(@arr[0])
|
| Or you can use descriptors (dope vectors), but that
| involves quite an overhead. The books on compilers from
| the 70s (e.g. Gries's "Compiler construction for digital
| computers") have rather extensive discussions on both
| approaches.
| zabzonk wrote:
| Yes, I'm familiar with Pascal indexes, but I don't find
| them very natural for the kind of programs I write. I
| want functions/classes to do any sort of translation.
|
| > The books on compilers from the 70s (e.g. Gries's
| "Compiler construction for digital computers")
|
| Yellow cover, I think? My then GF bought it for Xmas at
| about 1984 or so. Not the best book on the topic, IMHO.
| throwawayben wrote:
| 0 based is much simpler for any mathematical calculation
| done with the indexes. only reasons I can think where you
| need to handle it is when getting the last index from the
| length of the array or when interacting with the user. With
| 1-based you'll need to subtract or add 1 all over the place
| when doing almost anything
| mrheosuper wrote:
| 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.
| Marazan wrote:
| Your issue is you are trying to work out how use to this
| feature as a zero based array.
|
| EDIT (for more explanation): I have an input value from -10
| to 100. I want to use this value to lookup something in a
| table. IN a ero indexed world I have to know what the lowest
| value is and subtract that from the input value to get to
| zero (so "another parameter to pass to function").
|
| With an arbitrary start index the array is just indexed from
| the lowest value (-10). There is nothing more needing to be
| passed in.
| flohofwoe wrote:
| You might want the element at "position" 0 though (which with
| the origin at -2 would be the 3rd element). E.g. treat the
| array index as a coordinate in a 1D coordinate system with
| user-defined origin.
| kergonath wrote:
| When you pass the array to a function, it is 1-indexed by
| default in the body of that function, unless that function
| sets a specific starting index.
| danbruc wrote:
| .NET supports this because [Visual] Basic supports it. This can
| be used from C# - and other languages - but there is no nice
| syntax supporting it. // This also supports
| multidimensional arrays, that is why the parameters are arrays.
| var array = Array.CreateInstance(elementType: typeof(Int32),
| lengths: [ 5 ], lowerBounds: [ -2 ]); // This does
| not compile, the type is Int32[*], not Int32[]. //
| Console.WriteLine(array[0]); array.SetValue(value:
| 42, index: -2);
| Console.WriteLine(array.GetValue(-2));
| evntdrvn wrote:
| TIL thanks!
| teamonkey wrote:
| Lua actually has arbitrary indexing, it's just that some
| iterator functions in the standard library assume arrays begin
| at 1.
| gsck wrote:
| It does and doesn't. You can have any arbitrary index, but
| that changes the table from being an array to being both an
| array and a dictionary, some real weird Frankenstein stuff
| delusional wrote:
| > but that changes the table from being an array to being
| both an array and a dictionary
|
| You're confusing the definition of the language with the
| implementation. In implementation you're right, most
| runtimes will treat arrays starting at 1 as a special case
| and optimize that access. The language itself doesn't make
| that distinction though. Here an array is simply any table
| indexed by integers. The documentation states it's thusly:
| You can start an array at index 0, 1, or any other value
| btrettel wrote:
| Unfortunately, Fortran's implementation of this has some
| inconsistencies. Doing certain operations will convert from the
| custom indexing back to 1-based indexing.
|
| https://github.com/sourceryinstitute/fidbits/blob/master/src...
|
| https://fortran-lang.discourse.group/t/just-say-no-to-non-de...
| pklausler wrote:
| Worse than the pitfalls that can arise with a correct
| compiler is the fact that most Fortran compilers have bugs
| with non-default lower bounds -- and they're not always the
| same bugs, so portability is a real problem. The feature is
| fine as it stood with Fortran '77 dummy arrays.
| pklausler wrote:
| The feature worked fine and was portable in Fortran '77, but
| its interactions with modern features are full of shocking
| pitfalls even when the compiler implements them correctly,
| which only two do, so it's not really portable either.
| bob1029 wrote:
| This seems like a really reasonable implementation looking at the
| actual physics loop. From a game design perspective, lookup
| tables can be a very powerful way for artists to interact with
| the physics. For example, it makes balancing 2 different vehicles
| a lot easier in conversation. You could say things like "I think
| we need to reduce the performance of XYZ between 1000 and 8000
| feet to balance with ABC". Inserting a new band into the table is
| an obvious exercise in Microsoft excel.
| ForHackernews wrote:
| 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?
| kyykky wrote:
| In mechanics simulations we often change the units to avoid
| adding small and large floats.
| lloydatkinson wrote:
| 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? :)
| ForHackernews wrote:
| Ok but if you did a global find-replace for "meters" with
| "smoots" do you think that the simulated plane would crash?
| lloydatkinson wrote:
| Ah but smoots would still follow the same maths as a meter
| right?
| ForHackernews wrote:
| Yes, that's how numbers work. 10 smoots + 1 smoot is 11
| smoots.
|
| That's the point of my question.
| meheleventyone wrote:
| They don't matter as long as the relative values and the
| relationships hold. For video games where you're making
| something arcadey you're often implementing the physical
| behavior in terms of regular old physics but the values used
| don't have to be real as long as you get the right results.
| It's just when you're simulating something real it's useful to
| have units that make intuitive sense and that's often real
| world units as we've built up a lot of understanding by using
| them already. In particular with a flight model based on look
| up tables from real world data it's already in a set of units.
| danhau wrote:
| They don't, but they have to be consistent. You wouldn't want
| to apply a hundred-fold torque because you mixed up your units.
| Karliss wrote:
| 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 readjusting not just major physics constants but also a
| bunch of poorly documented magic parameters designed to prevent
| Unity sim from exploding or wasting resources.
| ForHackernews wrote:
| That makes sense, then. If he's porting between two different
| physics engines, not just putting a visualization layer on
| top of an existing simulation translated from Fortran to C#.
| fp64 wrote:
| Physical units help modeling and review, it's much easier to
| sanity check values from just reading, and comparing constants.
| I've heard that for rendering/raytracing, a lot of people move
| to model light intensities by actual physical values which
| makes it much easier to author and compare - such as for
| example "oh I want a light here that is as bright as this old
| lightbulb I like so much, but there's sunlight also shining
| through the window". That's much easier than estimating it in
| arbitrary units, in particular as here human perception is non-
| linear. I assume this would be similar for other simulations.
| q3k wrote:
| Gravity doesn't scale this way. Earth's gravitational pull
| (~10m/s^2) is a constant that ties distance to time, so if you
| want to observe the same gravitational effects in the same
| gravitational pull on a small dimensional scale, you need to
| adjust the time scale to compensate.
|
| This is why scale model sets for practical VFX in cinema were
| always recorded at higher frame rates and then played back
| slower.
| ForHackernews wrote:
| That's only a problem if you're dealing with real gravity
| shooting real models in a real physical world. In a
| simulation, you can set G to whatever it needs to be.
|
| The acceleration defined to simulate gravity in this Fortran
| code is presumably already proportional to everything else
| defined in the simulation.
| q3k wrote:
| Right, but that's more effort than just using real units in
| the first place.
| UncleSlacky wrote:
| "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...
| bitwize wrote:
| Thats_the_joke.jpg
| forgotpwd16 wrote:
| Seems too good of pun to not be deliberate.
| Reubachi wrote:
| .......that's the joke
| ertucetin wrote:
| Here is Clojure implementation of Space Simulator:
| https://wedesoft.github.io/sfsim/
| master_crab wrote:
| I saw slugs and I immediately had PTSD from my days in aero
| engineering.
|
| Imagine trying to keep track of pounds in a single set of
| equations using subscripts m and f to differentiate between the
| units' use for both mass and force.
| throw0101c wrote:
| When I was growing up computers were getting faster by leaps and
| bounds, and I remember a video game that was so 'sophisticated'
| that it needed a _math (FP) co-processor_ (80387) to play some
| parts of it:
|
| > _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.
| ezconnect wrote:
| Falcon game still have a large following today.
| stackskipton wrote:
| Most people play Falcon BMS which is a mod of Falcon 4.
|
| https://www.falcon-bms.com/
| JunkDNA wrote:
| I have fond memories of playing the original Falcon on my Amiga
| 500. It felt like magic after years of playing F15 Strike Eagle
| on the Apple IIc. Hearing real sound effects kicking in the
| afterburner and getting too close to the ground ("Pull Up! Pull
| Up!") were all so satisfying.
|
| I remember being so excited when Falcon 3.0 came out. But it
| just felt like a let down. The graphics were amazing for the
| time and it seemed so realistic, but for me the realism is what
| killed all the fun. As a kid, I didn't actually want to BE an
| expert F16 pilot. I just wanted to feel like I was. I didn't
| want to have to learn all the systems and controls.
| psunavy03 wrote:
| Having been the kid who loved to geek out over flight sims,
| and then the adult who was fortunate enough to have flown
| military jets, I find the trend for uber-realistic military
| sims like DCS and such kind of sad in a way.
|
| I mean, the software itself is impressive. But the idea of
| grown adults geeking out over old versions of the NATOPS and
| trying to develop tactics and such is frankly cringe. You're
| never going to get it right, because the actual thing is
| classified. And from the outside looking in, it's like
| watching a kid put on Dad or Mom's suit jacket to play
| "office."
| throw0101d wrote:
| > _You 're never going to get it right, because the actual
| thing is classified._
|
| Except for the stuff leaked on the War Thunder forum.
| spankibalt wrote:
| Or, often Russian, FTP servers. Aaah, good times.
| mrguyorama wrote:
| >I find the trend for uber-realistic military sims like DCS
| and such kind of sad in a way.
|
| But things like Ace Combat, "H.A.W.X", War Thunder, Project
| Wingman, Nuclear Option, all those games are incredibly
| popular. The arcade combat genre is alive and well.
|
| I do wish games like VTOL VR, DCS, and other more serious
| sims had a "maybe don't make me read 700 pages of manual to
| lock and fire a missile" option. Even something as simple
| as VTOL VR telling me exactly what machine my targeting pod
| is locked onto would be nice. Just give me a name and basic
| specs. It's a damn game, I shouldn't need to memorize
| target silhouettes unless I want to.
|
| IL-2 Sturmovik: Great Battles actually does this well, with
| an entire page of "simplify things please" options.
| Scramblejams wrote:
| _Long-time Navy jet jock finds it "cringe" when people try
| to get a little break from the stresses of their life by
| attempting in a very small way to emulate what he
| achieved._
|
| I get your point but come on man, ease up. At least
| remember that some of those DCS-playing wage slaves helped
| fund your adventures.
| rprenger wrote:
| I felt a similar way when I moved from Chuck Yeager's Air
| Combat to (I think) F15 Strike Eagle 3. Yeager was the
| perfect mix for me. I remember rarely even seeing the enemy
| planes I was firing at in newer games.
| bentt wrote:
| Yeah the HIGH FIDELITY FLIGHT MODEL required that math co
| processor. When you turned it on it felt like you had tapped
| into the WOPR from Wargames!
| qmr wrote:
| Falcon 4.0 source code leak led to Falcon BMS, still actively
| developed today.
| spankibalt wrote:
| Falcon 4.0 was one of the worst bugfests I ever encountered,
| practically unplayable; the modding community did a
| tremendous job to fix and improve that mess. At the time of
| its release it was even worse than _Privateer 2: The
| Darkening_ , a title whose structural imperfections were only
| matched by its utterly bizarre Britkraft sci-fi setting.
| psunavy03 wrote:
| Privateer 2, as I recall, just had the "Privateer" name
| slapped on a completely unrelated project due to executive
| meddling.
|
| That aside, I kind of weirdly liked it. The story was hard
| as hell to follow, but the setting was interesting in a
| trippy way.
| groby_b wrote:
| I did enjoy the maps that came with it.
|
| Granted, I probably would've had an easier border crossing if I
| didn't have a flight map for Kuwaiti airspace, complete with
| markings for anti-air defenses in the backseat of my car that
| one time, but it was _still_ worth it :)
| HeyLaughingBoy wrote:
| I remember the opposite also. We used to play a lot of Robotron
| on my roommate's 8086 PC clone. Then he was so excited to
| upgrade to a '286. Robotron became unplayable. My guess is that
| it was coded with a lot of busy loops because it was so
| insanely fast on the 286 that a human simply didn't have time
| to respond.
|
| I guess they probably came up with a new version, dunno.
| saltcured wrote:
| This is actually the reason we had "turbo" buttons on PCs
| back then. It wasn't to overclock. Instead, it was to
| underclock to some backward-compatible CPU speed that would
| allow legacy software like that to hopefully work OK.
|
| However, I'm not sure how many different compatibility models
| were being targeted.
| enopod_ wrote:
| I just learned about the slug and I'm absolutely flabbergasted
| that this exists.
| colechristensen wrote:
| The confusion between force and mass tends not to get
| appreciated by many folks outside of engineering. Particularly
| in aerospace when you slip the surly bonds of earth and your
| mass stops being so bound to the force your feet impart on the
| floor.
| arethuza wrote:
| Other "interesting" units include: shakes, barns and bans
|
| https://en.wikipedia.org/wiki/Shake_(unit)
|
| https://en.wikipedia.org/wiki/Barn_(unit)
|
| https://en.wikipedia.org/wiki/Hartley_(unit)
| drewg123 wrote:
| My Mom was a FORTRAN programmer for a defense contractor from the
| late 50s to the mid 90s. She spent her career doing things like
| that F16 simulator. The last thing I remember her talking about
| was one of the B1 or B2 bombers.
|
| When I was elementary school age in the late 70s, I'd go into her
| office with her sometimes on school holidays that were not work
| holidays. She'd let me play Colossal Cave Adventure on a terminal
| in her office. I remember looking at printouts of code she was
| working on, and seeing a wireframe diagram of some futuristic
| plane. I think it must have been one of the first Stealth
| fighters. I wonder how many security protocols she broke by
| having me there... :)
|
| She passed a way many years ago, but I think she would have been
| excited to see work like this.
| AndrewKemendo wrote:
| FWIW she probably wasn't breaking any security protocols -
| basically as long as the kids can't read well they are fine to
| be escorted without the red light.
|
| I used to take my daughter into the SCIF when she was about 2
| when needed, and there was a week where I was took my son into
| work at the Pentagon.
|
| I working for Snake Clark at the time and people kept bringing
| him candies and treats. I think he was watching cartoons on
| Nick in the deputy's office most of the day. He gets a kick out
| of that story now.
| the__alchemist wrote:
| I do a double-take if I see a dog! I've seen babies, but I'm
| pretty sure anyone that can walk or talk would be a no-go. My
| assumption is OP wasn't in a facility like that.
| AndrewKemendo wrote:
| Ultimately it's up to the SSO/SSM/facility manager to make
| the risk call, and that's largely based on commander
| guidance and DSCID inspections from the HQ SSO.
|
| Plenty of shenanigans in JSOC scifs that wouldn't fly on
| NSA campus.
| drewg123 wrote:
| Correct.... It was an office in a suburban office park.. I
| remember there were some areas that I was not allowed in.
| But I don't know if that was for security reasons, or just
| due to general non-kid safe areas. I don't remember guards,
| but it was almost 50 years ago and I really can't recall.
|
| I interviewed at LANL early in my career, and I was struck
| by how much security there was. My mom's office was nowhere
| close to that level of security.
| matrix12 wrote:
| Until your kid reads off some classified terms off a burn
| bag...
| denpa wrote:
| Great story, thank you for sharing!
|
| Your mom was awesome :)
| reactordev wrote:
| Awesome read except I have one nit. Instead of writing
| translating functions to convert everything from US Customary
| units to Unity, Metric, and the rest of sanity, you should have
| converted everything to metric in the formulas. Rewritten the
| math. It's not that hard, it's not that difficult, saves you all
| those function calls, improves performance, and simplifies the
| math a whole bunch.
|
| Air density can become pliable, controllable. Thrust velocities
| match projectile spec velocities (m/s) making calculating
| intersect a breeze. Trust me, you want to convert the FORTRAN
| math into standard metric. They didn't believe in Base10 back
| then so do the math.
| pmarreck wrote:
| I was going to say this! Why not just convert all the constants
| and units once since the mathematical relationships are the
| same?
| kjellsbells wrote:
| Awesome achievement but I have to say the units stressed me out.
| I hope that in the real world there's some kind of dimensional
| analysis code linter that verifies no one is comparing slugs to
| feet or something, and that altitude doesn't go below zero.
| btrettel wrote:
| In practice, unit checking is almost never done on actual code,
| though it should be done. From what I recall, some Fortran
| folks have been trying to get unit checking into the Fortran
| standard itself since the 1970s without success.
|
| I was able to coerce Fortran's type system into checking units,
| but it comes with quite a few downsides: https://fortran-
| lang.discourse.group/t/compile-time-unit-che...
|
| An approach based on static analysis would not have the
| downsides I listed, but I personally would prefer being unable
| to compile the code at all if it had an error that could be
| detected.
| colechristensen wrote:
| Elaborate typing is what Ada was for.
| justsomehnguy wrote:
| > altitude doesn't go below zero
|
| Uhm...
|
| https://www.c-130.net/forum/viewtopic.php?p=9974&sid=bb425b3...
| noobermin wrote:
| In keeping with the discussion here a few days ago, this article
| demonstrates exactly my point about developer types not being the
| target for computational codes. Their interpolation routine looks
| extremely verbose already, I cannot imagine them attempting to
| solve or compute any other more complex formula like that beyond
| a mere 2d interpolator writing so verbosely like that. The result
| would be unreadable, to my eyes.
|
| Modern fortran has a bit more modern flavour to it, but formulae
| being so verbose would make the "formula" aspect of a code
| disappear.
| colechristensen wrote:
| Math or engineering people do not have problems with short
| symbol names, that's it. Also our formulas are complex. If you
| wrote out many of our formulas with long descriptive variable
| names the structure and relation between the variables would no
| longer be readable, there would be many more mistakes.
|
| We were educated doing these things on paper with pages and
| pages of math with these symbols.
|
| 20 years later I can still read just this fortran code and
| guess most of what's going on with no context needed.
|
| I have problems reading "developer code" that boil down to
| "where the hell is the part of the code that actually does
| something?!" being perpetually lost in layer among layer of
| abstraction with the relevant connecting pieces far far apart.
| nxobject wrote:
| Sometimes I dream about a language with a "blessed" editor
| that just had a rich 2D formula and matrix notation editor.
| Having context in the form of a formula is sometimes helpful
| in remembering what a pesky one-off variable name might
| mean...
| bentt wrote:
| This was such a thorough and entertaining writeup. Felt like art
| in a way. Utterly useless, but great historical reference and
| really funny at parts.
| vesrah wrote:
| I agree, this was a great read.
| gopla wrote:
| Great writeup! Here is the result of my take on the same process
| - but translating to JavaScript instead so the simulator runs in
| the browser.
|
| I later added the high fidelity flight dynamics model by
| translating C code.
|
| https://github.com/kristoffer-dyrkorn/flightsimulator
| throwaway2037 wrote:
| This is an epic blog post!
|
| In the words of Jerry Maguire: "You had me at hello."
|
| This early sentence really hooked me: > While I
| am a professional software engineer and I have worked in the
| aerospace industry, that doesn't mean that I understand what I'm
| doing.
|
| My favourite part: The image comparing X/Y/Z axis between
| different 3D modelling products: https://vazgriz.com/wp-
| content/uploads/2025/05/EmVSW5AW8AAoD...
|
| Plus the comment below can make you laugh hard enough to get Coca
| Cola up your nose! > Mathematically speaking,
| these are all equally valid. But we all know that Unreal made the
| worst possible choice
| psunavy03 wrote:
| The fact that this person put a snarky (???) next to the concept
| of measuring airspeed in knots makes me wonder just how familiar
| they are with aerospace in general. A knot is a standard
| measurement in part because one nautical mile is equal to one
| minute of latitude. Which is useful until the day we decide to
| start measuring lat/long in radians.
|
| I know it's fashionable in some circles to dump on everything
| non-metric, but these things are they way they are because of
| reasons, and airspeed is generally measured in either knots or
| Mach.
| fsckboy wrote:
| > _airspeed is generally measured in either knots or Mach_
|
| boatspeed is also measure in knots... but only very rarely in
| Mach (and not even primarily because the speed of sound in
| water is substantially higher than in air)
| psunavy03 wrote:
| Historically, I'm fairly certain airspeed was measured in
| knots because of boatspeed. In software terms, the problem of
| navigating over the Earth's surface was forked from boats to
| planes, and why re-invent the wheel?
|
| It also tends to be more of a standard in professional
| aviation, whereas some small civilian bugsmashers in the US
| use MPH, presumably because it's easier for the doctors and
| lawyers of the world to understand after driving their cars,
| and if you're VFR, who really cares?
| Stevvo wrote:
| Of interest: https://github.com/ericstoneking/42
|
| A serious spacecraft simulator. Likewise developed from ancient
| FORTRAN code, in this case ported to C.
| larholm wrote:
| Airplanes need air to fly [citation needed].
| somat wrote:
| On the subject of coordinate axis.
|
| I am pretty firmly in the Z-up camp, I mean I understand the Y-up
| camp, take a normal picture, or perhaps a side-scroller game, Y
| is up and down, the logical extension to three dimensions is to
| push z as depth. But I can't do it, I see X and Y as a in a map
| where the obvious Z direction is up and down. yes minecraft
| triggers me so hard, don't even get me started.
___________________________________________________________________
(page generated 2025-09-26 23:01 UTC)