2

I would like to know what does the tan angle of field of view does. I have seen the following line of code which I'm trying to better understand,

float fovLeft = Mathf.Tan(-outerFieldOfView * Math.PI / 180);
float fovTop = Mathf.Tan(-upperFieldOfView * Math.PI / 180);
float fovRight = Mathf.Tan(-innerFieldOfView * Math.PI / 180);
float fovBottom = Mathf.Tan(-lowerFieldOfView * Math.PI / 180);

whereas outerFieldOfView is in degrees towards the side of the screen. I suppose that it is used to find the angle of view. is my understanding right? what exactly the tan of the field of view refer to?

user1241241
  • 664
  • 5
  • 20

1 Answers1

2

Following what parameters you know, the tangent could give the angle or deep or size of FOV:

to have a better knowledge of trigonometric begin HERE

enter image description here

Frenchy
  • 16,386
  • 3
  • 16
  • 39
  • so do they give a rough estimate of the depth of a vertex from the origin? Why is that the outerfieldofview has to be negative? – user1241241 May 05 '20 at 09:16
  • 1
    Yes..like i say, following what you know, tan is just a quick formula to give other information..you could use other ways to calculate the parameters (pythagore and so on) but trigonometric is just quick but need some math knowledges!!, and for the sign i suppose the sign is following the direction left/right or Up/down..without code its difficult to give more precisely infos but i am pretty sure that is linked with the direction – Frenchy May 05 '20 at 09:18
  • I have updated the question with the other three params which also shows the corresponding signs. It is being used to find the four corners on the screen based on the field of view of the camera. – user1241241 May 05 '20 at 09:27
  • no its how is calculated the angle outerFieldOfView...and so on.. – Frenchy May 05 '20 at 09:42
  • just fyi: tan(–θ)= – tan θ – Frenchy May 05 '20 at 09:46
  • could you please explain this, "no its how is calculated the angle outerFieldOfView.." – user1241241 May 05 '20 at 11:27
  • 1
    to discover the reason the angle is negative is to see how the angle is calculated... just curious !! – Frenchy May 05 '20 at 11:33