Skip to content

Fix trigonometry in Camera section #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified images/01/camera-triangle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion learn/01-camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ For our camera system we only care about the yaw and pitch values so we won't di

![](/images/01/camera-triangle.png){:.img-fluid .center-block}{:width="250px" height="250px"}

If we define the hypotenuse to be of length 1 we know from trigonometry (soh cah toa) that the adjacant side's length is $$\cos \ \color{red}x/\color{purple}h = \cos \ \color{red}x/\color{purple}1 = \cos\ \color{red}x$$ and that the opposing side's length is $$\sin \ \color{green}y/\color{purple}h = \sin \ \color{green}y/\color{purple}1 = \sin\ \color{green}y$$. This gives us some general formulas for retrieving the length in both the x and y directions, depending on the given angle. Let's use this to calculate the components of the direction vector:
If we define the hypotenuse to be of length 1 we know from trigonometry (soh cah toa) that the adjacant side's length is $$\color{red}x\color{black} = \color{purple}h\color{black} \times \cos(\theta) = \color{purple}1\color{black} \times \cos(\theta) = \cos(\theta)$$ and that the opposing side's length is $$\color{green}y\color{black} = \color{purple}h\color{black} \times \sin(\theta) = \color{purple}1\color{black} \times \sin(\theta) = \sin(\theta)$$. This gives us some general formulas for retrieving the length in both the x and y directions, depending on the given angle. Let's use this to calculate the components of the direction vector:

![](/images/01/camera-pitch.png){:.img-fluid .center-block}{:width="231px" height="237px"}

Expand Down