Bare with me here, I'm a software developer, I use math in my software, but never tried to calculate something this.
I have this formula which works fine:
function CalculateDegrees(pitch){
var result = 0;
var v2 = 12;
var hyp1 = Math.sqrt(Math.pow(pitch, 2) + Math.pow(v2, 2));
var ang1 = pitch / hyp1;
var ang2 = Math.acos(ang1);
result = ang2 * (180 / Math.PI);
result = Math.round(result * 100) / 100;
return result;
}
If you pass in a pitch of 12, the result is 45 degrees.
I'm wanting to create the exact opposite of this formula where Degrees would be passed in and Pitch is calculated and returned. I apologize if Pitch isn't the correct terminology for it, like I said, this definitely isn't my strong suit. I just need layman's terms as to how I would go about calculating that value.
I have this formula which works fine:
function CalculateDegrees(pitch){
var result = 0;
var v2 = 12;
var hyp1 = Math.sqrt(Math.pow(pitch, 2) + Math.pow(v2, 2));
var ang1 = pitch / hyp1;
var ang2 = Math.acos(ang1);
result = ang2 * (180 / Math.PI);
result = Math.round(result * 100) / 100;
return result;
}
If you pass in a pitch of 12, the result is 45 degrees.
I'm wanting to create the exact opposite of this formula where Degrees would be passed in and Pitch is calculated and returned. I apologize if Pitch isn't the correct terminology for it, like I said, this definitely isn't my strong suit. I just need layman's terms as to how I would go about calculating that value.