![](https://forum.kerbalspaceprogram.com/uploads/set_resources_17/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://forum.kerbalspaceprogram.com/uploads/set_resources_17/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png)
Yourself
Members-
Posts
134 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by Yourself
-
C, C++, C# Programming - what is the sense in this
Yourself replied to PB666's topic in Science & Spaceflight
Loss of type safety, loss of clarity because anyone familiar with the language can't be 100% sure what A is (is it a macro, is it a constant, what's its value?) without going through the source and finding it and all just to save two characters worth of typing? Just write 'A'. Could have done that without 8 nested loops. Honestly I'd just do the reversing with a lookup table (of course this is C#, I don't know VB): using System; public class Test { public static ulong ReverseAndFlip( ulong n ) { return ~Reverse( n ); } public static ulong Reverse( ulong n ) { return ( (ulong) smReverseByte[n & 0xFF] << 56 | (ulong) smReverseByte[(n >> 8) & 0xFF] << 48 | (ulong) smReverseByte[(n >> 16) & 0xFF] << 40 | (ulong) smReverseByte[(n >> 24) & 0xFF] << 32 | (ulong) smReverseByte[(n >> 32) & 0xFF] << 24 | (ulong) smReverseByte[(n >> 40) & 0xFF] << 16 | (ulong) smReverseByte[(n >> 48) & 0xFF] << 8 | (ulong) smReverseByte[n >> 56] ); } static Test() { var reverseNibble = new byte[] { 0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE, 0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF }; smReverseByte = new byte[256]; for( int i = 0; i < 0x10; ++i ) { int ni = i << 4; for( int j = 0; j < 0x10; ++j ) { smReverseByte[ni + j] = (byte) ( ( reverseNibble[j] << 4 ) | reverseNibble[i] ); } } } private static readonly byte[] smReverseByte; } -
C, C++, C# Programming - what is the sense in this
Yourself replied to PB666's topic in Science & Spaceflight
Well, for std::string, that's an easy question to answer: http://www.cplusplus.com/reference/string/string/max_size/ For a plain-old char array it's system dependent. Statically allocated char array will run into stack size limits really fast (the stack's not very big; although you can change how much memory is allocated to it), dynamically allocated with new...well...again, system dependent. The language itself puts no explicit constraints on the permitted sizes. -
Software engineers and the rest of the world.
Yourself replied to PB666's topic in Science & Spaceflight
It really is remarkable what consumer-grade hardware is actually capable of. And it just keeps getting better. -
I think you could definitely get away with less than double the delta-V of falling into the sun. Someone may have mentioned this already, but boosting to a higher orbit before then boosting to a retrograde orbit could actually be cheaper. Consider this little thought experiment: The delta-V to put yourself on an escape trajectory is about 41% of what's required to fall into the sun. So let's say you put yourself on an almost escape trajectory. So close to an escape trajectory that by the time you reach apoapsis, the delta-V to go retrograde is negligible (a few m/s). Then all that's left to do is to fall back to periapsis and recircularize (which costs another ~41%). So in total, you could put yourself in a retrograde orbit for about 82% of the delta-V cost of actually completely nulling out your motion and falling into the sun. Of course, this cost is limited by how long you're willing to wait. If you work out the math for this transfer you can find that the total delta-V cost of this maneuver as a fraction of the "twice the fall into the sun" delta-V, you get: ÃŽâ€V = 2 ÃŽâ€VSUN * ( sqrt(2 * (Rp + Ra) / Ra) - 1 ) Where Rp is the periapsis radius (the original circular orbit radius) and Ra is the apoapsis radius (how high you place your apoapsis in the transfer). Note that this a decreasing function of Ra. If Ra = Rp, we recover: ÃŽâ€V = 2 ÃŽâ€VSUN If we let Ra tend towards infinity then we get: ÃŽâ€V = 2 ÃŽâ€VSUN * ( sqrt(2) - 1 ) The time it takes to perform this entire maneuver and end up in the retrograde orbit is given by: T = 2 À sqrt( (Rp + Rf)³ / μ ) Or, expressed in terms of the orbital period of your original orbit: T = T0 ( 1 + Rf / Rp )3/2
-
Essentially it worked like a thrust reverser on a jet. Had the sail not been there and they'd just run the fan, the boat would have traveled in the opposite direction. I also imagine it's quite a bit more efficient that way as well.
-
Is Air Hogging Possible In Real Life?
Yourself replied to quasarrgames's topic in Science & Spaceflight
Mmm, not really. In fact, the most powerful jet engines ever created were high-bypass turbofans. They actually generate quite a bit of thrust and most of it is generated by the fan rather than the exhaust (which is what makes them high-bypass rather than low-bypass). This is kind of why they tend to be more fuel efficient, rather than trying to derive thrust directly from the combustion products exiting the back of the engine (like a rocket), the engine is instead designed to use more of the energy from the combustion to drive the fan which is producing the thrust. A turbofan is really just a ducted fan that happens to be driven by a gas turbine. Hence the name. The downside is that giant fan tends to be kind of heavy, so they're beaten in power-to-weight by low-bypass turbofans (which you'll see more often on aircraft that need to be maneuverable or need to operate at transonic or supersonic speeds). -
2 GW is approximately the amount of power delivered by sunlight to 2 km² of the Earth's surface (at noon near the equator). So if you want to imagine what something like a laser would do, imagine a 2 km² magnifying glass focusing sunlight into a relatively small area.
-
They sort of cheat kind of. What they actually have is a camera that can take a picture at a very precise moment in time. They then simply repeat the experiment a bunch of times taking pictures at slightly different time offsets. These pictures are then composited into a single video.
-
How long for a geostationary or geosync orbit to degrade?
Yourself replied to ravener's topic in Science & Spaceflight
I think that's more to do with the fact that Earth isn't perfectly spherical. -
On the subject of an off-center CoM, this is how the Apollo capsules controlled themselves during reentry. The CoM wasn't actually moveable, they just rolled the capsuled left or right to adjust the apparently vertical position of the CoM, which ended up changing the pitch of the capsule.
-
This actually brings up a very important point: most modern aircraft (especially military aircraft) are practically drones already. In order to get the kind of performance out of jets that we want, we kind of have to make them wildly unstable. Much as some might like to think that a pilot is actually flying an aircraft these days, in most cases they're really just a glorified drone operator that happens to be riding in the drone. If you think you outdo a computer at flying a plane, you're kidding yourself. Computers have access to much more accurate flight data and are capable of reacting literally in the blink of an eye. They don't get tired and they're not as susceptible to high-G maneuvers. Really the only thing humans have left over computers is visual processing ability.
-
That would certainly be more computationally expensive, but not necessarily that much more difficult. The solution wouldn't have to be perfect, just closer to what you'd actually get. The game could make several simplifying assumptions, such as the rocket being a point mass, no staging in the middle of the burn, and the rocket remains pointed in a fixed direction. I'd kind of like to see this as an unlockable guidance computer part. So you wouldn't have access to better prediction initially.
-
Well, they're rational numbers.
-
I don't think this is a well-formed question. It assumes that there is an intrinsic reason that the universe exists and, so far, that doesn't seem to be the case with this universe. It simply "is", there is no "why" to be answered, nor should we expect there to be.
-
So you can only count to 9 because you only know 10 numbers? And everything else is built out of those? I assure you that computers can count to more than 1, the fact that the representation is inherently binary doesn't mean there's some limitation there. Perhaps a more interesting thing to note is that every piece of data on your computer is an integer. I've always found that to be more amusing. The development of KSP is simply the search for a specific integer.
-
Increasing orbital velocity without affecting size of orbit?
Yourself replied to jebster's topic in Science & Spaceflight
If you want to increase your orbital velocity but maintain the same semi-major axis, then, yes, you'll have to constantly thrust towards the body you're orbiting (after you've increased your horizontal velocity). This also doesn't mean you go full throttle towards the planet, you have to get the right amount of thrust to make up precisely for your increased velocity (in effect making up for gravity that isn't there). -
The smoking gun (excuse the pun) for dark matter and not some sort of modified gravitational law is the Bullet Cluster. What makes it so compelling is that there's actually a very large discrepancy between the location of the visible matter and the observed gravitational effects (i.e. the location of the dark matter). What allows that to happen is that visible matter tends to be very clumpy. The electromagnetic force causes normal matter to stick together and form things like stars and planets. Since dark matter doesn't appear to interact through anything but gravity, there's nothing that allows it to stick together. It will still clump into gravitational clusters, but the clumping is generally pretty loose and fuzzy. So you end up with pretty low density (but nonetheless extremely massive) clouds of it. In the case of the Bullet Cluster it appears that a galactic collision managed to separate the dark matter from the visible matter by a measurable amount (which is unusual because gravity tends to keep all these things roughly in the same spot, it just took a very high speed collision to knock them apart).
-
Not exactly. As it stands black holes are not massive enough to hold together our galaxies (this is where that whole dark matter thing first showed up; there wasn't enough actual mass to account for the orbital velocities of the edges of galaxies). What makes us relatively certain that there is a black hole there is that it's the only thing that could cram that much mass into such a tiny area. So far its behavior is not inconsistent with our understanding of what black holes are, so there's no reason to postulate that it's anything different.
-
Don't feel bad, it's still a single player sandbox, so there isn't really any cheating at all. Play how you want. I mean, really, it's a single player sandbox, of course you're only "cheating yourself" there's no one else to cheat!
-
Not as much as you might think, especially since it can be effectively pre-computed for a given set of parts. Essentially you end up computing the eigenvectors of a given linear system. And you wouldn't even really be interested in all the eigenvectors, just the ones with the largest eigenvalues (because they'd have the most pronounced effect on the dynamics). There's many algorithms to do this, but they're not necessarily easy to implement (and that's ignoring the hard part of actually coming up with the linear system in the first place, which requires a bit of ugly mathematical analysis). Since we'd only be interested in a few of the eigenvectors, iterative approaches would likely be the easiest to implement and the fastest to execute. That said I still think this would be a stupid idea. Not for performance reasons (I've done quite a bit of linear algebra in C# .NET and you can get away with some surprisingly hairy calculations in real time), but mostly because the mathematics behind it is unnecessarily complicated and adds very little gameplay value.
-
Or when going into warp compute the total angular momentum of the craft and let it rotate as a rigid body. Warp doesn't have to be an all or nothing thing where we absolutely must preserve all physical behavior (because it already doesn't do this and it can't). In any case having the craft continue rotating as if it were a rigid body doesn't really seem like it's that game-breaking. Especially considering right now that warp is a really cheap way to reliably cancel all rotation of your craft period. I suppose if you were absolutely hell-bent on preserving the "wobble" modes through time-warp you could do a simplified vibrational analysis of the craft and record the first couple of vibrational modes in addition to the rotation. Done right it turns into solving an eigenvalue problem, but it can actually only be done once for a particular craft (well, once for each stage). Not that any part of that is particularly simple or easy, but it is at least technically possible.
-
Indeed, basically you're asking that rotation be put on rails. I don't see any problem with that. In order to rotate something you don't need to simulate all the orientations in between*, so there's not a huge computational cost to doing this. *Technically there could be some trickiness dealing with torque-free precession.