Created
July 25, 2018 18:21
-
-
Save rogersguedes/eb0e27db387f3c6ddb368b41e10f16a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //unidades: | |
| //distancia: metros (m) | |
| //angulo: radianos | |
| clear //apaga todas as variáveis do escopo atual | |
| clc // limpa a tela | |
| function deg = radToDeg(rad) | |
| deg = rad * 180 / %pi; | |
| endfunction | |
| function rad = degToRad(deg) | |
| rad = deg * %pi / 180; | |
| endfunction | |
| l = 0.4 // largura traseira do objeto observado | |
| theta = %pi/6 | |
| d = 5 // distância entre a camera e o objeto observado | |
| gama = atan( ( cos(theta) * d ) / ( sin(theta) * d +l/2) ) | |
| alpha = 2 * ( ( (%pi/2) - theta ) - gama ) | |
| dRe = sqrt( (sin(theta)*d + l/2)^2 + ( cos(theta)*d )^2 ) | |
| dLe = l * ( (sin(theta)) / (sin(alpha)) ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment