Plotting Binocular Disparity in Mathematica - Solve for f & d

  • Context: Mathematica 
  • Thread starter Thread starter SoggyBottoms
  • Start date Start date
  • Tags Tags
    Mathematica Plot
Click For Summary
SUMMARY

The discussion focuses on calculating and plotting binocular disparity using Mathematica. The formula for disparity, given as δ = Arctan(f/(D + d)) - Arctan(e/D) - Arctan((a - e)/D) + Arctan((a - f)/(D + d)), is applied with specific values: a = 6.5 cm, D = 40 cm, and e = 3.25 cm. The user successfully creates a 3D plot of the disparity function mydisparity[f, d] using the Plot3D function in Mathematica, demonstrating effective use of the software for visualizing functions of two variables.

PREREQUISITES
  • Understanding of binocular disparity and its mathematical representation.
  • Familiarity with Mathematica programming and syntax.
  • Knowledge of 3D plotting techniques in Mathematica.
  • Basic concepts of trigonometric functions, specifically ArcTan.
NEXT STEPS
  • Explore advanced 3D plotting techniques in Mathematica.
  • Learn about user-defined functions in Mathematica.
  • Investigate the effects of varying parameters on binocular disparity.
  • Study the application of binocular disparity in computer vision and graphics.
USEFUL FOR

This discussion is beneficial for mathematicians, computer scientists, and anyone interested in visualizing complex mathematical functions, particularly in the context of binocular vision and graphical representation in Mathematica.

SoggyBottoms
Messages
53
Reaction score
0
I calculated a binocular disparity [itex]\delta[/itex] of two points, see also this topic, and got the following formula:

[itex]\delta = Arctan(\frac{f}{D + d}) - Arctan(\frac{e}{D}) - Arctan(\frac{a - e}{D}) + Arctan(\frac{a - f}{D + d})[/itex]

The assignment now says: Choose a = 6.5 cm, D = 40 cm and e = 3.25 cm. Plot the disparity for [itex]f \in [e - 10, e + 10][/itex] (cm) and [itex]d \in [-20, 20][/itex] (cm).

Does anyone know how I could make such a plot?
 
Physics news on Phys.org
That's just a function of 2 variables ok, Note I do not use user-defined variable names that begin with capital letters as this may conflict with built-in functions:

Code:
a = 6.5; 
bigD = 40; 
e = 3.25;
 
mydisparity[f_, d_] := ArcTan[f/(bigD + d)] - 
   ArcTan[(a - e)/bigD] + ArcTan[(a - f)/(bigD - d)]
mydisparity[2, 3]

Plot3D[mydisparity[f, d], {f, e - 10, e + 10}, 
  {d, -20, 20}]
 
Thanks! I got it to work.
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
10
Views
3K