Author Topic: Can any of you math guys give me a hand?  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

Offline Retsof

  • 210
  • Sanity is over-rated.
Can any of you math guys give me a hand?
Well, I was looking for a equation to help me with space scapes and such.  Basically, I wanted to plug in the distance and size of  planet and get back how many degrees of your view it takes up.  I found this in Wikipedia:
Quote
The angular diameter of an object can be calculated using the formula: δ=2arctan(1/2d/D) in which δ is the angular diameter, and d and D are the visual diameter of and the distance to the object, expressed in the same units. When D is much larger than d, δ may be approximated by the formula δ = d / D, in which the result is in radians.
Now, I just can't quite wrap my head around what that all means.  Could someone please clarify it?
:::PROUD VASUDAN RIGHTS SUPPORTER:::

"Get off my forum" -General Battuta
I can't help but hear a shotgun cocking with this.

 

Offline Kopachris

  • 28
  • send penguins
    • Steam
    • Twitter
Re: Can any of you math guys give me a hand?
Okay, let's say you have a planet that is 25,000 km in diameter, and you're 50,000 km away from it (values chosen for simplicity).  In a calculator, you'd plug in "2*tan-1(0.5*25000/50000)".  The "-1" part will likely be superscript on the key.  Simplifying, you could rewrite that as 2*tan-1(0.25) because 25000/50000 is one half, and a half times a half is a quarter.
----
My Bandcamp | Discord: Kopachris | My GitHub

 

Offline Dark RevenantX

  • 29
  • anonymity —> animosity
Re: Can any of you math guys give me a hand?
Sometimes it's easier just to make your own equations using fundamental ones.  It's what I do.  In this case, we don't know the field of view, so it's awfully hard to figure out how much is blocked off.

 

Offline Retsof

  • 210
  • Sanity is over-rated.
Re: Can any of you math guys give me a hand?
Sometimes it's easier just to make your own equations using fundamental ones.  It's what I do.  In this case, we don't know the field of view, so it's awfully hard to figure out how much is blocked off.
*Brings up terragen, dosen't help much, makes a guess*  I'd say at the default its 35 degres.
:::PROUD VASUDAN RIGHTS SUPPORTER:::

"Get off my forum" -General Battuta
I can't help but hear a shotgun cocking with this.

 

Offline watsisname

Re: Can any of you math guys give me a hand?
Here's a walkthrough of another example using a real object:  The moon.

Moon's distance = ~400,000km
Moon's diameter = ~3500km
What's the apparent angular size?

delta = 2arctan(.5d/D)
delta = 2arctan(.5*3500/400000)
delta = 2arctan(0.004375)
the argument for the arctan function is small, thus arctan(x) is approximately equal to x, thus
delta = 0.00875 radians.

Convert to degrees by multiplying by 180/pi.  This yeilds an angular diameter of 0.501°, which is in close agreement with the true value.
In my world of sleepers, everything will be erased.
I'll be your religion, your only endless ideal.
Slowly we crawl in the dark.
Swallowed by the seductive night.

 

Offline Retsof

  • 210
  • Sanity is over-rated.
Re: Can any of you math guys give me a hand?
thanks
:::PROUD VASUDAN RIGHTS SUPPORTER:::

"Get off my forum" -General Battuta
I can't help but hear a shotgun cocking with this.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Can any of you math guys give me a hand?
Don't they teach you anything useful in school?

 

Offline Retsof

  • 210
  • Sanity is over-rated.
Re: Can any of you math guys give me a hand?
I forgot it all, and I nearly failed Algebra II.
:::PROUD VASUDAN RIGHTS SUPPORTER:::

"Get off my forum" -General Battuta
I can't help but hear a shotgun cocking with this.

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Can any of you math guys give me a hand?
* Goober5000 reads thread title

* Goober5000 applauds

* Goober5000 leaves thread

  

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Can any of you math guys give me a hand?
At small apparent diameter angles (large relative distances), you can use the diameter as an approximation to the equation. It won't be exactly correct, but close.

However, as you get closer to the large body, you won't be seeing the actual diameter of the object but instead you will start to see a horizon, and you will have to calculate the field of view based on tangential lines:




...Like this.

r is the radius of the object, h is distance to the surface of the object. This method will also give you exact results regardless of the distance, so I would prefer to use this one.

Incidentally, this is the reason why it is very, very hard to make skyboxes that fill more than 90 degrees of the sky while preserving the correct geometry of a spherical body... As you see, you have to put the camera very close to the surface of the planet or moon, which very easily results in blurry or pixellated textures... :p
« Last Edit: March 21, 2010, 03:38:45 am by Herra Tohtori »
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.