Jump to content

How to find the altitude from a given atmospheric pressure?


Recommended Posts

I know how to convert a given altitude into it's Kerbin's atmospheric-pressure value, thanks to the wiki's pages on Atmosphere mechanics and Kerbin.

I want to know how to do the reverse; How can I convert a given atmospheric pressure to an altitude value?

[EDIT:]

Answer: For Kerbin, multiply the Natural Logarithm of the Pressure by the Atmospheric Scale, with one of those values (the result of the Logarithm, or the Atmospheric Scale) negated (reversed signal); The result is the Altitude of that specific pressure.

Thanks to Razor235, SnappingTurtle and UmbralRaptor. You guys are awesome!

Edited by AlmightyR
Question is answered.
Link to comment
Share on other sites

Oh, I know that from Java programming as "Log()", not "Ln()"...Now that I actually Google'd Natural Logarithm, I finally noticed the scientific notation is different! :blush:

Well, there is only one thing better than learning something: Learning more than just one something! :D

Question is answered!

Thanks a lot guys! It's nice to see KSP's community being as awesome as ever!

One (two) extra question(s) for @UmbralRaptor:

What is "datum_pressure" and how can I find it's value?

Edited by AlmightyR
Link to comment
Share on other sites

In()
Ln()

I've seen log() used for both base 10 and base e logs, but it seemed like it was more commonly used for base 10...

What is "datum_pressure" and how can I find it's value?
The pressure at datum (that is, 0) altitude. On planets/moons with water, this is sealevel. The values are on the KSP wiki.
Link to comment
Share on other sites

"log" is whatever logarithm the speaker feels like using that particular moment. It's usually base e or base 10, but sometimes base 2, and sometimes the speaker doesn't feel like spelling out which one exactly. You can get away with that because converting from one base to another is just a constant factor.

ln is always the natural log.

lg is always log base 2.

logx is always log base x.

Anything else is confusing. In some communities you can know what log means, but switch communities and you can start a flame war for using it and meaning a different one than what they expect.

Link to comment
Share on other sites

Though in most programming languages I've used, log(x) tends to mean natural log, there will sometimes be separate log10 and/or log2 functions or a 2-argument logarithm so you can specify an arbitrary base.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...